27 #include <QTextStream> 28 #include "board/move.h" 29 #include "timecontrol.h" 31 #include "gameadjudicator.h" 32 #include "tournamentplayer.h" 33 #include "tournamentpair.h" 57 constexpr
static auto c_defaultFormat
58 =
"Rank,Name,Elo,Error,Games,Score,DScore";
75 virtual QString type()
const = 0;
79 bool isFinished()
const;
94 int currentRound()
const;
104 int gamesPerEncounter()
const;
110 int roundMultiplier()
const;
112 int finishedGameCount()
const;
114 int finalGameCount()
const;
118 int playerCount()
const;
123 int seedCount()
const;
133 void setName(
const QString& name);
135 void setSite(
const QString& site);
137 void setVariant(
const QString& variant);
143 void setGamesPerEncounter(
int count);
148 virtual bool canSetRoundMultiplier()
const;
154 void setRoundMultiplier(
int factor);
156 void setStartDelay(
int delay);
164 void setRecoveryMode(
bool recover);
182 void setOpeningDepth(
int plies);
190 void setPgnOutput(
const QString& fileName,
199 void setPgnWriteUnfinishedGames(
bool enabled);
207 void setPgnCleanupEnabled(
bool enabled);
215 void setEpdOutput(
const QString& fileName);
223 void setOpeningRepetitions(
int count);
236 void setOpeningPolicy(OpeningPolicy policy = DefaultPolicy);
243 void setReverseSides(
bool enabled);
250 void setOpeningBookOwnership(
bool enabled);
255 void setSeedCount(
int seedCount);
262 void setSwapSides(
bool enabled);
268 void setResultFormat(
const QString &format);
294 int bookDepth = 256);
299 virtual QString results()
const;
354 void setCurrentRound(
int round);
356 int gamesInProgress()
const;
379 virtual void onGameAboutToStart(
ChessGame* game,
395 virtual void initializePairing() = 0;
402 virtual int gamesPerCycle()
const = 0;
424 virtual void onFinished();
432 virtual void addScore(
int player,
Chess::Side side,
int score);
437 virtual bool areAllGamesFinished()
const;
445 virtual bool hasGauntletRatingsOrder()
const;
448 void startNextGame();
449 bool writePgn(
PgnGame* pgn,
int gameNumber);
505 {
"DScore", DrawScore},
507 {
"Error", ErrorMargin},
509 {
"wScore", WhiteScore},
510 {
"wDScore", WhiteDrawScore},
511 {
"wElo", WhiteEloDiff},
512 {
"wError", WhiteErrorMargin},
514 {
"bScore", BlackScore},
515 {
"bDScore", BlackDrawScore},
516 {
"bElo", BlackEloDiff},
517 {
"bError", BlackErrorMargin},
523 {
"minimal",
"Rank,Name"},
524 {
"small",
"Rank,Name,Games,Points"},
525 {
"short",
"Rank,Name,Elo,Games"},
526 {
"concise",
"Rank,Name,Elo,Error,Games"},
527 {
"default",
QString(c_defaultFormat)},
528 {
"with-points",
"Rank,Name,Elo,Error,Games,Points,Score,DScore"},
529 {
"wide",
"Rank,Name,Elo,Error,Games,W,L,D,Points,Score,DScore"},
530 {
"wide2",
"Rank,Name,Elo,Error,Games,W,L,D,Points," 531 "Score,DScore,wScore,bScore"},
532 {
"per-color",
"Rank,Name,Elo,Error,Games,W,L,D,Points," 533 "wW,wL,wD,wPoints,bW,bL,bD,bPoints"},
534 {
"ordo",
"Rank,Name,Elo,Points,Games,Score"}
563 qreal whiteDrawScore;
565 qreal whiteErrorMargin;
568 qreal blackDrawScore;
570 qreal blackErrorMargin;
574 QString resultsForSides(
int index)
const;
584 int m_nextGameNumber;
585 int m_finishedGameCount;
586 int m_savedGameCount;
587 int m_finalGameCount;
588 int m_gamesPerEncounter;
589 int m_roundMultiplier;
594 int m_openingRepetitions;
595 OpeningPolicy m_openingPolicy;
598 bool m_pgnWriteUnfinishedGames;
600 bool m_bookOwnership;
609 int m_repetitionCounter;
642 void setEntryFormat(
const QString& format);
653 #endif // TOURNAMENT_H Use additional data like extra tags and comments.
Definition: pgngame.h:60
A class for constructing new chess players.
Definition: playerbuilder.h:38
Time controls of a chess game.
Definition: timecontrol.h:35
A class for storing a player's tournament-specific details.
Definition: tournamentplayer.h:29
A game of chess in PGN format.
Definition: pgngame.h:51
Shift on new encounter.
Definition: tournament.h:53
Shift on repetition count and on new encounter.
Definition: tournament.h:52
Definition: chessgame.h:38
The side or color of a chess player.
Definition: side.h:35
PgnMode
Definition: pgngame.h:55
A class for adjudicating chess games.
Definition: gameadjudicator.h:32
A class for managing chess games and players.
Definition: gamemanager.h:40
OpeningPolicy
Definition: tournament.h:50
Base class for chess tournaments.
Definition: tournament.h:44
A collection of opening moves for chess.
Definition: openingbook.h:43
A single encounter in a tournament.
Definition: tournamentpair.h:31
A Sequential Probability Ratio Test.
Definition: sprt.h:32
A suite of chess openings.
Definition: openingsuite.h:40