Cute Chess  0.1
enginematch.h
1 /*
2  This file is part of Cute Chess.
3  Copyright (C) 2008-2018 Cute Chess authors
4 
5  Cute Chess is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Cute Chess is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef ENGINEMATCH_H
20 #define ENGINEMATCH_H
21 
22 #include <QObject>
23 #include <QMap>
24 #include <QString>
25 #include <QElapsedTimer>
26 #include <openingbook.h>
27 
28 class ChessGame;
29 class OpeningBook;
30 class Tournament;
31 
32 
33 class EngineMatch : public QObject
34 {
35  Q_OBJECT
36 
37  public:
38  EngineMatch(Tournament* tournament, QObject* parent = nullptr);
39  virtual ~EngineMatch();
40 
41  OpeningBook* addOpeningBook(const QString& fileName);
42  void setDebugMode(bool debug);
43  void setRatingInterval(int interval);
44  void setBookMode(OpeningBook::AccessMode mode);
45 
46  void start();
47  void stop();
48 
49  signals:
50  void finished();
51 
52  private slots:
53  void onGameStarted(ChessGame* game, int number);
54  void onGameFinished(ChessGame* game, int number);
55  void onTournamentFinished();
56  void print(const QString& msg);
57 
58  private:
59  void printRanking();
60 
61  Tournament* m_tournament;
62  bool m_debug;
63  int m_ratingInterval;
64  OpeningBook::AccessMode m_bookMode;
66  QElapsedTimer m_startTime;
67 };
68 
69 #endif // ENGINEMATCH_H
Definition: enginematch.h:33
Definition: chessgame.h:38
AccessMode
Definition: openingbook.h:47
Base class for chess tournaments.
Definition: tournament.h:44
A collection of opening moves for chess.
Definition: openingbook.h:43