diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-23 18:12:39 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:59 +0200 |
commit | 18e1db1fb8692752f64d3912c3b5ff1818be9028 (patch) | |
tree | 38ccd9b4f29e5b2fa0fc07f84b425aa80378301a /src/bootstrap.cpp | |
parent | 65ca89da7933b5927e31ca6f29f28a24b2838ebe (diff) |
refactor: replace last subscriber patterned code
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r-- | src/bootstrap.cpp | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp index 6d42263..ef54940 100644 --- a/src/bootstrap.cpp +++ b/src/bootstrap.cpp @@ -12,7 +12,6 @@ #include "interfaces/scene.hpp" #include "interfaces/status_manager.hpp" #include "interfaces/statusline.hpp" -#include "interfaces/statusline_subscriber_adapter.hpp" // Implementations #include "argument_parser.hpp" @@ -27,7 +26,6 @@ #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" @@ -64,16 +62,12 @@ auto bootstrap() noexcept -> yacppdic::Container std::shared_ptr<IGenerationTracker> generation_tracker = container.get<IGenerationTrackerFactory>()(true); - auto vector2_statusline_subscriber_adapter_factory = - container.get<IStatusLineSubscriberAdapterFactory<Vector2>>(); - return std::make_unique<Game>( scene, cursor_controller, generation_tracker, status_manager, - user_input_observer, - vector2_statusline_subscriber_adapter_factory); + user_input_observer); }); container.bind<IRandomNumberGeneratorFactory>().to_factory( @@ -109,27 +103,6 @@ auto bootstrap() noexcept -> yacppdic::Container return std::make_unique<StatusManager>(statusline); }); - container.bind<IStatusLineSubscriberAdapterFactory<Vector2>>().to_factory( - [](const std::shared_ptr<IStatusManager> &status_manager, - std::vector<StatusLineSection> sections) - { - return std::make_unique<StatusLineSubscriberAdapter<Vector2>>( - 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<IGenerationTrackerFactory>().to_factory( [](bool is_paused) { |