StandardMove class
A representation of a single move.
This is a move that is made in a game, not a definition of a type of move
that can be made by a piece. For that, see MoveDefinition
.
Constructors
- StandardMove({required int from, required int to, int? capturedPiece, int? promoSource, int? promoPiece, CastlingRights? castlingDir, int? castlingPieceSquare, bool enPassant = false, bool setEnPassant = false})
-
const
Properties
- capture → bool
-
Whether a piece is captured as a result of this move.
no setteroverride
- capturedPiece → int?
-
The piece (including colour and flags) that is being captured, if one is.
final
- castling → bool
-
Whether this is a castling move.
no setteroverride
- castlingDir → CastlingRights?
-
If this is a castling move, in which direction is castling happening?
final
- castlingPieceSquare → int?
-
The square where the castling piece (e.g. a rook), is located.
final
- dropPiece → int?
-
The piece (type only) that is being dropped, if one is.
no setterinherited
- enPassant → bool
-
If this move is en passant.
final
- from → int
-
The board location this move starts at.
final
- gate → bool
-
Whether this is a gated drop, e.g. the drops in Seirawan chess.
no setterinherited
- handDrop → bool
-
Whether this is a drop move where the piece came from the hand to an empty
square, e.g. the drops in Crazyhouse.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- promoPiece → int?
-
The piece (type only) that is being promoted to.
final
- promoSource → int?
-
The piece that exists before the promotion.
final
- promotion → bool
-
Whether the moved piece is promoted.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setEnPassant → bool
-
If this move sets the en passant flag.
final
- to → int
-
The board location this move ends at.
final
Methods
-
algebraic(
{BoardSize size = BoardSize.standard, bool useRookForCastling = false}) → String -
Provides the most basic algebraic form of the move.
This is not entirely descriptive, and doesn't provide information on promo
or gated pieces, for example.
Use
Game.toAlgebraic
in almost every situation. -
copyWith(
{int? from, int? to, int? capturedPiece, int? promoSource, int? promoPiece, CastlingRights? castlingDir, int? castlingPieceSquare, bool? enPassant, bool? setEnPassant}) → StandardMove -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited