diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-22 23:13:29 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:59 +0200 |
commit | b74611d2b20fc071b8a699f2ce25e61f60118d6e (patch) | |
tree | 55d4dbf727724f7f527f2acebea83abd34317329 /src/engine/engine.hpp | |
parent | b1183c712d94d38f75068bd62df006f73bd3550f (diff) |
refactor: improve input handling & remove commands
Diffstat (limited to 'src/engine/engine.hpp')
-rw-r--r-- | src/engine/engine.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/engine/engine.hpp b/src/engine/engine.hpp index 1e8a217..b34ea2b 100644 --- a/src/engine/engine.hpp +++ b/src/engine/engine.hpp @@ -12,7 +12,7 @@ #include <memory> #include <unordered_map> -constexpr auto MIN_TIME_SINCE_LAST_UPDATE_MILLIS = 100; +constexpr auto MIN_TIME_SINCE_LAST_UPDATE_MILLIS = 40; class CLIGameEngine : public ICLIGameEngine, public yacppdic::AutoWirable< @@ -20,14 +20,14 @@ class CLIGameEngine : public ICLIGameEngine, CLIGameEngine, IGameFactory, ISceneFactory, - IInputHandler, + IUserInputObserver, ICursorController> { public: CLIGameEngine( IGameFactory game_factory, ISceneFactory scene_factory, - std::shared_ptr<IInputHandler> input_handler, + std::shared_ptr<IUserInputObserver> user_input_observer, std::shared_ptr<ICursorController> cursor_controller) noexcept; void start() noexcept override; @@ -36,9 +36,6 @@ private: IGameFactory _game_factory; ISceneFactory _scene_factory; - std::shared_ptr<IInputHandler> _input_handler; + std::shared_ptr<IUserInputObserver> _user_input_observer; std::shared_ptr<ICursorController> _cursor_controller; - - void _configure_input( - const std::unordered_map<char, std::shared_ptr<ICommand>> &input_config) noexcept; }; |