Crazyhouse class

A variant where captured pieces can be dropped back on the board instead of moving a piece.

Inheritance
Annotations
  • @immutable

Constructors

Crazyhouse({required Board board, Pockets? pockets, required Side turn, required Castles castles, Square? epSquare, required int halfmoves, required int fullmoves})
const
Crazyhouse.fromSetup(Setup setup, {bool? ignoreImpossibleCheck})
Set up a playable Crazyhouse position.
factory

Properties

board Board
Piece positions on the board.
finalinherited
castles Castles
Castling paths and unmoved rooks.
finalinherited
checkers SquareSet
SquareSet of pieces giving check.
no setterinherited
epSquare Square?
En passant target square.
finalinherited
fen String
Gets the FEN string of this position.
no setterinherited
fullmoves int
Current move number.
finalinherited
halfmoves int
Number of half-moves since the last capture or pawn move.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hasSomeLegalMoves bool
Tests if the position has at least one legal move.
no setterinherited
isCheck bool
Tests if the king is in check.
no setterinherited
isCheckmate bool
Tests for checkmate.
no setterinherited
isGameOver bool
Tests if the game is over.
no setterinherited
isInsufficientMaterial bool
Tests if both Side have insufficient winning material.
no setterinherited
isStalemate bool
Tests for stalemate.
no setterinherited
isVariantEnd bool
Checks if the game is over due to a special variant end condition.
no setteroverride
legalDrops SquareSet
Gets all the legal drops of this position.
no setteroverride
legalMoves → IMap<Square, SquareSet>
Gets all the legal moves of this position.
no setterinherited
outcome Outcome?
The outcome of the game, or null if the game is not over.
no setterinherited
ply int
Gets the current ply.
no setterinherited
pockets Pockets?
Pockets in chess variants like Crazyhouse.
finalinherited
rule Rule
The Rule of this position.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
turn Side
Side to move.
finalinherited
variantOutcome Outcome?
Tests special variant winning, losing and drawing conditions.
no setteroverride

Methods

hasInsufficientMaterial(Side side) bool
Tests if a Side has insufficient winning material.
override
isLegal(Move move) bool
Tests a move for legality.
inherited
kingAttackers(Square square, Side attacker, {SquareSet? occupied}) SquareSet
Attacks that a king on square would have to deal with.
inherited
legalMovesOf(Square square) SquareSet
Gets the legal moves for that Square.
inherited
makeSan(Move move) → (Position<Crazyhouse>, String)
Returns the SAN of this Move and the updated Position.
inherited
makeSanUnchecked(Move move) → (Position<Crazyhouse>, String)
Returns the SAN of this Move and the updated Position, without checking if the move is legal.
inherited
normalizeMove(NormalMove move) Move
Returns the normalized form of a NormalMove to avoid castling inconsistencies.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseSan(String sanString) Move?
Parses a move in Standard Algebraic Notation.
inherited
play(Move move) Position<Crazyhouse>
Plays a move and returns the updated Position.
inherited
playToSan(Move move) → (Position<Crazyhouse>, String)
Returns the SAN representation of the Move with the updated Position.
inherited
playUnchecked(Move move) Position<Crazyhouse>
Plays a move without checking if the move is legal and returns the updated Position.
inherited
toSan(Move move) String
Returns the SAN of this Move from the current Position.
inherited
toString() String
A string representation of this object.
inherited
validate({bool? ignoreImpossibleCheck}) → void
Checks the legality of this position.
override

Operators

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

Constants

initial → const Crazyhouse