Cute Chess  0.1
Public Member Functions | List of all members
GameAdjudicator Class Reference

A class for adjudicating chess games. More...

#include <gameadjudicator.h>

Public Member Functions

void addEval (const Chess::Board *board, const MoveEvaluation &eval)
 
 GameAdjudicator ()
 
void resetDrawMoveCount ()
 
Chess::Result result () const
 
void setDrawThreshold (int moveNumber, int moveCount, int score)
 
void setResignThreshold (int moveCount, int score)
 
void setTablebaseAdjudication (bool enable)
 

Detailed Description

A class for adjudicating chess games.

The GameAdjudicator class can be used to adjudicate chess games when the probability of a specific result is high enough.

Constructor & Destructor Documentation

◆ GameAdjudicator()

GameAdjudicator::GameAdjudicator ( )

Creates a new game adjudicator.

By default all adjudication is disabled.

Member Function Documentation

◆ addEval()

void GameAdjudicator::addEval ( const Chess::Board board,
const MoveEvaluation eval 
)

Adds a new move evaluation to the adjudicator.

board should be at the position that follows the move. eval should be the evaluation of the move.

result() can be called after this function to find out if the game should be adjudicated.

◆ resetDrawMoveCount()

void GameAdjudicator::resetDrawMoveCount ( )

Sets draw move count to 0.

◆ result()

Chess::Result GameAdjudicator::result ( ) const

Returns the adjudication result.

This function returns the expected result of the game. If the game can't be adjudicated yet, a null result is returned.

◆ setDrawThreshold()

void GameAdjudicator::setDrawThreshold ( int  moveNumber,
int  moveCount,
int  score 
)

Sets the draw adjudication threshold for each game.

A game will be adjudicated as a draw if both players report a score that's within score centipawns from zero for at least moveCount consecutive moves, and at least moveNumber full moves have been played.

◆ setResignThreshold()

void GameAdjudicator::setResignThreshold ( int  moveCount,
int  score 
)

Sets the resign adjudication threshold for each game.

A game will be adjudicated as a loss for the player that made the last move if it reports a score that's at least score centipawns below zero for at least moveCount consecutive moves.

◆ setTablebaseAdjudication()

void GameAdjudicator::setTablebaseAdjudication ( bool  enable)

Sets tablebase adjudication to enable.

If enable is true then games are adjudicated if the latest position is found in the tablebases.


The documentation for this class was generated from the following files: