add qmake .pro file
[mancala] / src / Board.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 BOARD_H
21 #define BOARD_H
22
23 #include <QtSvg/QGraphicsSvgItem>
24 #include <QList>
25
26 class Cup;
27 class Kalah;
28 class Stone;
29 class GameInfo;
30 class ThemeManager;
31
32 class Board : public QGraphicsSvgItem{
33     Q_OBJECT
34 public:
35
36     Board(GameInfo *manager, ThemeManager *theme);
37     ~Board();
38
39     void manipulateStones(QList<Stone*>& currentStoneList);
40     void updateChildren(int cupIndex,QList<Stone*> &currentStoneList);
41
42     void updateChildren(int,int,bool);
43     void updateChildren(int,int,int);
44
45     void initialSetup();
46
47     int findCupIndex(QPointF);
48
49 public slots:
50     void slotUpdateChildren();
51
52 protected:
53     QPointF calcCupPosition(int row, int col);
54
55 private:
56     void createKalahs();
57     void createCups();
58     void showGameName();
59
60     QList <Cup*> m_cups;
61     QList <Stone*> m_stones;
62     Kalah* m_rightKalah;
63     Kalah* m_leftKalah;
64
65     GameInfo *m_gameInfo;
66     ThemeManager *m_theme;
67
68     qreal gapWidth;
69
70     bool m_isCup;
71     int m_index;
72     Stone* m_stone;
73 };
74
75 #endif // BOARD_H