TicTacToeGame class
- Annotations
-
- @freezed
Constructors
-
TicTacToeGame({required GenericGame generic, required IList<
String?> board, @Default('tictactoe') String type}) -
constfactory
-
TicTacToeGame.fromJson(Map<
String, dynamic> map) -
factory
Properties
-
board
→ IList<
String?> -
no setterinherited
-
copyWith
→ $TicTacToeGameCopyWith<
TicTacToeGame> -
no setterinherited
- generic → GenericGame
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
points
→ IMap<
String, double> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
no setterinherited
Methods
-
canMove(
PlayerID player, int location) → bool -
copyWithGeneric(
GenericGame updates(GenericGame p1)) → TicTacToeGame - Copies the state of the game with generic replaced by the function applying updates to the most recent copy of generic
-
isLoser(
PlayerID playerID) → bool -
isWinner(
PlayerID playerID) → bool -
moveNextRound(
GameConfig config) → TicTacToeGame - Logic to apply after all players have consented they want to play another round to initialize the next round
-
next(
TicTacToeGameEvent event) → GameOrError< TicTacToeGame> - This method takes an event and returns the changed game state or an error
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
winningLocationCombinations
→ IList<
IList< int> > -
final
Static Methods
-
register(
) → void