remove old files add new sources
[mancala] / src / Cup.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 CUP_H
21 #define CUP_H
22
23 #include <QtSvg/QGraphicsSvgItem>
24 #include <QGraphicsSimpleTextItem>
25
26 class QSizeF;
27 class Board;
28 class Stone;
29 class QPainter;
30 class GameInfo;
31
32 class Cup : public QGraphicsSvgItem{
33     Q_OBJECT
34     public:
35         Cup(GameInfo* info, int cupNumber, QGraphicsSvgItem *parent);
36
37         void drawInitially();
38         void drawTextInitially(int numStone);
39         void updateStoneList(Stone* stoneItem);
40         Stone* updateStoneList();
41         QPointF* calculateStonePosition(Stone *stone);
42         void addStone(Stone* stone);
43
44         //void setIdentifier(int num){ m_identifier = num;}
45         void setPosition(QPointF pos){ m_pos = pos;}
46         void setSize(QSizeF size){ m_size = size;}
47
48         //getting methods
49         int index() const{ return m_index; }
50         QSizeF size() const{ return m_size;}
51         QPointF middlePoint() const{ return m_mid_point;}
52         QPointF position() const{return m_pos;}
53         QPainterPath shape() const;
54
55     signals:
56
57     public slots:
58         void slotChangeText();
59
60     private:
61         //int m_identifier; //only for debugging
62
63         QPointF m_pos;
64         QSizeF m_size;
65         QPointF m_mid_point;
66         int m_index;
67         QString m_stone_num;
68
69         QList <Stone*> m_stone;
70         QGraphicsSimpleTextItem *m_text;
71
72         GameInfo* m_gameInfo;
73         Board* m_board;
74     };
75
76 #endif // CUP_H
77