summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.h
diff options
context:
space:
mode:
authortotycro <totycro@unknown-horizons.org>2011-04-05 18:19:03 +0200
committertotycro <totycro@unknown-horizons.org>2011-04-05 18:19:03 +0200
commit3cdc77bc7d1da312a0c7ae9c734f6a33f1c49ecf (patch)
treeef6406c25ebb04d47c8c39c32121c5a37d444e56 /pacman-c++/mainwidget.h
parentde6884b116323b5baa620a4bcdf7b7eb44a833aa (diff)
downloadfoop-3cdc77bc7d1da312a0c7ae9c734f6a33f1c49ecf.tar.gz
foop-3cdc77bc7d1da312a0c7ae9c734f6a33f1c49ecf.tar.bz2
foop-3cdc77bc7d1da312a0c7ae9c734f6a33f1c49ecf.zip
added key handling
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