summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/mainwidget.h')
-rw-r--r--pacman-c++/mainwidget.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/pacman-c++/mainwidget.h b/pacman-c++/mainwidget.h
index e7d146f..27e901f 100644
--- a/pacman-c++/mainwidget.h
+++ b/pacman-c++/mainwidget.h
@@ -1,6 +1,8 @@
1#ifndef MAINWIDGET_H 1#ifndef MAINWIDGET_H
2#define MAINWIDGET_H 2#define MAINWIDGET_H
3 3
4#include "sceneholder.h"
5
4#include "constants.h" 6#include "constants.h"
5#include "pixmapitem.h" 7#include "pixmapitem.h"
6#include <QtGui> 8#include <QtGui>
@@ -10,21 +12,22 @@
10class Actor; 12class Actor;
11 13
12class MainWidget 14class MainWidget
13 : public QWidget 15 : public SceneHolder
14{ 16{
15 Q_OBJECT 17 Q_OBJECT
16 18
17public: 19public:
18 MainWidget(); 20 MainWidget(QWidget *parent = 0);
19 21
20protected: 22protected:
21 // handling of current key 23 // handling of current key
22 virtual void keyPressEvent(QKeyEvent* ); 24 virtual void keyPressEvent(QKeyEvent* );
23 virtual void keyReleaseEvent(QKeyEvent* ); 25 virtual void keyReleaseEvent(QKeyEvent* );
24 26
27 virtual void updateMap(const Transmission::map_t& map);
28
25private: 29private:
26 void createGui(); 30 void createGui();
27 void updateMap(const Transmission::map_t& map);
28 void updateScore(); 31 void updateScore();
29 bool isRunning(); 32 bool isRunning();
30 33
@@ -34,17 +37,9 @@ private slots:
34 void tick(); 37 void tick();
35 38
36private: 39private:
37 QVector< QVector<PixmapItem *> > visualMap;
38
39 // data conversion
40 QPoint mapPositionToCoord(unsigned int x, unsigned int y);
41 40
42 // GUI elements needed in the progress of the game 41 // GUI elements needed in the progress of the game
43 QList<QGridLayout*> m_playerScoreLayouts; 42 QList<QGridLayout*> m_playerScoreLayouts;
44 QGraphicsScene *m_scene;
45
46 // map of actors in order to keep track of those instances
47 QMap<Color::Color, Actor*> m_actors;
48 43
49 // key currently pressed by user 44 // key currently pressed by user
50 Transmission::field_t m_currentKey; 45 Transmission::field_t m_currentKey;