Move class
A representation of a move. from and to are square indices.
promo and piece (both optional) are uppercase single character piece symbols.
from can also be hand
(-2), for drops originating off the board.
Constructors
Properties
- drop → bool
-
Whether this is a drop move (any type, including gating).
no setter
- dropSquare → int?
-
The square that a dropped piece will be placed on, taking into account
all types of drops.
no setter
- from → int
-
The board location this move starts from.
final
- gate → bool
-
Whether this is a gated drop, e.g. the drops in Seirawan chess.
no setter
- gatingSquare → int?
-
In most cases, gated pieces will be placed on the from square, but there
are some situations where there are other possibilities, e.g. in Seirawan
chess during castling, a piece can gate on either the rook or the king square.
final
- 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 setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- piece → String?
-
The piece type that is being dropped/gated.
final
- promo → String?
-
The piece type that is being promoted to.
final
- promotion → bool
-
Whether this is a promotion move.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- to → int
-
The board location this move ends at.
final
Methods
-
algebraic(
[BoardSize size = const BoardSize(8, 8)]) → 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. -
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