remove old files add new sources
[mancala] / src / Kalah.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 KALAH_H
21 #define KALAH_H
22
23 #include <QtSvg/QGraphicsSvgItem>
24 #include <QGraphicsSimpleTextItem>
25
26
27 class Board;
28 class Stone;
29 class GameInfo;
30
31 class Kalah : public QGraphicsSvgItem{
32
33     public:
34         enum side{Left, Right};
35
36         Kalah(GameInfo* info, Kalah::side p, QGraphicsSvgItem *parent);
37
38         QPointF* calculateStonePosition(Stone* stone);
39         void updateStoneList(Stone* stoneItem);
40
41         QSizeF size() const{ return m_size;}
42         QPointF position() const{ return m_pos;}
43         QPointF middlePoint() const{ return m_mid_point;}
44         int index() const{ return m_side;}
45
46
47     private:
48         void initialSetup();
49         void setupText();
50
51         QSizeF m_size;
52         QPointF m_mid_point,m_pos;
53         QList <Stone*> m_stone;
54         QGraphicsSimpleTextItem *m_text;
55
56         side m_side;
57         Board *m_board;
58         GameInfo *m_gameInfo;
59 };
60
61 #endif // KALAH_H