8af9f52b4cd3c5f8826ca929202a1ef89969b252
[mancala] / src / Stone.h
1 /*
2 Mancala - A Historical Board Game
3 Copyright (C) 2009-2010 A.H.M.Mahfuzur Rahman 65mahfuz90@gmail.com
4 Copyright (c) 2010 Reto Zingg g.d0b3rm4n@gmail.com
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef STONE_H
21 #define STONE_H
22
23 #include <QtSvg/QGraphicsSvgItem>
24
25
26 class GameInfo;
27 class ThemeManager;
28 class Board;
29
30 class Stone : public QGraphicsSvgItem{
31     Q_OBJECT
32     public:
33
34         Stone(int index, GameInfo* gameInfo, ThemeManager* theme, QGraphicsSvgItem *parent);
35         void initialSetup();
36
37         void setSize(QSizeF size){ m_size = size;}
38
39         QSizeF size() const{ return m_size;}
40         int index() const{ return m_index;}
41
42         void animateStones(QPointF);
43         void setPosition(qreal x, qreal y);
44
45     signals:
46         void nothing();
47
48
49     protected:
50
51     private:
52
53         int m_index;
54         QSizeF m_size;
55         QPointF m_pos;
56         Board* m_board;
57
58         ThemeManager *m_themeManager;
59         GameInfo *m_gameInfo;
60 };
61
62 #endif // STONE_H