diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-20 14:09:48 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:56 +0200 |
commit | a9852bd2c5a601f9f9c58b1dff60e9130587657b (patch) | |
tree | 87830594a20614aa7f73f8dc15b86900e805dd4a /src/bootstrap.cpp | |
parent | 78f5d8cf644383adf20933ad64c160c07c2c54fb (diff) |
refactor: move on start & on exit details to the game class
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r-- | src/bootstrap.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp index 0ef0584..713991d 100644 --- a/src/bootstrap.cpp +++ b/src/bootstrap.cpp @@ -36,16 +36,17 @@ Container bootstrap() noexcept auto container = Container(); container.bind<IArgumentParser>().to<ArgumentParser>(); - container.bind<IGame>().to<Game>(); container.bind<IInputHandler>().to<InputHandler>(); container.bind<ICursorController>().to<CursorController>(); container.bind<ICLIGameEngine>().to<CLIGameEngine>(); container.bind<IWindow>().to<Window>(); container.bind<IGameFactory>().to_factory(normalize_lambda( - [&container]() + [](const std::shared_ptr<IWindow> &window, const std::shared_ptr<IScene> &scene, + const std::shared_ptr<ICursorController> &cursor_controller) { - return container.get<IGame>(); + return std::dynamic_pointer_cast<IGame>( + std::make_shared<Game>(window, scene, cursor_controller)); })); container.bind<IRandomNumberGeneratorFactory>().to_factory( |