Monopoly — Portage moderne
0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
PieceShadowDisplay.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
PieceRuntime.hpp
"
4
#include "
RuleTypes.hpp
"
5
#include "
SequencePlayback.hpp
"
6
7
#include <array>
8
#include <cstdint>
9
#include <expected>
10
#include <optional>
11
#include <string>
12
13
namespace
monopoly::pieces
14
{
15
inline
constexpr
data::DataTag
ShadowSequenceBaseTag
= 0x05CD;
16
inline
constexpr
std::uint16_t
ShadowPriorityBase
=
Generic3DPriority
;
17
inline
constexpr
float
ShadowGroundY
= 1.0F;
18
19
struct
PieceShadowDisplayContext
20
{
21
bool
boardVisible
{};
22
bool
lightingOn
{};
23
bool
game3DOn
{};
24
std::optional<rules::PlayerNumber>
paddywagonPlayer
;
25
std::uint8_t
goingToJailStatus
{};
26
rules::PlayerNumber
currentUIPlayer
=
rules::NobodyPlayer
;
27
bool
currentPlayerTokenSequenceActive
{};
28
TokenRuntimeSources
runtimeSources
{};
29
};
30
31
struct
PieceShadowDisplayUpdate
32
{
33
std::uint8_t
started
{};
34
std::uint8_t
stopped
{};
35
std::uint8_t
moved
{};
36
};
37
38
class
PieceShadowDisplay
final
39
{
40
public
:
41
[[
nodiscard
]] std::expected<PieceShadowDisplayUpdate, std::string>
sync
(
42
const
rules::GameState
&
state
,
43
const
PieceShadowDisplayContext
& context,
44
engine::SequencePlayback
&
playback
);
45
46
void
reset
()
noexcept
;
47
[[
nodiscard
]]
data::DataId
shownSequence
(
48
rules::PlayerNumber
player)
const
noexcept
;
49
50
private
:
51
TokenPoseTracker
poseTracker_;
52
std::array<data::DataId, rules::MaxPlayers> shown_{};
53
std::array<std::optional<TokenPose>,
rules::MaxPlayers
> poses_{};
54
};
55
}
state
unsigned state
Definition
ModernIBarSkin.cpp:25
index
unsigned index
Definition
ModernIBarSkin.cpp:25
PieceRuntime.hpp
RuleTypes.hpp
SequencePlayback.hpp
monopoly::engine::SequencePlayback
Definition
SequencePlayback.hpp:20
monopoly::pieces::PieceShadowDisplay
Definition
PieceShadowDisplay.hpp:39
monopoly::pieces::PieceShadowDisplay::shownSequence
data::DataId shownSequence(rules::PlayerNumber player) const noexcept
Definition
PieceShadowDisplay.cpp:56
monopoly::pieces::PieceShadowDisplay::reset
void reset() noexcept
Definition
PieceShadowDisplay.cpp:49
monopoly::pieces::PieceShadowDisplay::sync
std::expected< PieceShadowDisplayUpdate, std::string > sync(const rules::GameState &state, const PieceShadowDisplayContext &context, engine::SequencePlayback &playback)
Definition
PieceShadowDisplay.cpp:63
monopoly::pieces::TokenPoseTracker
Definition
PieceRuntime.hpp:32
monopoly::data::DataId
std::uint32_t DataId
Definition
DataBanks.hpp:10
monopoly::data::DataTag
std::uint16_t DataTag
Definition
DataBanks.hpp:11
monopoly::pieces
Definition
PieceBuildingDisplay.cpp:6
monopoly::pieces::ShadowPriorityBase
constexpr std::uint16_t ShadowPriorityBase
Definition
PieceShadowDisplay.hpp:16
monopoly::pieces::Generic3DPriority
constexpr std::uint16_t Generic3DPriority
Definition
PieceRuntime.hpp:15
monopoly::pieces::ShadowSequenceBaseTag
constexpr data::DataTag ShadowSequenceBaseTag
Definition
PieceShadowDisplay.hpp:15
monopoly::pieces::ShadowGroundY
constexpr float ShadowGroundY
Definition
PieceShadowDisplay.hpp:17
monopoly::rules::PlayerNumber
std::uint8_t PlayerNumber
Definition
RuleTypes.hpp:12
monopoly::rules::MaxPlayers
constexpr PlayerNumber MaxPlayers
Definition
RuleTypes.hpp:14
monopoly::rules::NobodyPlayer
constexpr PlayerNumber NobodyPlayer
Definition
RuleTypes.hpp:16
monopoly::pieces::PieceShadowDisplayContext
Definition
PieceShadowDisplay.hpp:20
monopoly::pieces::PieceShadowDisplayContext::boardVisible
bool boardVisible
Definition
PieceShadowDisplay.hpp:21
monopoly::pieces::PieceShadowDisplayContext::goingToJailStatus
std::uint8_t goingToJailStatus
Definition
PieceShadowDisplay.hpp:25
monopoly::pieces::PieceShadowDisplayContext::currentUIPlayer
rules::PlayerNumber currentUIPlayer
Definition
PieceShadowDisplay.hpp:26
monopoly::pieces::PieceShadowDisplayContext::runtimeSources
TokenRuntimeSources runtimeSources
Definition
PieceShadowDisplay.hpp:28
monopoly::pieces::PieceShadowDisplayContext::lightingOn
bool lightingOn
Definition
PieceShadowDisplay.hpp:22
monopoly::pieces::PieceShadowDisplayContext::paddywagonPlayer
std::optional< rules::PlayerNumber > paddywagonPlayer
Definition
PieceShadowDisplay.hpp:24
monopoly::pieces::PieceShadowDisplayContext::currentPlayerTokenSequenceActive
bool currentPlayerTokenSequenceActive
Definition
PieceShadowDisplay.hpp:27
monopoly::pieces::PieceShadowDisplayContext::game3DOn
bool game3DOn
Definition
PieceShadowDisplay.hpp:23
monopoly::pieces::PieceShadowDisplayUpdate
Definition
PieceShadowDisplay.hpp:32
monopoly::pieces::PieceShadowDisplayUpdate::stopped
std::uint8_t stopped
Definition
PieceShadowDisplay.hpp:34
monopoly::pieces::PieceShadowDisplayUpdate::started
std::uint8_t started
Definition
PieceShadowDisplay.hpp:33
monopoly::pieces::PieceShadowDisplayUpdate::moved
std::uint8_t moved
Definition
PieceShadowDisplay.hpp:35
monopoly::pieces::TokenRuntimeSources
Definition
PieceRuntime.hpp:19
monopoly::rules::GameState
Definition
RuleTypes.hpp:259
PieceShadowDisplay.hpp
Generated by
1.9.8