#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_updater.hpp" #include "interfaces/statusline.hpp" #include "interfaces/window.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/window.hpp" #include "engine/user/cursor.hpp" #include "engine/user/input.hpp" #include "game/game.hpp" #include "game/generation_tracker.hpp" #include "game/status_updater.hpp" #include "game/statusline.hpp" #include "randomization/generator.hpp" #include "randomization/seed_generator.hpp" #include "DI/factory.hpp" #include #include #include auto bootstrap() noexcept -> Container { auto container = Container(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to_factory( [&container]( const std::shared_ptr &window, const std::shared_ptr &scene, const std::shared_ptr &cursor_controller ) { std::shared_ptr statusline = container.get()(cursor_controller, window); std::shared_ptr generation_tracker = container.get()(true); std::shared_ptr status_updater = container.get()(statusline, generation_tracker); return std::make_unique( window, scene, cursor_controller, statusline, generation_tracker, status_updater ); } ); 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, const std::shared_ptr &window ) { auto matrix_factory = container.get>(); return std::make_unique(matrix_factory, cursor_controller, window); } ); container.bind().to_factory( [](const std::shared_ptr &cursor_controller, const std::shared_ptr &window) { return std::make_unique(cursor_controller, window); } ); container.bind().to_factory( [](const std::shared_ptr &statusline, const std::shared_ptr &generation_tracker) { return std::make_unique(statusline, generation_tracker); } ); container.bind().to_factory( [](bool is_paused) { return std::make_unique(is_paused); } ); return container; }