Walls And Holes  1
mapcell.h
Go to the documentation of this file.
1 #ifndef MAPCELL_H
2 #define MAPCELL_H
3 
4 #include "mapcellgraphicsitem.h"
5 #include "tile.h"
6 
7 #include <QObject>
8 #include <QGraphicsScene>
9 #include <QGraphicsSceneHoverEvent>
10 #include <QGraphicsRectItem>
11 
12 class MapCell : public QObject
13 {
14  Q_OBJECT
15 
16 public:
17 
18  MapCell(QGraphicsScene *scene, int x, int y, const Tile &tile, QObject *parent = nullptr);
19  ~MapCell();
20 
21  int graphicsMode() const { return mGraphics->viewMode(); }
22  void setGraphicsMode(int viewMode);
23 
24 public slots:
25  void tileChanged();
26 
27 private:
28  QGraphicsScene *mScene;
29 
30  // TODO replace this with a gridGraphicsItem in MapView
31  QGraphicsRectItem *mGrid;
32  QGraphicsRectItem *mBackground;
33  MapCellGraphicsItem *mGraphics;
34 };
35 
36 #endif // MAPCELL_H
~MapCell()
Definition: mapcell.cpp:28
The MapCellGraphicsItem class Inherits from QGraphicsItem this class is used for painting and generat...
Definition: mapcellgraphicsitem.h:20
Class to represent each tile on the tileMap.
Definition: tile.h:13
void tileChanged()
Definition: mapcell.cpp:39
Definition: mapcell.h:12
int viewMode() const
Definition: mapcellgraphicsitem.h:31
void setGraphicsMode(int viewMode)
Definition: mapcell.cpp:44
MapCell(QGraphicsScene *scene, int x, int y, const Tile &tile, QObject *parent=nullptr)
Definition: mapcell.cpp:4
int graphicsMode() const
Definition: mapcell.h:21