MoveValidator class
This class is responsible for validating moves in ChessBoardInterface instance.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canCastleKingSide(
ChessBoardInterface board, PieceColor color) → bool -
Validates if a king-side castling move is legal for the given
color(player) on theboard. -
canCastleQueenSide(
ChessBoardInterface board, PieceColor color) → bool -
Checks if the given
color(player) can castle queen side based on theboardstate. -
hasLostCastlingRights(
ChessBoardInterface board, PieceColor color, bool kingSide) → bool - Checks if the player has lost castling rights based on the ChessBoardInterface.history.
-
isValidMove(
ChessBoardInterface board, Position from, Position to) → bool -
Validates if a move is legal based on the PieceType and current
boardstate.