diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-10 20:16:14 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:55 +0200 |
commit | c988905add09cf8baf46dc61279528f6f39f7a1a (patch) | |
tree | 0c53a36569875f8d4c6e53392876e10fa695c35e /src/engine/engine.cpp | |
parent | 38f14606c78c119d452f302f17329455e29a9a6f (diff) |
feat: add status bar
Diffstat (limited to 'src/engine/engine.cpp')
-rw-r--r-- | src/engine/engine.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 0227d5c..6050348 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -21,7 +21,7 @@ CLIGameEngine::CLIGameEngine(IGameFactory game_factory, ISceneFactory scene_fact void CLIGameEngine::start() noexcept { - auto scene = _scene_factory(); + auto scene = _scene_factory(_cursor_controller, _window); scene->enter(); _input_handler->enter_raw_mode(); @@ -43,10 +43,14 @@ void CLIGameEngine::start() noexcept const std::unordered_map<char, Callback> input_config = { {'q', InputActions::exit_success}, - {'k', InputActions::move_cursor(Vector2::up(), _cursor_controller, _window)}, - {'j', InputActions::move_cursor(Vector2::down(), _cursor_controller, _window)}, - {'h', InputActions::move_cursor(Vector2::left(), _cursor_controller, _window)}, - {'l', InputActions::move_cursor(Vector2::right(), _cursor_controller, _window)}}; + {'k', + InputActions::move_cursor(Vector2::up(), _cursor_controller, scene, _window)}, + {'j', + InputActions::move_cursor(Vector2::down(), _cursor_controller, scene, _window)}, + {'h', + InputActions::move_cursor(Vector2::left(), _cursor_controller, scene, _window)}, + {'l', InputActions::move_cursor(Vector2::right(), _cursor_controller, scene, + _window)}}; _configure_input(input_config); |