#include "game.hpp" #include Game::Game(std::shared_ptr cursor_controller) : _cursor_controller(std::move(cursor_controller)) { } void Game::run(IScene &scene, IInputHandler &input_handler) { input_handler.attach('q', [&input_handler, &scene]() { input_handler.leave_raw_mode(); scene.leave(); exit(EXIT_SUCCESS); }); auto cursor_controller = _cursor_controller; input_handler.attach('k', [&cursor_controller]() { cursor_controller->move(1U); }); input_handler.attach('j', [&cursor_controller]() { cursor_controller->move(1U); }); input_handler.attach('h', [&cursor_controller]() { cursor_controller->move(1U); }); input_handler.attach('l', [&cursor_controller]() { cursor_controller->move(1U); }); input_handler.listen(); }