aboutsummaryrefslogtreecommitdiff
path: root/src/game/status_manager.hpp
blob: e9f2d15dc2adac6ea3708b2337c7976e437a0c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once

#include "interfaces/status_manager.hpp"

#include <cstdint>
#include <memory>
#include <optional>
#include <string_view>
#include <unordered_map>
#include <yacppdic/auto_wirable.hpp>

#include "interfaces/statusline.hpp"

class StatusManager : public IStatusManager,
					  public yacppdic::AutoWirable<IStatusManager, StatusManager>
{
public:
	void bind(const std::shared_ptr<IStatusLine> &statusline) noexcept override;

	void set_section_title(
		const StatusLineSection &section,
		const std::string_view &title) override;

	void set_section_body(
		const StatusLineSection &section,
		const std::string_view &body) noexcept override;

private:
	std::shared_ptr<IStatusLine> _statusline;

	std::unordered_map<StatusLineSection, std::int32_t> _section_title_lengths;
};