ChessGameState class
Immutable Chess Game State. Can load from a fen with ChessGameState.fromFen, or create a new board with ChessGameState.initialBoardPosition. From and position, get valid moves with the moves accessor.
Constructors
-
ChessGameState({ChessMove? lastMove, required List<
List< board, required Player currentPlayer, required Set<ChessPiece> >Castling> availableCastling, required int moveCount}) - ChessGameState.fromFen(String fen)
-
factory
- ChessGameState.initialBoardPosition()
-
factory
Properties
-
availableCastling
→ Set<
Castling> -
final
-
board
→ List<
List< ChessPiece> > -
final
- check → bool
-
no setter
- currentPlayer → Player
-
final
- fenBoard → String
-
no setter
- fenPositionId → String
-
no setter
- forsythEdwardsNotation → String
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastMove → ChessMove?
-
final
- moveCount → int
-
final
-
moves
→ List<
ChessMove> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyGameState(
) → ChessGameState -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
playMove(
ChessMove move) → ChessGameState -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited