From 3f9004b598fc8006576db9b8d2ae4e080101101b Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 8 Jun 2022 16:06:03 +0200 Subject: refactor: give game responsibility of statusline --- src/bootstrap.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/bootstrap.cpp') diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp index 44ef211..e651512 100644 --- a/src/bootstrap.cpp +++ b/src/bootstrap.cpp @@ -29,12 +29,7 @@ #include "game/generation_tracker.hpp" #include "game/status_manager.hpp" -#include - #include -#include -#include -#include auto bootstrap() noexcept -> yacppdic::Container { @@ -43,6 +38,7 @@ auto bootstrap() noexcept -> yacppdic::Container container.bind().to(); container.bind().to(); container.bind().to(); + container.bind().to(); container.bind().to_factory( [&container]( @@ -50,11 +46,10 @@ auto bootstrap() noexcept -> yacppdic::Container const std::shared_ptr &cursor_controller, const std::shared_ptr &user_input_observer) { - std::shared_ptr statusline = container.get()( - Bounds({.width = scene->size().get_width(), .height = 1})); + const auto statusline_factory = container.get(); std::shared_ptr status_manager = - container.get()(statusline); + container.get(); std::shared_ptr generation_tracker = container.get()(true); @@ -62,6 +57,7 @@ auto bootstrap() noexcept -> yacppdic::Container const auto cell_helper_factory = container.get>(); return std::make_unique( + statusline_factory, scene, cursor_controller, generation_tracker, @@ -93,12 +89,6 @@ auto bootstrap() noexcept -> yacppdic::Container return std::make_unique(matrix_factory(size)); }); - container.bind().to_factory( - [](const std::shared_ptr &statusline) - { - return std::make_unique(statusline); - }); - container.bind().to_factory( [](bool is_paused) { -- cgit v1.2.3-18-g5258