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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/pacman-c++/mainwidget.h b/pacman-c++/mainwidget.h
index dc20d75..f7113a5 100644
--- a/pacman-c++/mainwidget.h
+++ b/pacman-c++/mainwidget.h
@@ -3,6 +3,7 @@
3 3
4#include "constants.h" 4#include "constants.h"
5#include <QtGui> 5#include <QtGui>
6#include <QtCore>
6 7
7class Actor; 8class Actor;
8 9
@@ -14,6 +15,11 @@ class MainWidget
14public: 15public:
15 MainWidget(); 16 MainWidget();
16 17
18protected:
19 // handling of current key
20 virtual void keyPressEvent(QKeyEvent* );
21 virtual void keyReleaseEvent(QKeyEvent* );
22
17private: 23private:
18 void loadDummyMap(); 24 void loadDummyMap();
19 25
@@ -22,10 +28,18 @@ private:
22 // data conversion 28 // data conversion
23 QPoint mapPositionToCoord(unsigned int x, unsigned int y); 29 QPoint mapPositionToCoord(unsigned int x, unsigned int y);
24 30
31 // GUI elements needed in the progress of the game
25 QList<QGridLayout*> m_playerScoreLayouts; 32 QList<QGridLayout*> m_playerScoreLayouts;
26 QGraphicsScene *m_scene; 33 QGraphicsScene *m_scene;
27 34
35 // map of actors in order to keep track of those instances
28 QMap<Color, Actor*> m_actors; 36 QMap<Color, Actor*> m_actors;
37
38 // key currently pressed by user
39 transmission::field_t currentKey;
40
41 // translate Qt::Key to our key format
42 transmission::field_t translateKey(int);
29}; 43};
30 44
31#endif // MAINWIDGET_H 45#endif // MAINWIDGET_H