|
Cute Chess 0.1
|
Knockout type chess tournament. More...
#include <knockouttournament.h>
Public Member Functions | |
| virtual bool | canSetRoundMultiplier () const |
| KnockoutTournament (GameManager *gameManager, QObject *parent=nullptr) | |
| virtual QString | results () const |
| 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 |
| GameManager * | gameManager () const |
| int | gamesPerEncounter () const |
| bool | isFinished () const |
| QString | name () const |
| const QMap< QString, QString > & | namedResultFormats () const |
| const TournamentPlayer & | playerAt (int index) const |
| int | playerCount () const |
| const QList< QString > | resultFieldTokens () const |
| QString | resultFormat () 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 | setOpeningPolicy (OpeningPolicy policy=DefaultPolicy) |
| 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 | setResultFormat (const QString &format) |
| void | setReverseSides (bool enabled) |
| 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 |
| Sprt * | sprt () const |
| Tournament (GameManager *gameManager, QObject *parent) | |
| virtual QString | type () const =0 |
| QString | variant () const |
| virtual | ~Tournament () |
Protected Member Functions | |
| virtual void | addScore (int player, Chess::Side side, int score) |
| virtual bool | areAllGamesFinished () const |
| virtual int | gamesPerCycle () const |
| virtual void | initializePairing () |
| virtual TournamentPair * | nextPair (int gameNumber) |
Protected Member Functions inherited from Tournament | |
| virtual void | addScore (int player, Chess::Side side, int score) |
| virtual bool | areAllGamesFinished () const |
| TournamentPair * | currentPair () const |
| int | gamesInProgress () const |
| virtual int | gamesPerCycle () const =0 |
| virtual bool | hasGauntletRatingsOrder () const |
| virtual void | initializePairing ()=0 |
| virtual TournamentPair * | nextPair (int gameNumber)=0 |
| virtual void | onFinished () |
| virtual void | onGameAboutToStart (ChessGame *game, const PlayerBuilder *white, const PlayerBuilder *black) |
| TournamentPair * | pair (int player1, int player2) |
| int | playerIndex (ChessGame *game, Chess::Side side) const |
| void | setCurrentRound (int round) |
| void | startGame (TournamentPair *pair) |
Additional Inherited Members | |
Public Types inherited from Tournament | |
| enum | OpeningPolicy { DefaultPolicy , EncounterPolicy , RoundPolicy } |
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) |
Static Public Attributes inherited from Tournament | |
| static constexpr auto | c_defaultFormat = "Rank,Name,Elo,Error,Games,Score,DScore" |
Knockout type chess tournament.
A single-elimination tournament where the number of rounds is determined by the number of players.
|
explicit |
Creates a new Knockout tournament.
|
protectedvirtual |
Adds score points to player at index player.
This member function is called when a game ends with a 1-0, 0-1 or 1/2-1/2 result. Subclasses can reimplement this to do their own score tracking.
Reimplemented from Tournament.
|
protectedvirtual |
Returns true if all games in the tournament have finished; otherwise returns false.
Reimplemented from Tournament.
|
virtual |
Returns true (default) if the tournament supports user-defined round multiplier; otherwise returns false.
Reimplemented from Tournament.
|
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.
|
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.
|
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.
|
virtual |
Returns tournament results as a string. The default implementation works for most tournament types.
Reimplemented from Tournament.
|
virtual |
Returns the tournament type (eg. "round-robin" or "gauntlet").
Implements Tournament.