26 :
PieceMoveIngress([] {
return static_cast<std::uint8_t
>(std::rand() & 1); })
37 pendingSpecial_.reset();
40 std::expected<PieceMovePlan, PieceMoveIngressError>
42 std::int32_t before, std::int32_t after,
bool animationsEnabled)
44 std::vector<std::uint8_t>
choices;
57 static_cast<std::uint8_t
>(randomBit_() & 1U) : 0
U);
63 auto result = std::move(pendingPlan_);
69 auto result = std::move(pendingSpecial_);
70 pendingSpecial_.reset();
74 std::expected<PieceMoveIngressResult, PieceMoveIngressError>
81 if (pendingPlan_ || pendingSpecial_)
90 const auto before =
static_cast<std::int32_t
>(
uiState.players[player].currentSquare);
94 const auto after =
static_cast<std::int32_t
>(
after64);
103 const auto count =
static_cast<std::size_t
>(
uiState.numberOfPlayers);
108 for (std::size_t
i = 0;
i <
count; ++
i)
119 result.sourceQueueLockRequired = !
plan.instructions.empty() ||
124 uiState.players[player].currentSquare = 40;
125 result.sourceQueueLockRequired =
false;
126 result.projectionUpdated =
true;
138 pendingPlan_ = std::move(
plan);
139 result.planQueued =
true;
144 uiState.players[player].currentSquare =
static_cast<std::uint8_t
>(after);
145 result.projectionUpdated =
true;
decision::EconomicActionPlan plan
std::optional< PieceMoveSpecialRequest > takeSpecial()
std::expected< PieceMoveIngressResult, PieceMoveIngressError > process(rules::GameState &uiState, const actions::Message &message, bool animationsEnabled)
std::function< std::uint8_t()> RandomBitSource
std::optional< PieceMovePlan > takePlan()
std::expected< PieceMovePlan, PieceMovePlanError > planTokenMove(actions::Type notification, std::uint8_t token, std::int32_t before, std::int32_t after, bool animationsEnabled, std::span< const std::uint8_t > randomChoices)
std::expected< PieceMovePlan, PieceMovePlanError > planOffBoardMove(std::uint8_t token, std::int32_t before, OffBoardOutcome outcome)
@ OffBoardRequiresGameContext
constexpr std::size_t TokenAnimationItemLimit
std::uint8_t PlayerNumber
constexpr std::size_t SquareCount
constexpr PlayerNumber MaxPlayers