NormalMove class
Represents a chess move, which is possibly a promotion.
Constructors
- NormalMove({required Square from, required Square to, Role? promotion})
-
const
- NormalMove.fromUci(String uci)
-
Constructs a NormalMove from a UCI string.
factory
Properties
- from → Square
-
The origin square of this move.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- promotion → Role?
-
The role of the promoted piece, if any.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
squares
→ Iterable<
Square> -
Returns an iterable of all squares involved in this move.
no setteroverride
- to → Square
-
The target square of this move.
finalinherited
- uci → String
-
Gets UCI notation, like
g1f3for a normal move,a7a8qfor promotion to a queen.no setteroverride
Methods
-
hasSquare(
Square square) → bool -
Returns
trueifsquareis a square of this move.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withPromotion(
Role? promotion) → NormalMove -
Returns a copy of this move with a
promotionrole.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override