aboutsummaryrefslogtreecommitdiff
path: root/src/game/statusline.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-02 22:36:21 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:58 +0200
commitfb080f6fb911b1831c176a06259e384772541dd5 (patch)
treee18140e700cd974f84a5630f41fcb0b496b7e772 /src/game/statusline.hpp
parent40d02748924aa7c48b04cf948204d8dacdfbbc74 (diff)
refactor: seperate statusline related concerns
Diffstat (limited to 'src/game/statusline.hpp')
-rw-r--r--src/game/statusline.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/game/statusline.hpp b/src/game/statusline.hpp
index 66ce2c4..7883051 100644
--- a/src/game/statusline.hpp
+++ b/src/game/statusline.hpp
@@ -25,10 +25,14 @@ public:
void initialize_background() noexcept override;
void set_status(
- StatusLineSection section,
- const std::string_view &status_str
+ const StatusLineSection &section,
+ const std::string_view &status,
+ std::size_t start
) noexcept override;
+ void set_section_length(const StatusLineSection &section, uint32_t length) noexcept
+ override;
+
private:
std::unordered_map<StatusLineSection, uint32_t> _sections_lengths;
@@ -39,8 +43,8 @@ private:
void _move_back(Vector2 previous_position) noexcept;
- [[nodiscard]] auto _get_section_start_x(StatusLineSection section) const noexcept
- -> int32_t;
+ [[nodiscard]] auto _get_section_start_x(const StatusLineSection &section
+ ) const noexcept -> int32_t;
- void _clear_section(StatusLineSection section) noexcept;
+ void _clear_section(const StatusLineSection &section, std::size_t start) noexcept;
};