summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.h
blob: 9e49a7dc74bdc8faac2756fed06b9f675a8fa635 (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 "pixmapitem.h"
#include "constants.h"
#include <QMap>

class Block
  : public PixmapItem
{
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