Cute Chess  0.1
atomicboard.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 ATOMICBOARD_H
19 #define ATOMICBOARD_H
20 
21 #include "westernboard.h"
22 
23 namespace Chess {
24 
33 class LIB_EXPORT AtomicBoard : public WesternBoard
34 {
35  public:
37  AtomicBoard();
38 
39  // Inherited from WesternBoard
40  virtual Board* copy() const;
41  virtual QString variant() const;
42  virtual QString defaultFenString() const;
43  virtual Result result();
44 
45  protected:
46  // Inherited from WesternBoard
47  virtual void vInitialize();
48  virtual bool inCheck(Side side, int square = 0) const;
49  virtual bool kingCanCapture() const;
50  virtual bool vSetFenString(const QStringList& fen);
51  virtual bool vIsLegalMove(const Move& move);
52  virtual void vMakeMove(const Move& move,
53  BoardTransition* transition);
54  virtual void vUndoMove(const Move& move);
55 
56  private:
57  struct MoveData
58  {
59  bool isCapture;
60  Piece piece;
61  Piece captures[8];
62  };
63 
64  QVector<MoveData> m_history;
65  int m_offsets[8];
66 };
67 
68 } // namespace Chess
69 #endif // ATOMICBOARD_H
An internal chessboard class.
Definition: board.h:56
A board for Atomic chess.
Definition: atomicboard.h:33
A board for western chess variants.
Definition: westernboard.h:40
Definition: boardscene.h:28
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
Details of a board transition caused by a move.
Definition: boardtransition.h:39
A small and efficient chessmove class.
Definition: move.h:41