BoardSize class

Specifies the dimensions of a board.

Constructors

BoardSize(int h, int v)
const
BoardSize.standard()
A standard 8x8 board.
factory

Properties

h int
The horizontal size, i.e. number of files on the board.
final
hashCode int
The hash code for this object.
no setterinherited
maxDim int
Returns the longest dimension.
no setter
maxFile int
Index of the last file.
no setter
maxRank int
Index of the last rank.
no setter
minDim int
Returns the shortest dimension.
no setter
numSquares int
The total number of squares on a board of this size.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
v int
The vertical size, i.e. number of ranks on the board.
final

Methods

fileDiff(int from, int to) int
Calculates the difference in files between two squares.
moveFromAlgebraic(String alg) Move
Create a Move from an algebraic string (e.g. a2a3, g6f3) for a board of this size.
moveToAlgebraic(Move move) String
Returns an algebraic string (e.g. a2a3, g6f3), for a given move.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rankDiff(int from, int to) int
Calculates the difference in ranks between two squares.
squareFile(int square) int
Returns the file that square is on.
squareName(int square) String
Returns a human-readable name for a square on a board of this size. e.g. c1, h6.
squareNumber(String name) int
Converts a human-readable square name into an integer, corresponding to the correct square on a board of this size.
squareRank(int square) int
Returns the rank that square is on.
toString() String
A string representation of this object.
inherited

Operators

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