aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r--src/bootstrap.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp
index 02ec92d..adb53a2 100644
--- a/src/bootstrap.cpp
+++ b/src/bootstrap.cpp
@@ -2,6 +2,7 @@
// Interfaces
#include "interfaces/argument_parser.hpp"
+#include "interfaces/cell_helper.hpp"
#include "interfaces/cursor.hpp"
#include "interfaces/engine.hpp"
#include "interfaces/game.hpp"
@@ -23,6 +24,7 @@
#include "engine/graphics/statusline.hpp"
#include "engine/user/cursor.hpp"
#include "engine/user/input.hpp"
+#include "game/cell_helper.hpp"
#include "game/game.hpp"
#include "game/generation_tracker.hpp"
#include "game/status_manager.hpp"
@@ -51,7 +53,7 @@ auto bootstrap() noexcept -> yacppdic::Container
[&container](
const std::shared_ptr<IScene> &scene,
const std::shared_ptr<ICursorController> &cursor_controller,
- const std::shared_ptr<IUserInputObserver> user_input_observer)
+ const std::shared_ptr<IUserInputObserver> &user_input_observer)
{
std::shared_ptr<IStatusLine> statusline =
container.get<IStatusLineFactory>()(cursor_controller, scene);
@@ -62,12 +64,15 @@ auto bootstrap() noexcept -> yacppdic::Container
std::shared_ptr<IGenerationTracker> generation_tracker =
container.get<IGenerationTrackerFactory>()(true);
+ const auto cell_helper_factory = container.get<ICellHelperFactory<char>>();
+
return std::make_unique<Game>(
scene,
cursor_controller,
generation_tracker,
status_manager,
- user_input_observer);
+ user_input_observer,
+ cell_helper_factory(*(scene->get_matrix())));
});
container.bind<IRandomNumberGeneratorFactory>().to_factory(
@@ -109,5 +114,11 @@ auto bootstrap() noexcept -> yacppdic::Container
return std::make_unique<GenerationTracker>(is_paused);
});
+ container.bind<ICellHelperFactory<char>>().to_factory(
+ [](const IMatrix<char> &matrix)
+ {
+ return std::make_unique<CellHelper<char>>(matrix);
+ });
+
return container;
}