aboutsummaryrefslogtreecommitdiff
path: root/src/engine/user/cursor.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-08 16:40:27 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit3359b00178357cb68d14e807c6deef3182532307 (patch)
tree1be93f2ff15baddd14dcbd7fee50fd2cf8f2fcac /src/engine/user/cursor.hpp
parent0e781f07bda4a73e89eb59b9765aa9f609647932 (diff)
refactor: make cursor controller track cursor pos itself
Diffstat (limited to 'src/engine/user/cursor.hpp')
-rw-r--r--src/engine/user/cursor.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp
index 84117c1..50dd028 100644
--- a/src/engine/user/cursor.hpp
+++ b/src/engine/user/cursor.hpp
@@ -31,15 +31,20 @@ const std::unordered_map<Vector2, std::string_view, Vector2Hasher> direction_for
class CursorController : public AutoWirable<CursorController, CursorController>
{
public:
- CursorController() = default;
+ CursorController();
- static void move(const Vector2 &direction, const uint32_t &amount);
+ void move(const Vector2 &direction, const uint32_t &amount) noexcept;
- static void move_to(const Vector2 &pos);
+ void move_to(const Vector2 &position) noexcept;
static void hide();
static void show();
- [[nodiscard]] static Vector2 where();
+ [[nodiscard]] Vector2 where() const noexcept;
+
+private:
+ Vector2 _position;
+
+ [[nodiscard]] static Vector2 _request_position() noexcept;
};