From e0eaff89b5f3f289bf5d560ea64b969c90d32d18 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 8 Mar 2022 17:00:18 +0100 Subject: refactor: add cursor controller interface --- src/engine/user/cursor.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/engine') 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 direction_for {Vector2::left(), MOVE_CURSOR_LEFT}, {Vector2::right(), MOVE_CURSOR_RIGHT}}; -class CursorController : public AutoWirable +class CursorController : public ICursorController, + public AutoWirable { 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; -- cgit v1.2.3-18-g5258