15 0x0004, 0x0005, 0x0006, 0x000A, 0x0008, 0x0007,
16 0x0003, 0x000C, 0x0009, 0x000D, 0x000B
19 using ObjectState = Playback::ObjectState;
21 [[
nodiscard]] std::expected<std::array<ObjectState, AuctionPlaybackObjectCount>, std::string>
26 int city, engine::SequencePlayback&
playback)
28 std::array<ObjectState, AuctionPlaybackObjectCount>
desired{};
33 return std::unexpected(
"auction player count exceeds legacy maximum");
42 if (property &&
state.propertyForSale >= 0 &&
state.propertyForSale < 28)
44 static constexpr std::array<int, 28> squares{
45 1,3,5,6,8,9,11,12,13,14,15,16,18,19,
46 21,23,24,25,26,27,28,29,31,32,34,35,37,39};
48 squares[
static_cast<std::size_t
>(
state.propertyForSale)],
true, *property);
51 return std::unexpected(property.error());
73 return std::unexpected(
backdrop.error());
76 return std::unexpected(
token.error());
78 const auto base = 2 +
static_cast<std::size_t
>(player) * 4;
80 const auto center =
state.backdropCenterX[player];
108 if (propertyForSale < 0)
110 if (propertyForSale > 29)
111 return std::unexpected(
"auction property-for-sale index is outside legacy 0..29 range");
113 if (propertyForSale == 28)
119 if (propertyForSale == 29)
127 return std::unexpected(
"auction city is outside USA 0..10 range");
128 const auto cityIndex = std::max(city, 0);
139 return std::unexpected(
"auction player colour is outside legacy 0..5 range");
147 return std::unexpected(
"auction backdrop width is neither retail 200 nor 134");
158 return std::unexpected(
"auction token is outside legacy 0..10 range");
174 return std::unexpected(
desired.error());
180 const auto& before = current_[
index];
181 const auto& after = (*desired)[
index];
183 (before.id != after.id || before.priority != after.priority);
189 return std::unexpected(
loaded.error());
193 std::vector<sequence::SequenceCommand> commands;
196 const auto& before = current_[
index];
197 const auto& after = (*desired)[
index];
199 before.id != after.id || before.priority != after.priority;
204 before.id, before.
priority,
false});
212 after.id, after.priority, after.x, after.y));
215 (before.x != after.x || before.y != after.y))
218 after.id, after.priority, after.x, after.y));
222 if (commands.size() >
226 return std::unexpected(
227 "sequence command queue cannot fit auction static transition");
230 for (
auto& command : commands)
232 const auto queued = std::visit(
239 return std::unexpected(
"validated auction static command rejected");
std::shared_ptr< const data::HmdTextureImage > source
std::expected< void, std::string > sync(const State &state, const rules::GameState &gameState, display::Screen2D desiredView, int city, engine::SequencePlayback &playback)
static constexpr std::size_t Capacity
constexpr int BillTrayWidth
constexpr data::DataTag AuctionHouseDeedTag
std::expected< data::DataId, std::string > auctionPlayerBackdropDataId(int backdropWidth, std::uint8_t colour)
constexpr data::DataTag AuctionHotelDeedTag
constexpr std::uint16_t AuctionPropertyPriority
constexpr data::DataTag AuctionBidPlateTag
constexpr std::uint16_t AuctionBottomBarPriority
constexpr int BackdropBigWidth
constexpr int BackdropSmallWidth
constexpr std::int32_t AuctionBottomBarY
constexpr std::uint16_t AuctionBasePriority
constexpr std::int32_t AuctionPropertyX
std::expected< data::DataId, std::string > auctionPropertyDataId(int propertyForSale, int city)
constexpr data::DataTag AuctionDeedBaseTag
constexpr std::size_t AuctionPlaybackObjectCount
constexpr data::DataTag AuctionBillTrayTag
constexpr std::int32_t AuctionBidTextWidth
bool playerPanelWanted(const State &state, rules::PlayerNumber numberOfPlayers, display::Screen2D desiredView, rules::PlayerNumber player) noexcept
constexpr data::DataTag AuctionBigBackdropBaseTag
constexpr std::int32_t AuctionTokenY
constexpr data::DataId auctionBottomBarDataId() noexcept
constexpr std::int32_t AuctionPropertyY
constexpr data::DataTag AuctionSmallBackdropBaseTag
std::expected< data::DataId, std::string > auctionTokenDataId(std::uint8_t token)
constexpr std::int32_t AuctionBidTextY
constexpr std::int32_t AuctionBottomBarX
constexpr DataId EmptyDataId
constexpr DataId packDataId(std::uint16_t group, DataTag tag) noexcept
constexpr std::size_t MaxPlayerColours
std::uint8_t PlayerNumber
constexpr PlayerNumber MaxPlayers
MoveSequenceCommand makeMoveXY(data::DataId dataId, std::uint16_t priority, std::int32_t x, std::int32_t y) noexcept