#include "game.hpp" Game::Game(std::shared_ptr scene, std::shared_ptr input_handler) : _scene(std::move(scene)), _input_handler(std::move(input_handler)) { } void Game::run() { _scene->enter(); _input_handler->enter_raw_mode(); auto scene = _scene; auto input_handler = _input_handler; _input_handler->attach('q', [&input_handler, &scene]() { input_handler->leave_raw_mode(); scene->leave(); exit(EXIT_SUCCESS); }); _input_handler->listen(); _scene->leave(); }