Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
PhaseStack.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "RuleTypes.hpp"
4
6{
7 bool push(
8 GameState& state,
9 GamePhase phase,
10 PlayerNumber fromPlayer,
11 PlayerNumber toPlayer,
12 std::int64_t amount
13 );
14
15 bool pop(GameState& state);
16
17 void switchTo(
18 GameState& state,
19 GamePhase phase,
20 PlayerNumber fromPlayer,
21 PlayerNumber toPlayer,
22 std::int64_t amount
23 );
24
25 // Switch preserves the current snapshot, as in legacy SwitchPhase.
26 void saveCurrent(GameState& state);
27 bool hasCurrentSnapshot(const GameState& state);
28 bool hasSnapshots(const GameState& state);
29 bool currentStateChanged(const GameState& state);
30 bool restoreCurrent(GameState& state);
31
32 const PendingPhase& current(const GameState& state);
33}
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
Definition RuleTypes.hpp:12
const GameState & state()