summaryrefslogtreecommitdiffstats
path: root/pacman-c++/sceneholder.h
blob: f18895637334e0f41f79d3d2bc2d9678accb51f5 (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 SCENEHOLDER_H
#define SCENEHOLDER_H

#include <QtGui>

#include "constants.h"

class PixmapItem;
class Actor;

class SceneHolder
  : public QWidget
{
  Q_OBJECT

public:
  SceneHolder(QWidget* parent = 0);
  virtual ~SceneHolder() {};

protected:

  virtual void updateMap(const Transmission::map_t& map);

  // data conversion
  QPoint mapPositionToCoord(unsigned int x, unsigned int y);
  QPoint CoordToMapPosition(unsigned int x, unsigned int y);

  // map of all pixmap instances
  QVector< QVector<PixmapItem *> > visualMap;

  // map of actors in order to keep track of those instances
  QMap<Color::Color, Actor*> m_actors;

  QGraphicsScene *m_scene;

};

#endif // SCENEHOLDER_H