Cute Chess 0.1
boardtransition.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 BOARDTRANSITION_H
20#define BOARDTRANSITION_H
21
22#include <QList>
23#include "square.h"
24#include "piece.h"
25
26namespace Chess {
27
40class LIB_EXPORT BoardTransition
41{
42 public:
44 struct Move
45 {
48 };
49
56 struct Drop
57 {
60 };
61
64
66 bool isEmpty() const;
68 void clear();
69
76 QList<Move> moves() const;
78 QList<Drop> drops() const;
80 QList<Square> squares() const;
82 QList<Piece> reserve() const;
83
85 void addMove(const Square& source, const Square& target);
87 void addDrop(const Piece& piece, const Square& target);
94 void addSquare(const Square& square);
101 void addReservePiece(const Piece& piece);
102
103 private:
104 QList<Move> m_moves;
105 QList<Drop> m_drops;
106 QList<Square> m_squares;
107 QList<Piece> m_reserve;
108};
109
110} // namespace Chess
111#endif // BOARDTRANSITION_H
void clear()
Definition boardtransition.cpp:35
QList< Move > moves() const
Definition boardtransition.cpp:43
void addSquare(const Square &square)
Definition boardtransition.cpp:81
bool isEmpty() const
Definition boardtransition.cpp:27
QList< Square > squares() const
Definition boardtransition.cpp:53
BoardTransition()
Definition boardtransition.cpp:23
void addDrop(const Piece &piece, const Square &target)
Definition boardtransition.cpp:72
void addMove(const Square &source, const Square &target)
Definition boardtransition.cpp:63
QList< Drop > drops() const
Definition boardtransition.cpp:48
void addReservePiece(const Piece &piece)
Definition boardtransition.cpp:87
QList< Piece > reserve() const
Definition boardtransition.cpp:58
A chess piece.
Definition piece.h:41
A generic chess square type consisting of a file and a rank.
Definition square.h:34
A piece drop.
Definition boardtransition.h:57
Square target
Target square of the drop.
Definition boardtransition.h:59
Piece piece
Type of the dropped piece.
Definition boardtransition.h:58
Movement on the board.
Definition boardtransition.h:45
Square target
Target square.
Definition boardtransition.h:47
Square source
Source square.
Definition boardtransition.h:46