#include "bootstrap.hpp" #include #include #include #include #include "engine/engine.hpp" #include "engine/graphics/component_renderer.hpp" #include "engine/graphics/matrix.hpp" #include "engine/graphics/matrix_impl.hpp" #include "engine/graphics/matrix_iterator.hpp" #include "engine/graphics/matrix_iterator_impl.hpp" #include "engine/graphics/scene.hpp" #include "engine/user/cursor.hpp" #include "engine/user/input.hpp" #include "game/RLE_reader.hpp" #include "game/cell_helper.hpp" #include "game/cell_helper_impl.hpp" #include "game/components/statusline.hpp" #include "game/game.hpp" #include "game/generation_tracker.hpp" #include "game/status_manager.hpp" #include "interfaces/RLE_reader.hpp" #include "interfaces/cell_helper.hpp" #include "interfaces/component.hpp" #include "interfaces/component_renderer.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" class Bounds; auto bootstrap() noexcept -> yacppdic::DIContainer { auto di_container = yacppdic::DIContainer(); di_container.bind().to(); di_container.bind().to(); di_container.bind().to(); di_container.bind().to(); di_container.bind().to(); di_container.bind().to(); di_container.bind().to_factory( [&di_container]( const std::shared_ptr &scene, const std::shared_ptr &cursor_controller, const std::shared_ptr &user_input_observer) { const auto statusline_factory = di_container.get(); std::shared_ptr status_manager = di_container.get(); std::shared_ptr generation_tracker = di_container.get()(true); const auto cell_helper_factory = di_container.get>(); std::shared_ptr rle_reader = di_container.get(); return std::make_unique( statusline_factory, scene, cursor_controller, generation_tracker, status_manager, user_input_observer, cell_helper_factory(*(scene->get_matrix())), rle_reader); }); di_container.bind>().to_factory( [](const Bounds &bounds) { return std::make_unique>(bounds); }); di_container.bind>().to_factory( [](const Bounds &bounds) { return std::make_unique>(bounds); }); di_container.bind().to_factory( [&di_container](const Bounds &size) { const auto matrix_factory = di_container.get>(); return std::make_unique(matrix_factory(size)); }); di_container.bind().to_factory( [](bool is_paused) { return std::make_unique(is_paused); }); di_container.bind>().to_factory( [](const IMatrix &matrix) { return std::make_unique>(matrix); }); di_container.bind().to_factory( [](const std::shared_ptr &cursor_controller) { return std::make_unique(cursor_controller); }); return di_container; }