blob: 18c535e685863c0cf1a55e8fc448688bf5e18b84 (
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
|
#include "status_updater.hpp"
#include <fmt/core.h>
#include <utility>
StatusUpdater::StatusUpdater(
std::shared_ptr<IStatusLine> statusline,
std::shared_ptr<IGenerationTracker> generation_tracker) noexcept
: _statusline(std::move(statusline)),
_generation_tracker(std::move(generation_tracker))
{
}
void StatusUpdater::update(const Vector2 &context) noexcept
{
_statusline->set_status(
StatusLineSection::A,
fmt::format("X: {} Y {}", context.get_x(), context.get_y()));
_statusline->set_status(
StatusLineSection::B,
fmt::format("Paused: {} Generation: {}",
_generation_tracker->get_is_paused() ? "yes" : "no",
_generation_tracker->get_current_generation()));
}
|