diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game.cpp | 14 | ||||
-rw-r--r-- | src/game/game.hpp | 10 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp index e785e18..9b08adc 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1,9 +1,15 @@ #include "game.hpp" -#include <iostream> +#include <chrono> +#include <thread> -Game::Game(IVector2Factory vector2_factory) : _vector2_factory(std::move(vector2_factory)) +Game::Game(const std::shared_ptr<IScene> &scene) : _scene(scene) {} + +void Game::run() { -} + _scene->enter(); -void Game::run() {} + std::this_thread::sleep_for(std::chrono::seconds(3)); + + _scene->leave(); +} diff --git a/src/game/game.hpp b/src/game/game.hpp index 4c7e5e1..6abb349 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -2,15 +2,17 @@ #include "DI/auto_wirable.hpp" #include "interfaces/game.hpp" -#include "interfaces/vector2.hpp" +#include "interfaces/scene.hpp" -class Game : public IGame, public AutoWirable<IGame, Game, IVector2Factory> +#include <memory> + +class Game : public IGame, public AutoWirable<IGame, Game, IScene> { public: - explicit Game(IVector2Factory vector2_factory); + explicit Game(const std::shared_ptr<IScene> &scene); void run() override; private: - IVector2Factory _vector2_factory; + const std::shared_ptr<IScene> &_scene; }; |