Cute Chess  0.1
moveevaluation.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 MOVEEVALUATION_H
20 #define MOVEEVALUATION_H
21 
22 #include <QString>
23 #include <QMetaType>
24 
35 class LIB_EXPORT MoveEvaluation
36 {
37  public:
39  constexpr static int MATE_SCORE = 1000000;
40 
42  constexpr static int NULL_SCORE = 0xFFFFFFF;
43 
46 
48  bool operator==(const MoveEvaluation& other) const;
50  bool operator!=(const MoveEvaluation& other) const;
51 
53  bool isEmpty() const;
54 
56  bool isBookEval() const;
57 
59  bool isTrusted() const;
60 
65  int depth() const;
66 
71  int selectiveDepth() const;
72 
77  int score() const;
78 
85  QString scoreText() const;
86 
88  int time() const;
89 
94  quint64 nodeCount() const;
95 
100  quint64 nps() const;
101 
106  quint64 tbHits() const;
107 
112  int hashUsage() const;
113 
118  int ponderhitRate() const;
119 
121  QString ponderMove() const;
122 
129  QString pv() const;
130 
135  int pvNumber() const;
136 
137 
139  void clear();
140 
142  void setBookEval(bool isBookEval);
143 
145  void setIsTrusted(bool isTrusted);
146 
148  void setDepth(int depth);
149 
151  void setSelectiveDepth(int depth);
152 
154  void setScore(int score);
155 
157  void setTime(int time);
158 
160  void setNodeCount(quint64 nodeCount);
161 
163  void setNps(quint64 nps);
164 
166  void setTbHits(quint64 tbHits);
167 
169  void setHashUsage(int hashUsage);
170 
172  void setPonderhitRate(int rate);
173 
175  void setPonderMove(const QString& san);
176 
178  void setPv(const QString& pv);
179 
181  void setPvNumber(int number);
182 
184  void merge(const MoveEvaluation& other);
185 
186  private:
187  bool m_isBookEval;
188  bool m_isTrusted;
189  int m_depth;
190  int m_selDepth;
191  int m_score;
192  int m_time;
193  int m_pvNumber;
194  int m_hashUsage;
195  int m_ponderhitRate;
196  quint64 m_nodeCount;
197  quint64 m_nps;
198  quint64 m_tbHits;
199  QString m_pv;
200  QString m_ponderMove;
201 };
202 
203 Q_DECLARE_METATYPE(MoveEvaluation)
204 
205 #endif // MOVEEVALUATION_H
Evaluation data for a chess move.
Definition: moveevaluation.h:35