Cute Chess 0.1
crazyhouseboard.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 CRAZYHOUSEBOARD_H
20#define CRAZYHOUSEBOARD_H
21
22#include "westernboard.h"
23
24namespace Chess {
25
35class LIB_EXPORT CrazyhouseBoard : public WesternBoard
36{
37 public:
40
41 // Inherited from WesternBoard
42 virtual Board* copy() const;
43 virtual QList<Piece> reservePieceTypes() const;
44 virtual QString variant() const;
45 virtual bool variantHasDrops() const;
46 virtual QString defaultFenString() const;
47
48 protected:
62
66 virtual int promotedPieceType(int type) const;
70 virtual bool pawnDropOkOnRank(int rank) const;
71
72 // Inherited from WesternBoard
73 virtual int reserveType(int pieceType) const;
74 virtual QString sanMoveString(const Move& move);
75 virtual Move moveFromSanString(const QString& str);
76 virtual void vMakeMove(const Move& move,
77 BoardTransition* transition);
78 virtual void vUndoMove(const Move& move);
79 virtual void generateMovesForPiece(QVarLengthArray<Move>& moves,
80 int pieceType,
81 int square) const;
82
83 private:
84 static int normalPieceType(int type);
85 void normalizePieces(Piece piece, QVarLengthArray<int>& squares);
86 void restorePieces(Piece piece, const QVarLengthArray<int>& squares);
87};
88
89} // namespace Chess
90#endif // CRAZYHOUSEBOARD_H
Details of a board transition caused by a move.
Definition boardtransition.h:41
An internal chessboard class.
Definition board.h:58
virtual QList< Piece > reservePieceTypes() const
Definition crazyhouseboard.cpp:39
virtual bool variantHasDrops() const
Definition crazyhouseboard.cpp:57
virtual Board * copy() const
Definition crazyhouseboard.cpp:34
virtual QString variant() const
Definition crazyhouseboard.cpp:52
virtual QString defaultFenString() const
Definition crazyhouseboard.cpp:62
CrazyhouseBoard()
Definition crazyhouseboard.cpp:25
CrazyhousePieceType
Definition crazyhouseboard.h:56
@ PromotedKnight
Promoted Knight.
Definition crazyhouseboard.h:57
@ PromotedBishop
Promoted Bishop.
Definition crazyhouseboard.h:58
@ PromotedRook
Promoted Rook.
Definition crazyhouseboard.h:59
@ PromotedQueen
Promoted Queen.
Definition crazyhouseboard.h:60
A small and efficient chessmove class.
Definition move.h:43
A chess piece.
Definition piece.h:41
WesternBoard(WesternZobrist *zobrist)
Definition westernboard.cpp:26