StandardMoveDefinition class
Specifies a group of moves.
- Inheritance
-
- Object
- MoveDefinition
- StandardMoveDefinition
Constructors
- StandardMoveDefinition({required Direction direction, int range = 1, Modality modality = Modality.both, bool enPassant = false, bool firstOnly = false, bool lame = false, int hopDistance = -1, int normalised = 0, Direction? lameDirection, int? lameNormalised})
-
const
- StandardMoveDefinition.fromBetza(Atom atom, Direction direction)
-
Build a move definition from a betza
atom
and adirection
.factory
Properties
- capture → bool
-
no setterinherited
- direction → Direction
-
Where does this move go?
Analogous to a basic directional atom in Betza notation.
final
- enPassant → bool
-
Whether this move an enact en passant.
final
- firstOnly → bool
-
If true, this move is only possible as the piece's first move.
Moves of this type will also set the en passant square.
For example, a standard pawn's double move.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hopDistance → int
-
The distance after hopping that the piece can land at.
-1 means this is not a hop move.
0 means any distance is acceptable (e.g. Xiangqi cannon).
Currently only -1, 0 and 1 are supported by Betza notation ('p' and 'g').
final
- hopper → bool
-
no setter
- lame → bool
-
If true, these moves can be blocked by a piece standing in the path.
For example, a Xiangqi horse's move or a standard pawn's double move.
final
- lameDirection → Direction?
-
final
- lameNormalised → int?
-
final
- limitedHopper → bool
-
no setter
- limitedSlider → bool
-
no setter
- modality → Modality
-
Modality indicates whether the move is quiet move, capture, or both.
finalinherited
- normalised → int
-
The number to add to a square id to translate in the direction specified
by this move.
Don't set this yourself, it will be calculated when
Variant.normalise()
is called.final - quiet → bool
-
no setterinherited
- range → int
-
How far this move can go in the direction.
Set this to 0 for infinite (to the edge of the board).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slider → bool
-
no setter
- unlimitedSlider → bool
-
no setter
Methods
-
copyWith(
{Direction? direction, int? range, Modality? modality, bool? enPassant, bool? firstOnly, bool? lame, int? hopDistance, int? normalised, Direction? lameDirection, int? lameNormalised}) → StandardMoveDefinition -
excludeMove(
int from, int to, int dirMult, BoardSize size) → bool -
Used to rapidly exclude moves in cases where we're looking for attacks.
override
-
normalise(
BoardSize size) → StandardMoveDefinition -
Calculates the values needed to use this on a board of
size
.override -
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