From d27f1a89266e141a944f88e9080bdeca95c49da3 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 3 Mar 2022 20:40:29 +0100 Subject: refactor: add game initializer --- src/engine/game_initializer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/engine/game_initializer.cpp (limited to 'src/engine/game_initializer.cpp') diff --git a/src/engine/game_initializer.cpp b/src/engine/game_initializer.cpp new file mode 100644 index 0000000..9430999 --- /dev/null +++ b/src/engine/game_initializer.cpp @@ -0,0 +1,21 @@ +#include "game_initializer.hpp" + +#include + +GameInitializer::GameInitializer(std::shared_ptr scene, + std::shared_ptr input_handler, + std::shared_ptr game) + : _scene(std::move(scene)), + _input_handler(std::move(input_handler)), + _game(std::move(game)) +{ +} + +void GameInitializer::initialize() +{ + _scene->enter(); + + _input_handler->enter_raw_mode(); + + _game->run(*_scene, *_input_handler); +} -- cgit v1.2.3-18-g5258