Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
PieceIdleDisplay.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <array>
7#include <expected>
8#include <optional>
9#include <string>
10
11namespace monopoly::pieces
12{
13 inline constexpr data::DataTag PersistentIdleBaseTag = 0x010D;
14 inline constexpr std::uint16_t PersistentIdlePriority = 224;
15
17 {
20 std::optional<rules::PlayerNumber> movingPlayer;
21 std::optional<rules::PlayerNumber> paddywagonPlayer;
22 std::optional<rules::PlayerNumber> idleMovingOut;
23 std::optional<rules::PlayerNumber> idleMovingIn;
24 };
25
27 {
28 std::uint8_t started{};
29 std::uint8_t moved{};
30 std::uint8_t stopped{};
31 };
33 {
34 public:
35 [[nodiscard]] std::expected<PieceIdleDisplayUpdate, std::string> sync(
38 const PieceIdleDisplayContext& context,
40
41 void reset() noexcept;
42
44 rules::PlayerNumber player) const noexcept;
45
46 private:
47 [[nodiscard]] std::expected<std::optional<TokenPose>, std::string>
48 desiredPose(const rules::GameState& state,
50 const PieceIdleDisplayContext& context,
51 rules::PlayerNumber player) const;
52
53 std::array<data::DataId, rules::MaxPlayers> shown_{};
54 std::array<std::optional<TokenPose>, rules::MaxPlayers> poses_{};
55 };
56}
unsigned state
unsigned index
data::DataId shownSequence(rules::PlayerNumber player) const noexcept
std::expected< PieceIdleDisplayUpdate, std::string > sync(const rules::GameState &state, const PieceIdleState &idleState, const PieceIdleDisplayContext &context, engine::SequencePlayback &playback)
std::uint32_t DataId
Definition DataBanks.hpp:10
std::uint16_t DataTag
Definition DataBanks.hpp:11
constexpr std::uint16_t PersistentIdlePriority
constexpr data::DataTag PersistentIdleBaseTag
std::uint8_t PlayerNumber
Definition RuleTypes.hpp:12
constexpr PlayerNumber MaxPlayers
Definition RuleTypes.hpp:14
std::optional< rules::PlayerNumber > movingPlayer
std::optional< rules::PlayerNumber > idleMovingIn
std::optional< rules::PlayerNumber > idleMovingOut
std::optional< rules::PlayerNumber > paddywagonPlayer