76 for (std::size_t
i = 0;
116 auto snapshot = std::make_shared<GameState>(
state);
117 snapshot->phaseUndo = {};
130 [](
const auto& snapshot) { return snapshot != nullptr; });
143 value.numberOfDoublesRolled,
value.justRolledOutOfJail,
144 value.pendingCard,
value.freeParkingJackpotAmount,
146 value.configurationProposer,
value.currentPlayer,
149 if (values(
state) != values(
saved))
return true;
153 return std::tie(a.cardCount, a.cardPile, a.jailOwner, a.jailOfferedInTradeTo) ==
154 std::tie(b.cardCount, b.cardPile, b.jailOwner, b.jailOfferedInTradeTo);
bool pop(GameState &state)
const PendingPhase & current(const GameState &state)
void saveCurrent(GameState &state)
bool hasSnapshots(const GameState &state)
bool push(GameState &state, GamePhase phase, PlayerNumber fromPlayer, PlayerNumber toPlayer, std::int64_t amount)
bool currentStateChanged(const GameState &state)
bool hasCurrentSnapshot(const GameState &state)
bool restoreCurrent(GameState &state)
void switchTo(GameState &state, GamePhase phase, PlayerNumber fromPlayer, PlayerNumber toPlayer, std::int64_t amount)
std::uint8_t PlayerNumber
const GameState & state()
constexpr std::size_t MaxPendingPhases
std::array< std::shared_ptr< const GameState >, MaxPendingPhases > phaseUndo
std::array< CardDeck, static_cast< std::size_t >(DeckType::Count) > cards
std::array< PendingPhase, MaxPendingPhases > phaseStack
std::uint8_t numberOfPendingPhases