summaryrefslogtreecommitdiffstats
path: root/pacman-c++/common/block.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++/common/block.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++/common/block.h')
-rw-r--r--pacman-c++/common/block.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/pacman-c++/common/block.h b/pacman-c++/common/block.h
new file mode 100644
index 0000000..abfbc5a
--- /dev/null
+++ b/pacman-c++/common/block.h
@@ -0,0 +1,43 @@
1#ifndef BLOCK_H
2#define BLOCK_H
3
4#include "gameentity.h"
5#include "constants.h"
6#include <QMap>
7
8class Block
9 : public GameEntity
10{
11public:
12 enum Neighbour
13 {
14 None = 0,
15 Left = (1 << 0),
16 Right = (1 << 1),
17 Up = (1 << 2),
18 Down = (1 << 3)
19 };
20
21 enum
22 {
23 Type = UserType + Transmission::block
24 };
25
26public:
27 Block(Color::Color color, unsigned int neighbours = None, QGraphicsItem *parent = 0);
28 virtual ~Block()
29 {};
30
31 unsigned int neighbours();
32 void setNeighbours(unsigned int neighbours);
33 virtual bool checkEnter(Actor *actor);
34 virtual EnteredState enter(Actor *actor);
35 virtual void onDie(Actor *);
36
37private:
38 // map for saving QPixmaps for reuse
39 static QMap<Color::Color, QPixmap> m_pixmaps;
40 unsigned int m_neighbours;
41};
42
43#endif // BLOCK_H