12 constexpr std::int32_t
InJail = 40;
13 constexpr std::int32_t
OffBoard = 41;
21 static_cast<std::uint32_t
>(
base) +
27 std::expected<void, PieceMovePlanError>
append(
36 std::expected<std::int32_t, PieceMovePlanError>
randomBit(
51 return {
false, 0, camera, sequence, start,
landing, corner};
58 square, square,
false};
63 return square >= 0 && square <=
OffBoard;
72 bool animationsEnabled,
86 plan.sourceSquare = before;
87 plan.destinationSquare = after;
104 return std::unexpected(
added.error());
115 if (after == OffBoard)
120 if (before ==
InJail && after == 10)
129 if (animationsEnabled)
131 const auto sideBefore = before < 40 ? before / 10 : 1;
132 auto sideAfter = after < 40 ? (after - 1) / 10 : 0;
138 auto square = before;
140 while (square != after &&
154 if (10 - (square % 10) > 2)
157 if (!
bit)
return std::unexpected(
bit.error());
168 if (!
bit)
return std::unexpected(
bit.error());
169 if (10 - (square % 10) > 2)
184 ((
destination + 9) / 10) % 4 != ((square + 10) / 10) % 4;
192 else return std::unexpected(
199 if (!
added)
return std::unexpected(
added.error());
206 static_cast<std::uint16_t
>(
distance)),
208 if (!
added)
return std::unexpected(
added.error());
216 if (!
spin)
return std::unexpected(
spin.error());
221 while (square >= 40) square -= 40;
228 return std::unexpected(
final.
error());
244 plan.sourceSquare = before;
245 plan.destinationSquare = OffBoard;
250 for (
int i = 0;
i != 2; ++
i)
254 before, before,
false));
255 if (!
added)
return std::unexpected(
added.error());
259 before, before,
false));
260 if (!
blast)
return std::unexpected(
blast.error());
263 if (!
final)
return std::unexpected(
final.
error());
268 auto square = before;
276 square, square,
false));
277 if (!
first)
return std::unexpected(
first.error());
280 if (square >= 40) square = 0;
287 square, square,
true));
288 if (!
spin)
return std::unexpected(
spin.error());
291 plan.loopBegin =
plan.instructions.size();
297 square, square,
false));
298 if (!
loop)
return std::unexpected(
loop.error());
300 if (square >= 40) square = 0;
302 plan.loopEnd =
plan.instructions.size();
decision::EconomicActionPlan plan
constexpr DataId EmptyDataId
constexpr DataId packDataId(std::uint16_t group, DataTag tag) noexcept
@ UnsupportedNotification
BoardCameraView pickGoodCamera(std::int32_t square, std::int32_t distance) noexcept
BoardCameraView pickCameraFor3Squares(std::int32_t square) noexcept
constexpr data::DataTag AnimationsPerToken
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)
constexpr data::DataTag TokenCornerAnimationBaseTag
@ OffBoardRequiresGameContext
constexpr data::DataTag TokenBackThreeAnimationBaseTag
constexpr data::DataTag TokenMoveAnimationBaseTag
constexpr std::size_t TokenAnimationItemLimit
BoardCameraView pickCameraFor15Squares(std::int32_t square) noexcept
constexpr std::size_t MaxTokens