GameState<E extends Event, T extends Game> class
Constructors
- GameState({required T game, required Rewards rewards, required GenericGame generic})
- GameState.fromJson(JsonMap json)
-
factory
Properties
- game → T
-
final
- gameOver → bool
-
Gets whether the game is over
no setter
- generic → GenericGame
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
players
→ IList<
Player> -
Gets an unmodifiable list of players that are a part of this game
no setter
-
readyPlayers
→ IList<
PlayerID> -
Gets the players who are ready for the next round
no setter
- rewards → Rewards
-
final
- round → int
-
Gets the current round number
no setter
- roundOver → bool
-
Gets whether the round is over
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → GameStatus
-
Gets the status of the game
no setter
- time → DateTime
-
Gets the
DateTime
that this state was updatedno setter
Methods
-
addReward(
List< double> rewards) → GameState<E, T> -
cast<
E1 extends Event, T1 extends Game> () → GameState< E1, T1> -
copyWith(
{T? game, Rewards? rewards, GenericGame? generic}) → GameState< E, T> -
next(
PlayerEvent< Event> event, GameConfig config) → NextStateOrError<Event, Game> -
nextPlayerIndex(
PlayerIndex currentPlayer) → PlayerIndex -
nextRound(
GameConfig config) → NextStateOrError< Event, Game> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
player(
PlayerID id) → Player -
playerFromIndex(
PlayerIndex currentPlayer) → Player -
playerIndex(
PlayerID playerID) → PlayerIndex -
playerName(
PlayerID playerID) → PlayerName -
toJson(
) → JsonMap -
toString(
) → String -
A string representation of this object.
inherited
-
updateGame(
T g) → GameState< E, T> -
updateGeneric(
GenericGame update(GenericGame)) → GameState< E, T> -
updateReward(
List< double> update(List<double> )) → GameState<E, T> -
updateStatus(
) → GameState< E, T>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited