#include "bootstrap.hpp" // Interfaces #include "interfaces/argument_parser.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/randomization.hpp" #include "interfaces/scene.hpp" #include "interfaces/status_manager.hpp" #include "interfaces/statusline.hpp" #include "interfaces/statusline_subscriber_adapter.hpp" // Implementations #include "argument_parser.hpp" #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/game.hpp" #include "game/generation_tracker.hpp" #include "game/status_manager.hpp" #include "game/statusline_subscriber_adapter.hpp" #include "randomization/generator.hpp" #include "randomization/seed_generator.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(); 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); auto vector2_statusline_subscriber_adapter_factory = container.get>(); return std::make_unique( scene, cursor_controller, generation_tracker, status_manager, user_input_observer, vector2_statusline_subscriber_adapter_factory); }); container.bind().to_factory( [](const uint32_t &seed) { return std::make_unique(seed); }); 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( [](const std::shared_ptr &status_manager, std::vector sections) { return std::make_unique>( status_manager, [](std::size_t section_index, const Vector2 &position) { switch (section_index) { case 0: return fmt::format("{}", position.get_x()); case 1: return fmt::format("{}", position.get_y()); default: return std::string(""); } }, sections); }); container.bind().to_factory( [](bool is_paused) { return std::make_unique(is_paused); }); return container; }