summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.h
blob: 2354bc208d7fc2ea8b96d69f8bef214ceb4dfc75 (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
#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);

private:
  // map for saving QPixmaps for reuse
  static QMap<Color::Color, QPixmap> m_pixmaps;
};

#endif  // BLOCK_H