1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
/*
* figure.h - plugin
* Copyright (C) 2010 Evgeny Khryukin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef FIGURE_H
#define FIGURE_H
#include <QPixmap>
class Figure
{
public:
enum GameType {
NoGame = 0,
WhitePlayer = 1,
BlackPlayer = 2
};
enum FigureType {
None = 0,
White_Pawn = 1,
White_Castle = 2,
White_Bishop = 3,
White_King = 4,
White_Queen = 5,
White_Knight = 6,
Black_Pawn = 7,
Black_Castle = 8,
Black_Bishop = 9,
Black_King = 10,
Black_Queen = 11,
Black_Knight = 12
};
Figure(GameType game = NoGame, FigureType type = Figure::None, int x = 0, int y = 0, QObject *parent = 0);
QPixmap getPixmap() const;
void setPosition(int x, int y);
void setType(FigureType type);
int positionX() const;
int positionY() const;
FigureType type() const;
GameType gameType() const;
QString typeString() const;
bool isMoved;
private:
int positionX_, positionY_;
FigureType type_;
GameType gameType_;
};
#endif // FIGURE_H
|