summaryrefslogtreecommitdiffstats
path: root/pacman-c++/sceneholder.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
committermanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
commitce48af53646cd9e7ec762fc1ac176b3aa620b11d (patch)
treef8fbf2cae8c7d0cbac2696a8f4cf94410bfb4928 /pacman-c++/sceneholder.h
parente54ccad07e256ba877bd41d70bd358bd0085bd1e (diff)
downloadfoop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.gz
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.bz2
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.zip
- refactorized the whole project and made a few subprojects
- replaced tcp with enet - added connect dialog - some smaller bugfixes
Diffstat (limited to 'pacman-c++/sceneholder.h')
-rw-r--r--pacman-c++/sceneholder.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/pacman-c++/sceneholder.h b/pacman-c++/sceneholder.h
deleted file mode 100644
index 7d6e556..0000000
--- a/pacman-c++/sceneholder.h
+++ /dev/null
@@ -1,73 +0,0 @@
1#ifndef SCENEHOLDER_H
2#define SCENEHOLDER_H
3
4#include "constants.h"
5#include <QtGui>
6
7class GameEntity;
8class Actor;
9
10class SceneHolder
11 : public QGraphicsScene
12{
13 Q_OBJECT
14
15public:
16 SceneHolder(QObject *parent = 0);
17 virtual ~SceneHolder()
18 {};
19 void reset();
20 unsigned int pointsLeft();
21 void updateMap(const Transmission::map_t& map);
22 void updateMap(const Transmission::map_t& map, const unsigned int x, const unsigned int y);
23 void setColor(Color::Color color = Color::none);
24 Color::Color color();
25 void setEatingOrder(QList<Color::Color> &order);
26 QList<Color::Color> &eatingOrder();
27 void showEatingText(bool show = true);
28
29signals:
30 void allPointsRemoved();
31
32private slots:
33 void decrementPoints();
34
35protected:
36 /* process items that got delayed by one tick */
37 void processDelayedItems();
38 /* data conversion */
39 QPoint mapPositionToCoord(unsigned int x, unsigned int y);
40 QPoint mapPositionToCoord(QPoint point);
41 QPoint CoordToMapPosition(unsigned int x, unsigned int y);
42 QPoint CoordToMapPosition(QPoint point);
43
44protected:
45 /* map of all pixmap instances */
46 QVector< QVector<GameEntity *> > visualMap;
47
48 /* map of actors in order to keep track of those instances */
49 QMap<Color::Color, Actor *> m_actors;
50
51 /* items that got removed/has been eaten
52 * must be remove one tick later
53 */
54 QList<GameEntity *> m_oldItems;
55 /* we need to store items that killed an actor too (e.g. colored blocks) */
56 QMap<Color::Color, GameEntity *> m_death;
57
58 /* my local color */
59 Color::Color m_color;
60
61 /* a actor can only eat his upper neighbour
62 * the order of the neighbours is determined by the colors order (sent from server)
63 * please note that !pl1.canEat(pl2, ...) doesn't necessarily mean that pl2 can eat pl1
64 * order MUST be in this format: [col1, [col2 ... colN], col1]
65 */
66 QList<Color::Color> m_eatingorder;
67
68 /* points left before round ends */
69 unsigned int m_pointsLeft;
70 QGraphicsTextItem *m_overlayText;
71};
72
73#endif // SCENEHOLDER_H