#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/scene.hpp" #include "engine/graphics/string_matrix.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 "util/function.hpp" #include #include #include Container bootstrap() noexcept { auto container = Container(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to(); container.bind().to_factory(normalize_lambda( [&container](const std::shared_ptr &window, const std::shared_ptr &scene, const std::shared_ptr &cursor_controller) { auto statusline = container.get()(cursor_controller, window); auto generation_tracker = container.get()(true); auto status_updater = container.get()(statusline, generation_tracker); return std::dynamic_pointer_cast( std::make_shared(window, scene, cursor_controller, statusline, generation_tracker, status_updater)); })); container.bind().to_factory( [](const uint32_t &seed) { return std::dynamic_pointer_cast( std::make_shared(seed)); }); container.bind().to_factory( []() { return std::dynamic_pointer_cast( std::make_shared(std::make_unique())); }); container.bind>().to_factory( [](const Bounds &bounds) { return std::dynamic_pointer_cast>( std::make_shared(bounds)); }); container.bind().to_factory(normalize_lambda( [&container](const std::shared_ptr &cursor_controller, const std::shared_ptr &window) { return std::dynamic_pointer_cast( std::make_shared(container.get>(), cursor_controller, window)); })); container.bind().to_factory( [](const std::shared_ptr &cursor_controller, const std::shared_ptr &window) { return std::dynamic_pointer_cast( std::make_shared(cursor_controller, window)); }); container.bind().to_factory( [](const std::shared_ptr &status_line, const std::shared_ptr &generation_tracker) { return std::dynamic_pointer_cast( std::make_shared(status_line, generation_tracker)); }); container.bind().to_factory( [](bool is_paused) { return std::dynamic_pointer_cast( std::make_shared(is_paused)); }); return container; }