ThreeCheck class
A variant similar to standard chess, where you can win if you put your opponent king into the third check.
- Inheritance
-
- Object
- Position<
ThreeCheck> - ThreeCheck
- Annotations
-
- @immutable
Constructors
- ThreeCheck({required Board board, Pockets? pockets, required Side turn, required Castles castles, Square? epSquare, required int halfmoves, required int fullmoves, required (int, int) remainingChecks})
-
const
- ThreeCheck.fromSetup(Setup setup, {bool? ignoreImpossibleCheck})
-
Set up a playable ThreeCheck 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 setteroverride
- 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 setterinherited
-
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
- remainingChecks → (int, int)
-
Number of remainingChecks for white (
item1
) and black (item2
).final - 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< ThreeCheck> , String) -
Returns the SAN of this Move and the updated Position.
inherited
-
makeSanUnchecked(
Move move) → (Position< ThreeCheck> , 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< ThreeCheck> -
Plays a move and returns the updated Position.
inherited
-
playToSan(
Move move) → (Position< ThreeCheck> , String) -
Returns the SAN representation of the Move with the updated Position.
inherited
-
playUnchecked(
Move move) → ThreeCheck -
Plays a move without checking if the move is legal and returns the updated Position.
override
-
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- initial → const ThreeCheck