From ce48af53646cd9e7ec762fc1ac176b3aa620b11d Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 5 May 2011 00:57:07 +0200 Subject: - refactorized the whole project and made a few subprojects - replaced tcp with enet - added connect dialog - some smaller bugfixes --- pacman-c++/common/block.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pacman-c++/common/block.h (limited to 'pacman-c++/common/block.h') 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 @@ +#ifndef BLOCK_H +#define BLOCK_H + +#include "gameentity.h" +#include "constants.h" +#include + +class Block + : public GameEntity +{ +public: + enum Neighbour + { + None = 0, + Left = (1 << 0), + Right = (1 << 1), + Up = (1 << 2), + Down = (1 << 3) + }; + + enum + { + Type = UserType + Transmission::block + }; + +public: + Block(Color::Color color, unsigned int neighbours = None, QGraphicsItem *parent = 0); + virtual ~Block() + {}; + + unsigned int neighbours(); + void setNeighbours(unsigned int neighbours); + virtual bool checkEnter(Actor *actor); + virtual EnteredState enter(Actor *actor); + virtual void onDie(Actor *); + +private: + // map for saving QPixmaps for reuse + static QMap m_pixmaps; + unsigned int m_neighbours; +}; + +#endif // BLOCK_H -- cgit v1.2.3