aboutsummaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-22 23:13:29 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commitb74611d2b20fc071b8a699f2ce25e61f60118d6e (patch)
tree55d4dbf727724f7f527f2acebea83abd34317329 /src/game/game.hpp
parentb1183c712d94d38f75068bd62df006f73bd3550f (diff)
refactor: improve input handling & remove commands
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp8
1 files changed, 5 insertions, 3 deletions
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<ICursorController> cursor_controller,
std::shared_ptr<IGenerationTracker> generation_tracker,
std::shared_ptr<IStatusManager> status_manager,
+ std::shared_ptr<IUserInputObserver> user_input_observer,
IStatusLineSubscriberAdapterFactory<Vector2>
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<char, std::shared_ptr<ICommand>> override;
-
private:
std::shared_ptr<IScene> _scene;
std::shared_ptr<ICursorController> _cursor_controller;
std::shared_ptr<IGenerationTracker> _generation_tracker;
std::shared_ptr<IStatusManager> _status_manager;
+ std::shared_ptr<IUserInputObserver> _user_input_observer;
IStatusLineSubscriberAdapterFactory<Vector2>
_vector2_statusline_subscriber_adapter_factory;
std::chrono::system_clock::time_point _last_update_time;
+
+ void _move_cursor(const Vector2 &direction) noexcept;
};