Cute Chess  0.1
tournamentplayer.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 TOURNAMENTPLAYER_H
20 #define TOURNAMENTPLAYER_H
21 
22 #include "playerbuilder.h"
23 #include "timecontrol.h"
24 #include "board/side.h"
25 #include <QVector>
26 #include <QMap>
27 
28 class OpeningBook;
29 
31 class LIB_EXPORT TournamentPlayer
32 {
33  public:
36  const TimeControl& timeControl,
37  const OpeningBook* book,
38  int bookDepth);
39 
41  const PlayerBuilder* builder() const;
43  QString name() const;
45  void setName(const QString& name);
47  const TimeControl& timeControl() const;
49  const OpeningBook* book() const;
51  int bookDepth() const;
56  int wins() const;
61  int draws() const;
66  int losses() const;
71  int whiteWins() const;
76  int whiteDraws() const;
81  int whiteLosses() const;
86  int blackWins() const;
91  int blackDraws() const;
96  int blackLosses() const;
98  int score() const;
103  void addScore(Chess::Side side, int score);
108  void addOutcome(int type, QString str);
113  int gamesFinished() const;
118  int outcomes(int type) const;
120  const QMap<QString, int>& outcomeMap() const;
121 
122  private:
123  PlayerBuilder* m_builder;
124  TimeControl m_timeControl;
125  const OpeningBook* m_book;
126  int m_bookDepth;
127  int m_wins;
128  int m_draws;
129  int m_losses;
130  int m_whiteWins;
131  int m_whiteDraws;
132  int m_whiteLosses;
133  QVector<int> m_terminations;
134  QMap <QString, int> m_outcome;
135 };
136 
137 #endif // TOURNAMENTPLAYER_H
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&#39;s tournament-specific details.
Definition: tournamentplayer.h:31
The side or color of a chess player.
Definition: side.h:35
A collection of opening moves for chess.
Definition: openingbook.h:43