aboutsummaryrefslogtreecommitdiff
path: root/src/game/statusline_subscriber_adapter.tpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-23 18:12:39 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commit18e1db1fb8692752f64d3912c3b5ff1818be9028 (patch)
tree38ccd9b4f29e5b2fa0fc07f84b425aa80378301a /src/game/statusline_subscriber_adapter.tpp
parent65ca89da7933b5927e31ca6f29f28a24b2838ebe (diff)
refactor: replace last subscriber patterned code
Diffstat (limited to 'src/game/statusline_subscriber_adapter.tpp')
-rw-r--r--src/game/statusline_subscriber_adapter.tpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/game/statusline_subscriber_adapter.tpp b/src/game/statusline_subscriber_adapter.tpp
deleted file mode 100644
index 9054772..0000000
--- a/src/game/statusline_subscriber_adapter.tpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include "statusline_subscriber_adapter.hpp"
-
-#include <utility>
-
-template <typename Context>
-StatusLineSubscriberAdapter<Context>::StatusLineSubscriberAdapter(
- std::shared_ptr<IStatusManager> status_manager,
- std::string (*format_func)(std::size_t section_index, const Context &context),
- const std::vector<StatusLineSection> &sections
-
- ) noexcept
- : _status_manager(std::move(status_manager)),
- _format_func(format_func),
- _sections(sections)
-{
-}
-
-template <typename Context>
-void StatusLineSubscriberAdapter<Context>::update(const Context &context) noexcept
-{
- for (std::size_t index = 0; const auto &section : _sections)
- {
- auto status = _format_func(index, context);
-
- _status_manager->set_section_body(_sections[index], status);
-
- index++;
- }
-}