diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-10 19:12:31 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:55 +0200 |
commit | 38f14606c78c119d452f302f17329455e29a9a6f (patch) | |
tree | 03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/engine/game_initializer.cpp | |
parent | 09848ad31af6a1c70d64fccee711e231afb5a77f (diff) |
refactor: rename game initializer & move input config
Diffstat (limited to 'src/engine/game_initializer.cpp')
-rw-r--r-- | src/engine/game_initializer.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/engine/game_initializer.cpp b/src/engine/game_initializer.cpp deleted file mode 100644 index 13d9ba0..0000000 --- a/src/engine/game_initializer.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "game_initializer.hpp" - -#include "util/function.hpp" - -#include <cstdlib> -#include <utility> - -GameInitializer::GameInitializer(std::shared_ptr<IScene> scene, - std::shared_ptr<IInputHandler> input_handler, - IGameFactory game_factory) - : _scene(std::move(scene)), - _input_handler(std::move(input_handler)), - _game_factory(game_factory) -{ -} - -void GameInitializer::initialize() -{ - _scene->enter(); - _input_handler->enter_raw_mode(); - - std::atexit(normalize_lambda( - [this]() - { - _scene->leave(); - _input_handler->leave_raw_mode(); - })); - - auto game = _game_factory(); - - game->run(*_scene, *_input_handler); -} |