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

Round-robin type chess tournament. More...

#include <roundrobintournament.h>

Inheritance diagram for RoundRobinTournament:
Tournament QObject

Public Member Functions

 RoundRobinTournament (GameManager *gameManager, QObject *parent=nullptr)
 
virtual QString type () const
 
- Public Member Functions inherited from Tournament
void addPlayer (PlayerBuilder *builder, const TimeControl &timeControl, const OpeningBook *book=nullptr, int bookDepth=256)
 
virtual bool canSetRoundMultiplier () const
 
int currentRound () const
 
QString errorString () const
 
int finalGameCount () const
 
int finishedGameCount () const
 
GameManagergameManager () const
 
int gamesPerEncounter () const
 
bool isFinished () const
 
QString name () const
 
const TournamentPlayerplayerAt (int index) const
 
int playerCount () const
 
virtual QString results () const
 
int roundMultiplier () const
 
int seedCount () const
 
void setAdjudicator (const GameAdjudicator &adjudicator)
 
void setEpdOutput (const QString &fileName)
 
void setGamesPerEncounter (int count)
 
void setName (const QString &name)
 
void setOpeningBookOwnership (bool enabled)
 
void setOpeningDepth (int plies)
 
void setOpeningRepetitions (int count)
 
void setOpeningSuite (OpeningSuite *suite)
 
void setPgnCleanupEnabled (bool enabled)
 
void setPgnOutput (const QString &fileName, PgnGame::PgnMode mode=PgnGame::Verbose)
 
void setPgnWriteUnfinishedGames (bool enabled)
 
void setRecoveryMode (bool recover)
 
void setRoundMultiplier (int factor)
 
void setSeedCount (int seedCount)
 
void setSite (const QString &site)
 
void setStartDelay (int delay)
 
void setSwapSides (bool enabled)
 
void setVariant (const QString &variant)
 
QString site () const
 
Sprtsprt () const
 
 Tournament (GameManager *gameManager, QObject *parent)
 
QString variant () const
 
virtual ~Tournament ()
 

Protected Member Functions

virtual int gamesPerCycle () const
 
virtual void initializePairing ()
 
virtual TournamentPairnextPair (int gameNumber)
 
- Protected Member Functions inherited from Tournament
virtual void addScore (int player, int score)
 
virtual bool areAllGamesFinished () const
 
TournamentPaircurrentPair () const
 
int gamesInProgress () const
 
virtual bool hasGauntletRatingsOrder () const
 
virtual void onFinished ()
 
virtual void onGameAboutToStart (ChessGame *game, const PlayerBuilder *white, const PlayerBuilder *black)
 
TournamentPairpair (int player1, int player2)
 
int playerIndex (ChessGame *game, Chess::Side side) const
 
void setCurrentRound (int round)
 
void startGame (TournamentPair *pair)
 

Additional Inherited Members

- Public Slots inherited from Tournament
void start ()
 
void stop ()
 
- Signals inherited from Tournament
void finished ()
 
void gameFinished (ChessGame *game, int number, int whiteIndex, int blackIndex)
 
void gameStarted (ChessGame *game, int number, int whiteIndex, int blackIndex)
 

Detailed Description

Round-robin type chess tournament.

In a Round-robin tournament each player meets all other contestants in turn.

Constructor & Destructor Documentation

RoundRobinTournament::RoundRobinTournament ( GameManager gameManager,
QObject parent = nullptr 
)
explicit

Creates a new Round-robin tournament.

Member Function Documentation

int RoundRobinTournament::gamesPerCycle ( ) const
protectedvirtual

Returns the number of games in one tournament cycle.

The gamesPerEncounter() and roundMultiplier() values must not affect the number of games per cycle.

Implements Tournament.

void RoundRobinTournament::initializePairing ( )
protectedvirtual

Initializes the pairings for the tournament.

Subclasses that implement this member function should prepare their data so that the nextPair() function can be called immediately afterwards.

Implements Tournament.

TournamentPair * RoundRobinTournament::nextPair ( int  gameNumber)
protectedvirtual

Returns the pair of players for the next game.

The pair's first element is the white player's index number and the second element is the black player's index number.

Subclasses that implement this member function should call setCurrentRound() to increase the round when needed. Subclasses should also alternate the colors when needed, to make the tournament as fair as possible.

Sublasses can return (-1, -1) if the next game should not be started yet.

Implements Tournament.

QString RoundRobinTournament::type ( ) const
virtual

Returns the tournament type (eg. "round-robin" or "gauntlet").

Implements Tournament.


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