Cute Chess  0.1
extinctionboard.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 EXTINCTIONBOARD_H
19 #define EXTINCTIONBOARD_H
20 
21 #include "standardboard.h"
22 
23 namespace Chess {
24 
44 class LIB_EXPORT ExtinctionBoard : public StandardBoard
45 {
46  public:
52  ExtinctionBoard(const QSet<int>& set
53  = QSet<int>{King, Queen, Rook, Bishop, Knight, Pawn},
54  bool allPromotions = true);
55 
56  // Inherited from StandardBoard
57  virtual Board* copy() const;
58  virtual QString variant() const;
59  virtual QString defaultFenString() const;
60  virtual Result result();
61  protected:
62  // Inherited from StandardBoard
63  virtual bool kingsCountAssertion(int whiteKings,
64  int blackKings) const;
65  virtual bool inCheck(Side side, int square = 0) const;
66  virtual void addPromotions(int sourceSquare,
67  int targetSquare,
68  QVarLengthArray<Move>& moves) const;
69 
70  private:
71  bool m_allPromotions;
72  QVarLengthArray<int> m_pieceSet;
73  Piece extinctPiece(Side side) const;
74 };
75 
76 
92 class LIB_EXPORT KingletBoard : public ExtinctionBoard
93 {
94  public:
95  KingletBoard();
96  virtual Board *copy() const;
97  virtual QString variant() const;
98 };
99 
100 } // namespace Chess
101 #endif // EXTINCTIONBOARD_H
A board for Kinglet Chess.
Definition: extinctionboard.h:92
An internal chessboard class.
Definition: board.h:56
Definition: boardscene.h:28
A board for Extinction Chess.
Definition: extinctionboard.h:44
The side or color of a chess player.
Definition: side.h:34
A chess piece.
Definition: piece.h:39
The result of a chess game.
Definition: result.h:33
A board for standard chess.
Definition: standardboard.h:37