GameEndings extension

on

Properties

checkLimitMet bool
no setter
checkmate bool
Is this checkmate?
no setter
drawn bool
True if the game state is any kind of draw.
no setter
eliminated bool
no setter
gameOver bool
True if the game has ended in any way. See result for how it ended.
no setter
halfMoveRule bool
Check if we have reached the half move rule (aka the 50 move rule in standard chess). Configurable in variant.halfMoveDraw.
no setter
inCheck bool
Is the current player's king in check?
no setter
inDraw bool
True if the game state is any kind of draw.
no setter
insufficientMaterial bool
Check if there is currently sufficient material on the board for one player to mate the other. Returns true if there isn't sufficient material (and therefore it's a draw).
no setter
repetition bool
Check if we have reached the repetition draw limit (threefold repetition in standard chess). Configurable in Variant.repetitionDraw.
no setter
result GameResult?
The result of the game. If null, the game has not ended yet.
no setter
royalsFacing bool
Returns true if the royal pieces for each player are on the same file, e.g. Xiangqi's flying generals rule.
no setter
stalemate bool
Is this stalemate?
no setter
winner int?
Returns the player who won the game, or null if the game is drawn or ongoing.
no setter
won bool
True if the game state is any kind of win/loss.
no setter

Methods

hasSufficientMaterial(Colour player, {BishopState? state}) bool
Determines whether there is sufficient material for player to deliver mate in the board position specified in state. state defaults to the current board state if unspecified.
lostBy(int colour, {bool ignoreSoftResults = false}) bool
wonBy(int colour, {bool ignoreSoftResults = false}) bool