SquareSet extension type

A set of squares represented by a 64 bit integer mask, using little endian rank-file (LERF) mapping.

 8 | 56 57 58 59 60 61 62 63
 7 | 48 49 50 51 52 53 54 55
 6 | 40 41 42 43 44 45 46 47
 5 | 32 33 34 35 36 37 38 39
 4 | 24 25 26 27 28 29 30 31
 3 | 16 17 18 19 20 21 22 23
 2 | 8  9  10 11 12 13 14 15
 1 | 0  1  2  3  4  5  6  7
   -------------------------
     a  b  c  d  e  f  g  h
on

Constructors

SquareSet(int value)
const
SquareSet.backrankOf(Side side)
Create a SquareSet containing all squares of the given backrank Side.
const
SquareSet.fromFile(int file)
Create a SquareSet containing all squares of the given file.
const
SquareSet.fromRank(int rank)
Create a SquareSet containing all squares of the given rank.
const
SquareSet.fromSquare(Square square)
Creates a SquareSet with a single Square.
const
SquareSet.fromSquares(Iterable<Square> squares)
Creates a SquareSet from several Squares.

Properties

first int?
no setter
isEmpty bool
no setter
isNotEmpty bool
no setter
last int?
no setter
moreThanOne bool
no setter
singleSquare int?
Returns square if it is single, otherwise returns null.
no setter
size int
no setter
squares Iterable<Square>
no setter
squaresReversed Iterable<Square>
no setter
value int
final

Methods

complement() SquareSet
diff(SquareSet other) SquareSet
flipVertical() SquareSet
has(Square square) bool
intersect(SquareSet other) SquareSet
isDisjoint(SquareSet other) bool
isIntersected(SquareSet other) bool
minus(SquareSet other) SquareSet
mirrorHorizontal() SquareSet
shl(int shift) SquareSet
Bitwise left shift
shr(int shift) SquareSet
Bitwise right shift
toggleSquare(Square square) SquareSet
Removes Square if present, or put it if absent.
toHexString() String
Returns the hexadecimal string representation of the bitboard value.
union(SquareSet other) SquareSet
withoutFirst() SquareSet
withoutSquare(Square square) SquareSet
withSquare(Square square) SquareSet
xor(SquareSet other) SquareSet

Constants

antidiagonal → const SquareSet
backranks → const SquareSet
center → const SquareSet
corners → const SquareSet
darkSquares → const SquareSet
diagonal → const SquareSet
empty → const SquareSet
full → const SquareSet
lightSquares → const SquareSet