#include "bootstrap.hpp" // Interfaces #include "interfaces/cell_helper.hpp" #include "interfaces/cursor.hpp" #include "interfaces/engine.hpp" #include "interfaces/game.hpp" #include "interfaces/generation_tracker.hpp" #include "interfaces/input.hpp" #include "interfaces/matrix.hpp" #include "interfaces/scene.hpp" #include "interfaces/status_manager.hpp" #include "interfaces/statusline.hpp" // Implementations #include "engine/data/bounds.hpp" #include "engine/data/vector2.hpp" #include "engine/engine.hpp" #include "engine/graphics/matrix.hpp" #include "engine/graphics/scene.hpp" #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" #include #include #include #include #include #include auto bootstrap() noexcept -> yacppdic::Container { auto container = yacppdic::Container(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to_factory( [&container]( const std::shared_ptr &scene, const std::shared_ptr &cursor_controller, const std::shared_ptr &user_input_observer) { std::shared_ptr statusline = container.get()(cursor_controller, scene); std::shared_ptr status_manager = container.get()(statusline); std::shared_ptr generation_tracker = container.get()(true); const auto cell_helper_factory = container.get>(); return std::make_unique( scene, cursor_controller, generation_tracker, status_manager, user_input_observer, cell_helper_factory(*(scene->get_matrix()))); }); container.bind>().to_factory( [](const Bounds &bounds) { return std::make_unique>(bounds); }); container.bind().to_factory( [&container](const std::shared_ptr &cursor_controller) { auto matrix_factory = container.get>(); return std::make_unique(matrix_factory, cursor_controller); }); container.bind().to_factory( [](const std::shared_ptr &cursor_controller, const std::shared_ptr &scene) { return std::make_unique(cursor_controller, scene); }); container.bind().to_factory( [](const std::shared_ptr &statusline) { return std::make_unique(statusline); }); container.bind().to_factory( [](bool is_paused) { return std::make_unique(is_paused); }); container.bind>().to_factory( [](const IMatrix &matrix) { return std::make_unique>(matrix); }); return container; }