From b74611d2b20fc071b8a699f2ce25e61f60118d6e Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 22 May 2022 23:13:29 +0200 Subject: refactor: improve input handling & remove commands --- src/game/game.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/game.hpp') diff --git a/src/game/game.hpp b/src/game/game.hpp index fb2ad63..fb6a5ed 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -3,6 +3,7 @@ #include "interfaces/cursor.hpp" #include "interfaces/game.hpp" #include "interfaces/generation_tracker.hpp" +#include "interfaces/input.hpp" #include "interfaces/scene.hpp" #include "interfaces/status_manager.hpp" #include "interfaces/statusline_subscriber_adapter.hpp" @@ -18,6 +19,7 @@ public: std::shared_ptr cursor_controller, std::shared_ptr generation_tracker, std::shared_ptr status_manager, + std::shared_ptr user_input_observer, IStatusLineSubscriberAdapterFactory vector2_statusline_subscriber_adapter_factory) noexcept; @@ -27,16 +29,16 @@ public: void on_exit() const noexcept override; - [[nodiscard]] auto get_input_config() const noexcept - -> std::unordered_map> override; - private: std::shared_ptr _scene; std::shared_ptr _cursor_controller; std::shared_ptr _generation_tracker; std::shared_ptr _status_manager; + std::shared_ptr _user_input_observer; IStatusLineSubscriberAdapterFactory _vector2_statusline_subscriber_adapter_factory; std::chrono::system_clock::time_point _last_update_time; + + void _move_cursor(const Vector2 &direction) noexcept; }; -- cgit v1.2.3-18-g5258