aboutsummaryrefslogtreecommitdiff
path: root/src/engine/user/cursor.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-20 20:37:43 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:57 +0200
commit1972939ebde39a3e90a50b021b2322d028f344de (patch)
tree9ee0a7c78f082bec084189906f28dc679a20d339 /src/engine/user/cursor.hpp
parente6644d6b235005de9ba1b9884472fa5f5d8d6074 (diff)
refactor: move updating status from the move cursor command
Diffstat (limited to 'src/engine/user/cursor.hpp')
-rw-r--r--src/engine/user/cursor.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp
index 713ee31..3ba8a40 100644
--- a/src/engine/user/cursor.hpp
+++ b/src/engine/user/cursor.hpp
@@ -37,7 +37,7 @@ public:
void move(const Vector2 &direction, const uint32_t &amount) noexcept override;
- void move_to(const Vector2 &position) noexcept override;
+ void move_to(const Vector2 &position, bool silent) noexcept override;
[[nodiscard]] Vector2 where() const noexcept override;
@@ -47,6 +47,13 @@ public:
static void show() noexcept;
+ void subscribe(const Event &event, const Subscriber &subscriber) noexcept override;
+
+ void notify_subscribers(const Event &event,
+ const Context &context) const noexcept override;
+
private:
Vector2 _position;
+
+ std::unordered_map<CursorEvent, std::vector<Subscriber>> _subscribers;
};