aboutsummaryrefslogtreecommitdiff
path: root/src/engine/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/engine.cpp')
-rw-r--r--src/engine/engine.cpp14
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);