diff options
Diffstat (limited to 'src/game/status_manager.cpp')
-rw-r--r-- | src/game/status_manager.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/game/status_manager.cpp b/src/game/status_manager.cpp index 3f2df01..c7d80e9 100644 --- a/src/game/status_manager.cpp +++ b/src/game/status_manager.cpp @@ -12,23 +12,21 @@ StatusManager::StatusManager(std::shared_ptr<IStatusLine> statusline) noexcept void StatusManager::initialize() noexcept { - _statusline->set_section_length(StatusLineSection::A, 5U); - _statusline->set_section_length(StatusLineSection::B, 15U); - _statusline->set_section_length(StatusLineSection::C, 15U); - _statusline->set_section_length(StatusLineSection::D, 20U); - _statusline->set_section_length(StatusLineSection::E, 25U); - _statusline->set_section_length(StatusLineSection::F, 60U); - _statusline->set_section_length(StatusLineSection::G, 30U); - _statusline->set_section_length(StatusLineSection::H, 30U); - - _statusline->initialize_background(); + _statusline->set_section_length(StatusLineSection::A, 5); + _statusline->set_section_length(StatusLineSection::B, 15); + _statusline->set_section_length(StatusLineSection::C, 15); + _statusline->set_section_length(StatusLineSection::D, 20); + _statusline->set_section_length(StatusLineSection::E, 25); + _statusline->set_section_length(StatusLineSection::F, 60); + _statusline->set_section_length(StatusLineSection::G, 30); + _statusline->set_section_length(StatusLineSection::H, 30); } void StatusManager::set_section_title( const StatusLineSection §ion, const std::string_view &title) noexcept { - if (_title_lengths.count(section) != 0) + if (_title_lengths.contains(section)) { fmt::print(stderr, "Error: can't set statusbar section title more than once"); return; @@ -36,7 +34,7 @@ void StatusManager::set_section_title( _statusline->set_status(section, title); - _title_lengths[section] = title.length(); + _title_lengths[section] = static_cast<int>(title.length()); } void StatusManager::set_section_body( @@ -47,3 +45,8 @@ void StatusManager::set_section_body( _statusline->set_status(section, body, section_title_length + 1); } + +auto StatusManager::get_statusline() const noexcept -> std::shared_ptr<IStatusLine> +{ + return _statusline; +} |