Cute Chess  0.1
syzygytablebase.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 SYZYGYTABLEBASE_H
19 #define SYZYGYTABLEBASE_H
20 
21 #include <QFlags>
22 #include <QList>
23 #include <QPair>
24 #include "result.h"
25 #include "square.h"
26 #include "piece.h"
27 
39 class LIB_EXPORT SyzygyTablebase
40 {
41  public:
44  {
45  NoCastling = 0x0,
46  WhiteKingSide = 0x8,
47  WhiteQueenSide = 0x4,
48  BlackKingSide = 0x2,
49  BlackQueenSide = 0x1
50  };
51  Q_DECLARE_FLAGS(Castling, CastlingFlag)
52 
53 
54  typedef QList< QPair<Chess::Square, Chess::Piece> > PieceList;
55 
64  static bool initialize(const QString& paths);
69  static bool tbAvailable(int pieces);
74  static void setPieces(int pieces);
78  static void setNoRule50();
92  static Chess::Result result(const Chess::Side& side,
93  const Chess::Square& enpassantSq,
94  Castling castling,
95  int rule50,
96  const PieceList& pieces,
97  unsigned int* dtz = nullptr);
98 
99  private:
100  SyzygyTablebase();
101 };
102 
103 #endif // SYZYGYTABLEBASE_H
A wrapper for probing Syzygy endgame tablebases.
Definition: syzygytablebase.h:39
Definition: boardscene.h:28
CastlingFlag
Definition: syzygytablebase.h:43