Pockets class

Pockets (captured pieces) in chess variants like Crazyhouse.

Annotations
  • @immutable

Constructors

Pockets({required BySide<ByRole<int>> value})
const

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Gets the total number of pieces in the pocket.
no setter
value BySide<ByRole<int>>
final

Methods

count(Role role) int
Counts the number of pieces by Role.
decrement(Side side, Role role) Pockets
Decrements the number of pieces in the pocket of that Side and Role.
hasPawn(Side side) bool
Checks whether this side has at least 1 pawn.
hasQuality(Side side) bool
Checks whether this side has at least 1 quality (any piece but a pawn).
increment(Side side, Role role) Pockets
Increments the number of pieces in the pocket of that Side and Role.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
of(Side side, Role role) int
Gets the number of pieces of that Side and Role in the pocket.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

empty → const Pockets
An empty pocket.