aboutsummaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-08 17:00:18 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commite0eaff89b5f3f289bf5d560ea64b969c90d32d18 (patch)
treea6e91afcf89abc91629f2bee545ccadacf9bb673 /src/engine
parent3359b00178357cb68d14e807c6deef3182532307 (diff)
refactor: add cursor controller interface
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/user/cursor.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp
index 50dd028..977bfdf 100644
--- a/src/engine/user/cursor.hpp
+++ b/src/engine/user/cursor.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "DI/auto_wirable.hpp"
+#include "interfaces/cursor.hpp"
#include "engine/data/vector2.hpp"
@@ -28,20 +29,21 @@ const std::unordered_map<Vector2, std::string_view, Vector2Hasher> direction_for
{Vector2::left(), MOVE_CURSOR_LEFT},
{Vector2::right(), MOVE_CURSOR_RIGHT}};
-class CursorController : public AutoWirable<CursorController, CursorController>
+class CursorController : public ICursorController,
+ public AutoWirable<ICursorController, CursorController>
{
public:
CursorController();
- void move(const Vector2 &direction, const uint32_t &amount) noexcept;
+ void move(const Vector2 &direction, const uint32_t &amount) noexcept override;
- void move_to(const Vector2 &position) noexcept;
+ void move_to(const Vector2 &position) noexcept override;
static void hide();
static void show();
- [[nodiscard]] Vector2 where() const noexcept;
+ [[nodiscard]] Vector2 where() const noexcept override;
private:
Vector2 _position;