diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-10 19:12:31 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:55 +0200 |
commit | 38f14606c78c119d452f302f17329455e29a9a6f (patch) | |
tree | 03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/engine/engine.hpp | |
parent | 09848ad31af6a1c70d64fccee711e231afb5a77f (diff) |
refactor: rename game initializer & move input config
Diffstat (limited to 'src/engine/engine.hpp')
-rw-r--r-- | src/engine/engine.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/engine/engine.hpp b/src/engine/engine.hpp new file mode 100644 index 0000000..504fc28 --- /dev/null +++ b/src/engine/engine.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include "DI/auto_wirable.hpp" +#include "interfaces/cursor.hpp" +#include "interfaces/engine.hpp" +#include "interfaces/game.hpp" +#include "interfaces/input.hpp" +#include "interfaces/observable.hpp" +#include "interfaces/scene.hpp" +#include "interfaces/window.hpp" + +#include <memory> +#include <unordered_map> + +class CLIGameEngine + : public ICLIGameEngine, + public AutoWirable<ICLIGameEngine, CLIGameEngine, IGameFactory, ISceneFactory, + IInputHandler, ICursorController, IWindow> +{ +public: + CLIGameEngine(IGameFactory game_factory, ISceneFactory scene_factory, + std::shared_ptr<IInputHandler> input_handler, + std::shared_ptr<ICursorController> cursor_controller, + std::shared_ptr<IWindow> window) noexcept; + + void start() noexcept override; + +private: + IGameFactory _game_factory; + ISceneFactory _scene_factory; + + std::shared_ptr<IInputHandler> _input_handler; + std::shared_ptr<ICursorController> _cursor_controller; + std::shared_ptr<IWindow> _window; + + void _configure_input(const std::unordered_map<char, Callback> &input_config); +}; |