aboutsummaryrefslogtreecommitdiff
path: root/src/engine/game_initializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/game_initializer.cpp')
-rw-r--r--src/engine/game_initializer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/game_initializer.cpp b/src/engine/game_initializer.cpp
index 52e109a..13d9ba0 100644
--- a/src/engine/game_initializer.cpp
+++ b/src/engine/game_initializer.cpp
@@ -7,10 +7,10 @@
GameInitializer::GameInitializer(std::shared_ptr<IScene> scene,
std::shared_ptr<IInputHandler> input_handler,
- std::shared_ptr<IGame> game)
+ IGameFactory game_factory)
: _scene(std::move(scene)),
_input_handler(std::move(input_handler)),
- _game(std::move(game))
+ _game_factory(game_factory)
{
}
@@ -26,5 +26,7 @@ void GameInitializer::initialize()
_input_handler->leave_raw_mode();
}));
- _game->run(*_scene, *_input_handler);
+ auto game = _game_factory();
+
+ game->run(*_scene, *_input_handler);
}