21 constexpr std::uint8_t OffBoardSquare = 41;
49 static_cast<std::int64_t
>(
143 std::int64_t cash = 0;
146 for (std::size_t
i = 0;
161 const std::uint8_t houses =
185 static_cast<std::int64_t
>(
230 for (std::size_t
i = 0;
317 result.errorArgument =
330 static_cast<std::uint8_t
>(
333 static_cast<std::uint8_t
>(
369 for (std::size_t
i = 0;
446 for (std::size_t
i = 0;
467 const int freeHouses =
474 const int freeHotels =
495 result.errorArgument =
506 result.buildingAHotel =
true;
517 result.freeBuildings =
522 result.buildingAHotel =
false;
533 result.freeBuildings =
548 result.buildingAHotel =
true;
561 result.errorArgument =
568 result.freeBuildings =
573 result.buildingAHotel =
false;
593 result.errorArgument =
600 result.freeBuildings =
647 static_cast<std::uint8_t
>(
691 static_cast<std::uint8_t
>(
698 if (
check.error != 0)
709 check.buildingAHotel ==
770 static_cast<std::uint8_t
>(
846 if (
check.error != 0)
890 ErrorAuctionWrongBuilding,
922 check.freeBuildings <=
937 NotifyPlayerBuySellMort,
955 ?
check.freeBuildings
956 : -
check.freeBuildings
1055 static_cast<std::uint8_t
>(
1128 ErrorBuildingOnUnowned,
1179 ErrorBuildingNoBreakdownHouses &&
1195 NotifyPlayerBuySellMort,
1227 if (
check.error != 0)
1237 check.errorArgument,
1547 NotifyPlayerBuySellMort,
1570 switch (phase.
phase)
1587 NotifyPlayerBuySellMort,
1625 NotifyPlayerBuySellMort,
1649 NotifyDecomposeSale,
1689 NotifyPlaceBuilding,
constexpr std::int64_t ErrorBuildingOnNonProperty
constexpr std::int64_t ErrorBuildingAllSold
constexpr std::int64_t ErrorBuildingNoHouses
constexpr std::int64_t ErrorSellNoHouses
constexpr std::int64_t ErrorBuildingSold
constexpr std::int64_t ErrorBuildingOnUnowned
constexpr std::int64_t ErrorBuildingNotEven
constexpr std::int64_t ErrorBuildingNoHotels
constexpr std::int64_t ErrorBuildingMaxedOut
constexpr std::int64_t ErrorBuildingNeedsCash
constexpr std::int64_t ErrorBuildingNeedsMonopoly
constexpr std::int64_t ErrorBuildingBought
constexpr std::int64_t ErrorBuildingMortgaged
constexpr std::int64_t ErrorBuildingNoBreakdownHouses
bool sendAction(const actions::Message &message)
const SquareDefinition & definition(SquareType square)
std::uint32_t PropertySet
PropertySet propertyBit(SquareType square)
void resetTransientState()
PlacementCheck testBuildingPlacement(const GameState &state, PlayerNumber purchaser, std::uint8_t squareNo, bool adding)
void actionBuyHouse(GameState &state, const actions::Message &message)
PlayerSet playersWhoCanBuyBuilding(const GameState &state, bool hotel)
void actionCancelDecomposition(GameState &state, const actions::Message &message)
void buildApprovedBuilding(GameState &state, std::uint8_t squareNo)
void actionPlayerDoneBuySellMortgage(GameState &state, const actions::Message &message)
bool restartBuildingPhase(GameState &state)
void actionPlayerBuySellMortgage(GameState &state, const actions::Message &message)
board::PropertySet placeBuildingLegalSquares(const GameState &state)
void actionSellBuildings(GameState &state, const actions::Message &message)
void blindlyTransferCash(GameState &state, PlayerNumber fromPlayer, PlayerNumber toPlayer, std::int64_t amount, bool sendAnimation)
bool pop(GameState &state)
const PendingPhase & current(const GameState &state)
void saveCurrent(GameState &state)
bool push(GameState &state, GamePhase phase, PlayerNumber fromPlayer, PlayerNumber toPlayer, std::int64_t amount)
bool restoreCurrent(GameState &state)
void wrongPlayer(const GameState &state, const actions::Message &message)
void wrongPhase(const GameState &state, const actions::Message &message)
void sendClientState(const GameState &state, PlayerNumber toPlayer, Cause cause)
@ HousingShortageQuestion
@ FlatOrFractionTaxDecision
@ JailRollOrPayOrCardDecision
constexpr PlayerNumber BankPlayer
std::uint8_t PlayerNumber
constexpr std::size_t SquareCount
const GameState & state()
constexpr PlayerNumber MaxPlayers
constexpr PlayerNumber NobodyPlayer
constexpr PlayerNumber AllPlayers
rules::PlayerNumber fromPlayer
PlayerNumber numberOfPlayers
std::array< SquareState, SquareCount > squares
std::array< PendingPhase, MaxPendingPhases > phaseStack
std::uint8_t numberOfPendingPhases
std::array< PlayerState, MaxPlayers > players
std::int64_t housePurchaseCost