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.cpp21
1 files changed, 21 insertions, 0 deletions
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 <utility>
+
+GameInitializer::GameInitializer(std::shared_ptr<IScene> scene,
+ std::shared_ptr<IInputHandler> input_handler,
+ std::shared_ptr<IGame> 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);
+}