From 78f5d8cf644383adf20933ad64c160c07c2c54fb Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 20 Mar 2022 13:17:16 +0100 Subject: refactor: improve input configuring structure --- src/game/game.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/game/game.cpp') diff --git a/src/game/game.cpp b/src/game/game.cpp index d7e9056..45e6a79 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1,3 +1,23 @@ #include "game.hpp" +#include "commands/insert_cell.hpp" +#include "commands/move_cursor.hpp" +#include "commands/quit.hpp" + void Game::run() noexcept {} + +std::unordered_map> Game::get_input_config( + const std::shared_ptr &window, const std::shared_ptr &scene, + const std::shared_ptr &cursor_controller) const noexcept +{ + return {{'q', std::make_shared()}, + {'i', std::make_shared(cursor_controller, scene)}, + {'k', std::make_shared(Vector2::up(), cursor_controller, + scene, window)}, + {'j', std::make_shared(Vector2::down(), cursor_controller, + scene, window)}, + {'h', std::make_shared(Vector2::left(), cursor_controller, + scene, window)}, + {'l', std::make_shared(Vector2::right(), cursor_controller, + scene, window)}}; +} -- cgit v1.2.3-18-g5258