Cute Chess  0.1
enginematch.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 #ifndef ENGINEMATCH_H
19 #define ENGINEMATCH_H
20 
21 #include <QObject>
22 #include <QMap>
23 #include <QString>
24 #include <QElapsedTimer>
25 #include <openingbook.h>
26 
27 class ChessGame;
28 class OpeningBook;
29 class Tournament;
30 
31 
32 class EngineMatch : public QObject
33 {
34  Q_OBJECT
35 
36  public:
37  EngineMatch(Tournament* tournament, QObject* parent = nullptr);
38  virtual ~EngineMatch();
39 
40  OpeningBook* addOpeningBook(const QString& fileName);
41  void setDebugMode(bool debug);
42  void setRatingInterval(int interval);
43  void setBookMode(OpeningBook::AccessMode mode);
44 
45  void start();
46  void stop();
47 
48  signals:
49  void finished();
50 
51  private slots:
52  void onGameStarted(ChessGame* game, int number);
53  void onGameFinished(ChessGame* game, int number);
54  void onTournamentFinished();
55  void print(const QString& msg);
56 
57  private:
58  void printRanking();
59 
60  Tournament* m_tournament;
61  bool m_debug;
62  int m_ratingInterval;
63  OpeningBook::AccessMode m_bookMode;
65  QElapsedTimer m_startTime;
66 };
67 
68 #endif // ENGINEMATCH_H
Definition: enginematch.h:32
Definition: chessgame.h:38
AccessMode
Definition: openingbook.h:46
Base class for chess tournaments.
Definition: tournament.h:44
A collection of opening moves for chess.
Definition: openingbook.h:42