Cute Chess  0.1
roundrobintournament.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 
19 #ifndef ROUNDROBINTOURNAMENT_H
20 #define ROUNDROBINTOURNAMENT_H
21 
22 #include "tournament.h"
23 
30 class LIB_EXPORT RoundRobinTournament : public Tournament
31 {
32  Q_OBJECT
33 
34  public:
36  explicit RoundRobinTournament(GameManager* gameManager,
37  QObject *parent = nullptr);
38  // Inherited from Tournament
39  virtual QString type() const;
40 
41  protected:
42  // Inherited from Tournament
43  virtual void initializePairing();
44  virtual int gamesPerCycle() const;
45  virtual TournamentPair* nextPair(int gameNumber);
46 
47  private:
48  int m_pairNumber;
49  QList<int> m_topHalf;
50  QList<int> m_bottomHalf;
51 };
52 
53 #endif // ROUNDROBINTOURNAMENT_H
virtual QString type() const =0
virtual void initializePairing()=0
virtual TournamentPair * nextPair(int gameNumber)=0
A class for managing chess games and players.
Definition: gamemanager.h:39
Base class for chess tournaments.
Definition: tournament.h:44
A single encounter in a tournament.
Definition: tournamentpair.h:30
virtual int gamesPerCycle() const =0
Round-robin type chess tournament.
Definition: roundrobintournament.h:30