Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
IBarRuntimeTextPlayback.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "IBar.hpp"
5
6#include <array>
7#include <optional>
8#include <string>
9
10namespace monopoly::fonts { class Runtime; }
11
12namespace monopoly::ibar
13{
14 // Dynamic GRAFIX objects from UDIBar: two bank cards, current name and
15 // ButtonBarMessage. Static card/token playback retains its existing owner.
17 {
18 public:
19 [[nodiscard]] std::expected<void, std::string> sync(
20 const rules::GameState& game, const State& ui,
21 const RuleProjection& projection, bool visible, bool propertyBar,
22 rules::PlayerNumber activePlayer, std::uint64_t tick,
23 int monetarySystem, data::BoardEdition edition,
25 bool modernPresentation = false);
26 void reset() noexcept;
27 [[nodiscard]] data::DataId surface(std::size_t index) const noexcept
28 { return index < surfaces_.size() ? surfaces_[index] : data::EmptyDataId; }
29
30 private:
31 std::array<data::DataId, 4> surfaces_{};
32 std::array<std::string, 4> keys_{};
33 std::array<bool, 4> shown_{};
34 data::BitmapRuntimeCache bases_;
35 std::optional<std::uint64_t> cashSerial_;
36 std::optional<int> monetarySystem_;
37 std::optional<data::BoardEdition> edition_;
38 std::optional<std::uint64_t> wantedTick_;
39 bool messagePinned_{};
40 std::string message_;
41 std::uint32_t messageColor_{};
42 };
43}
fonts::Runtime & font
unsigned index
std::expected< void, std::string > sync(const rules::GameState &game, const State &ui, const RuleProjection &projection, bool visible, bool propertyBar, rules::PlayerNumber activePlayer, std::uint64_t tick, int monetarySystem, data::BoardEdition edition, fonts::Runtime *font, engine::SequencePlayback &playback, bool modernPresentation=false)
data::DataId surface(std::size_t index) const noexcept
std::uint32_t DataId
Definition DataBanks.hpp:10
constexpr DataId EmptyDataId
Definition DataBanks.hpp:13
std::uint8_t PlayerNumber
Definition RuleTypes.hpp:12