From c988905add09cf8baf46dc61279528f6f39f7a1a Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 10 Mar 2022 20:16:14 +0100 Subject: feat: add status bar --- src/engine/engine.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/engine/engine.cpp') 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 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); -- cgit v1.2.3-18-g5258