From 18e1db1fb8692752f64d3912c3b5ff1818be9028 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 23 May 2022 18:12:39 +0200 Subject: refactor: replace last subscriber patterned code --- src/game/statusline_subscriber_adapter.tpp | 31 ------------------------------ 1 file changed, 31 deletions(-) delete mode 100644 src/game/statusline_subscriber_adapter.tpp (limited to 'src/game/statusline_subscriber_adapter.tpp') 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 - -template -StatusLineSubscriberAdapter::StatusLineSubscriberAdapter( - std::shared_ptr status_manager, - std::string (*format_func)(std::size_t section_index, const Context &context), - const std::vector §ions - - ) noexcept - : _status_manager(std::move(status_manager)), - _format_func(format_func), - _sections(sections) -{ -} - -template -void StatusLineSubscriberAdapter::update(const Context &context) noexcept -{ - for (std::size_t index = 0; const auto §ion : _sections) - { - auto status = _format_func(index, context); - - _status_manager->set_section_body(_sections[index], status); - - index++; - } -} -- cgit v1.2.3-18-g5258