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