blob: db104e37652e7e05a2f843cb64c5518855ba1662 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#ifndef BLOCK_H
#define BLOCK_H
#include "gameentity.h"
#include "constants.h"
#include <QMap>
class Block
: public GameEntity
{
public:
enum Neighbour
{
None = 0,
Left = (1 << 0),
Right = (1 << 1),
Up = (1 << 2),
Down = (1 << 3)
};
public:
Block(Color::Color color, unsigned int neighbours = None, QGraphicsItem *parent = 0);
virtual ~Block()
{};
void setNeighbours(unsigned int neighbours);
virtual bool checkEnter(Actor *)
{
/* TODO: colored blocks */
return false;
}
private:
// map for saving QPixmaps for reuse
static QMap<Color::Color, QPixmap> m_pixmaps;
};
#endif // BLOCK_H
|