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
35class 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
203Q_DECLARE_METATYPE(MoveEvaluation)
204
205#endif // MOVEEVALUATION_H
Evaluation data for a chess move.
Definition moveevaluation.h:36
void setBookEval(bool isBookEval)
Definition moveevaluation.cpp:210
void setTime(int time)
Definition moveevaluation.cpp:235
bool isBookEval() const
Definition moveevaluation.cpp:92
void merge(const MoveEvaluation &other)
Definition moveevaluation.cpp:280
bool operator!=(const MoveEvaluation &other) const
Definition moveevaluation.cpp:56
void setPvNumber(int number)
Definition moveevaluation.cpp:275
int hashUsage() const
Definition moveevaluation.cpp:168
quint64 tbHits() const
Definition moveevaluation.cpp:163
MoveEvaluation()
Definition moveevaluation.cpp:21
void setNodeCount(quint64 nodeCount)
Definition moveevaluation.cpp:240
void setPonderhitRate(int rate)
Definition moveevaluation.cpp:260
void setTbHits(quint64 tbHits)
Definition moveevaluation.cpp:250
void clear()
Definition moveevaluation.cpp:193
static constexpr int MATE_SCORE
Definition moveevaluation.h:39
void setNps(quint64 nps)
Definition moveevaluation.cpp:245
int selectiveDepth() const
Definition moveevaluation.cpp:107
int ponderhitRate() const
Definition moveevaluation.cpp:173
void setIsTrusted(bool isTrusted)
Definition moveevaluation.cpp:215
QString ponderMove() const
Definition moveevaluation.cpp:178
bool isEmpty() const
Definition moveevaluation.cpp:75
void setScore(int score)
Definition moveevaluation.cpp:230
int depth() const
Definition moveevaluation.cpp:102
void setPv(const QString &pv)
Definition moveevaluation.cpp:270
quint64 nps() const
Definition moveevaluation.cpp:156
int score() const
Definition moveevaluation.cpp:112
quint64 nodeCount() const
Definition moveevaluation.cpp:151
void setSelectiveDepth(int depth)
Definition moveevaluation.cpp:225
bool isTrusted() const
Definition moveevaluation.cpp:97
int time() const
Definition moveevaluation.cpp:146
int pvNumber() const
Definition moveevaluation.cpp:188
bool operator==(const MoveEvaluation &other) const
Definition moveevaluation.cpp:37
static constexpr int NULL_SCORE
Definition moveevaluation.h:42
QString scoreText() const
Definition moveevaluation.cpp:117
void setDepth(int depth)
Definition moveevaluation.cpp:220
QString pv() const
Definition moveevaluation.cpp:183
void setPonderMove(const QString &san)
Definition moveevaluation.cpp:265
void setHashUsage(int hashUsage)
Definition moveevaluation.cpp:255