1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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<char, std::shared_ptr<ICommand>> Game::get_input_config(
const std::shared_ptr<IWindow> &window, const std::shared_ptr<IScene> &scene,
const std::shared_ptr<ICursorController> &cursor_controller) const noexcept
{
return {{'q', std::make_shared<QuitCommand>()},
{'i', std::make_shared<InsertCellCommand>(cursor_controller, scene)},
{'k', std::make_shared<MoveCursorCommand>(Vector2::up(), cursor_controller,
scene, window)},
{'j', std::make_shared<MoveCursorCommand>(Vector2::down(), cursor_controller,
scene, window)},
{'h', std::make_shared<MoveCursorCommand>(Vector2::left(), cursor_controller,
scene, window)},
{'l', std::make_shared<MoveCursorCommand>(Vector2::right(), cursor_controller,
scene, window)}};
}
|