Cute Chess  0.1
boardtransition.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 BOARDTRANSITION_H
19 #define BOARDTRANSITION_H
20 
21 #include <QList>
22 #include "square.h"
23 #include "piece.h"
24 
25 namespace Chess {
26 
39 class LIB_EXPORT BoardTransition
40 {
41  public:
43  struct Move
44  {
47  };
48 
55  struct Drop
56  {
59  };
60 
63 
65  bool isEmpty() const;
67  void clear();
68 
75  QList<Move> moves() const;
77  QList<Drop> drops() const;
79  QList<Square> squares() const;
81  QList<Piece> reserve() const;
82 
84  void addMove(const Square& source, const Square& target);
86  void addDrop(const Piece& piece, const Square& target);
93  void addSquare(const Square& square);
100  void addReservePiece(const Piece& piece);
101 
102  private:
103  QList<Move> m_moves;
104  QList<Drop> m_drops;
105  QList<Square> m_squares;
106  QList<Piece> m_reserve;
107 };
108 
109 } // namespace Chess
110 #endif // BOARDTRANSITION_H
Piece piece
Type of the dropped piece.
Definition: boardtransition.h:57
Movement on the board.
Definition: boardtransition.h:43
Square source
Source square.
Definition: boardtransition.h:45
Square target
Target square of the drop.
Definition: boardtransition.h:58
Definition: boardscene.h:28
Square target
Target square.
Definition: boardtransition.h:46
A chess piece.
Definition: piece.h:39
Details of a board transition caused by a move.
Definition: boardtransition.h:39
A generic chess square type consisting of a file and a rank.
Definition: square.h:32
A piece drop.
Definition: boardtransition.h:55