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
40class LIB_EXPORT SyzygyTablebase
41{
42 public:
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
static Chess::Result result(const Chess::Side &side, const Chess::Square &enpassantSq, Castling castling, int rule50, const PieceList &pieces, unsigned int *dtz=nullptr)
Definition syzygytablebase.cpp:69
static void setPieces(int pieces)
Definition syzygytablebase.cpp:58
CastlingFlag
Definition syzygytablebase.h:45
@ WhiteQueenSide
White can castle on queen's side.
Definition syzygytablebase.h:48
@ BlackQueenSide
Black can castle on queen's side.
Definition syzygytablebase.h:50
@ WhiteKingSide
White can castle on king's side.
Definition syzygytablebase.h:47
@ NoCastling
No castling rights.
Definition syzygytablebase.h:46
@ BlackKingSide
Black can castle on king's side.
Definition syzygytablebase.h:49
static bool tbAvailable(int pieces)
Definition syzygytablebase.cpp:53
static bool initialize(const QString &paths)
Definition syzygytablebase.cpp:41
static void setNoRule50()
Definition syzygytablebase.cpp:64
QList< QPair< Chess::Square, Chess::Piece > > PieceList
Definition syzygytablebase.h:55