BasicMoves class

A class that contains the basic moves of the CAT

Constructors

BasicMoves(dynamic validatePosition(int, int))
A constructor that receives a function as a parameter.

Properties

column int
A getter of the column position.
read-only
copyMode bool
A flag that indicates if the CAT is in copy mode.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
row int
A getter of the row position.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
validatePosition ↔ dynamic Function(int, int)
A function that receives two parameters and returns a boolean.
read / write

Methods

diagonalDownLeft([int n = 1]) bool
Change position in diagonal down left position by n cells.
diagonalDownRight([int n = 1]) bool
Change position in diagonal down right position by n cells.
diagonalUpLeft([int n = 1]) bool
Change position in diagonal up left position by n cells.
diagonalUpRight([int n = 1]) bool
Change position in diagonal up right position by n cells.
down([int n = 1, bool alternate = true]) bool
Change position down position by n cells.
left([int n = 1, bool alternate = true]) bool
Change position left position by n cells.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Change position right position by n cells.
toPosition(int row, int column) bool
The function toPosition sets the row and column values if they are valid and returns true, otherwise it returns false.
toString() String
The function returns a string representation of the row and column positions.
override
up([int n = 1, bool alternate = true]) bool
Change position up position by n cells.

Operators

operator ==(Object other) bool
The equality operator.
inherited