18 std::optional<std::uint8_t> selected;
20 if (!slots[
static_cast<std::size_t
>(
index)])
21 selected =
static_cast<std::uint8_t
>(
index);
29 std::optional<std::uint8_t> selected;
35 [[
nodiscard]] std::expected<PieceIdleAnimation, PieceIdleTransitionError>
43 if (
source.currentSquare >= 41)
52 const auto categoryIndex =
static_cast<std::uint32_t
>(*category);
53 const auto tag =
static_cast<std::uint32_t
>(
baseTag) +
63 adjusted.yaw -= std::numbers::pi_v<float> / 2.0F;
64 return PieceIdleAnimation{
74 for (
auto& square : occupancy_)
75 for (
auto&
slot : square)
slot.reset();
91 occupancy_[0][
slot] = player;
98 std::optional<rules::PlayerNumber> center)
noexcept
107 player <
state.numberOfPlayers; ++player)
109 const auto square =
state.players[player].currentSquare;
112 auto& slots = occupancy_[square];
114 if ((!center || player != *center) && !selected)
116 if (!center || player != *center) slots[*selected] = player;
123 std::expected<PieceIdleTransitionPlan, PieceIdleTransitionError>
140 const auto square =
state.players[*center_].currentSquare;
152 slots[*selected] = *center_;
167 slots[*selected].reset();
std::shared_ptr< const data::HmdTextureImage > source
std::expected< void, PieceIdleTransitionError > initialize(const rules::GameState &state, std::optional< rules::PlayerNumber > center=std::nullopt) noexcept
std::array< Slot, RestingPositionCount > SquareSlots
std::expected< void, PieceIdleTransitionError > initializeNewGame(const rules::GameState &state) noexcept
std::expected< PieceIdleTransitionPlan, PieceIdleTransitionError > planTurnChange(const rules::GameState &state, rules::PlayerNumber newCurrent) noexcept
constexpr DataId packDataId(std::uint16_t group, DataTag tag) noexcept
constexpr std::uint8_t BoardSquareCountWithSpecials
std::optional< RestingIdleCategory > restingIdleCategory(std::uint8_t boardSquare) noexcept
std::optional< TokenPose > tokenOrientation(std::uint8_t boardSquare) noexcept
constexpr data::DataTag IdleToRestBaseTag
constexpr std::uint8_t RestingPositionCount
constexpr data::DataTag IdleAnimationsPerToken
constexpr data::DataTag RestToCenterBaseTag
std::uint8_t PlayerNumber
constexpr std::size_t MaxTokens
constexpr PlayerNumber MaxPlayers
rules::PlayerNumber newCenter