diff options
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( |