Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
AuctionTextPlayback.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "AuctionUI.hpp"
4#include "DataBanks.hpp"
5#include "RuleTypes.hpp"
7
8#include <array>
9#include <cstdint>
10#include <expected>
11#include <optional>
12#include <string>
13#include <vector>
14
15namespace monopoly::fonts { class Runtime; }
16
17namespace monopoly::auctionui
18{
20 {
21 public:
22 [[nodiscard]] std::expected<void, std::string> sync(
23 const State& state,
26 int monetarySystem,
29
30 void reset() noexcept;
31
32 private:
33 struct Published
34 {
36 std::uint16_t priority{};
37 std::int32_t x{};
38 std::int32_t y{};
39 bool operator==(const Published&) const = default;
40 };
41
42 [[nodiscard]] std::expected<void, std::string> ensureSurfaces(
44
45 std::optional<data::DataId> currentBidSurface_;
46 std::array<std::optional<data::DataId>, rules::MaxPlayers> nameSurfaces_{};
47 std::array<std::optional<data::DataId>, rules::MaxPlayers> bidSurfaces_{};
48 std::array<std::optional<data::DataId>, rules::MaxPlayers> cashSurfaces_{};
49 std::vector<Published> currentObjects_;
50 std::optional<std::string> currentBidCache_;
51 std::array<std::optional<std::string>, rules::MaxPlayers> nameCache_{};
52 std::array<std::optional<std::string>, rules::MaxPlayers> bidCache_{};
53 std::array<std::optional<std::string>, rules::MaxPlayers> cashCache_{};
54 std::optional<std::u16string> currentBidLabel_;
55 };
56}
std::uint16_t priority
unsigned state
unsigned index
std::expected< void, std::string > sync(const State &state, const rules::GameState &gameState, display::Screen2D desiredView, int monetarySystem, fonts::Runtime *fontRuntime, engine::SequencePlayback &playback)
std::uint32_t DataId
Definition DataBanks.hpp:10
constexpr DataId EmptyDataId
Definition DataBanks.hpp:13
constexpr PlayerNumber MaxPlayers
Definition RuleTypes.hpp:14