From d547dec802f76c346538144f4eacf6d8ca6310c4 Mon Sep 17 00:00:00 2001 From: totycro Date: Sat, 9 Apr 2011 13:54:18 +0200 Subject: Pull up methods from mainwidget to sceneholder for sharing in both client and server --- pacman-c++/mainwidget.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'pacman-c++/mainwidget.h') 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 @@ #ifndef MAINWIDGET_H #define MAINWIDGET_H +#include "sceneholder.h" + #include "constants.h" #include "pixmapitem.h" #include @@ -10,21 +12,22 @@ class Actor; class MainWidget - : public QWidget + : public SceneHolder { Q_OBJECT public: - MainWidget(); + MainWidget(QWidget *parent = 0); protected: // handling of current key virtual void keyPressEvent(QKeyEvent* ); virtual void keyReleaseEvent(QKeyEvent* ); + virtual void updateMap(const Transmission::map_t& map); + private: void createGui(); - void updateMap(const Transmission::map_t& map); void updateScore(); bool isRunning(); @@ -34,17 +37,9 @@ private slots: void tick(); private: - QVector< QVector > visualMap; - - // data conversion - QPoint mapPositionToCoord(unsigned int x, unsigned int y); // GUI elements needed in the progress of the game QList m_playerScoreLayouts; - QGraphicsScene *m_scene; - - // map of actors in order to keep track of those instances - QMap m_actors; // key currently pressed by user Transmission::field_t m_currentKey; -- cgit v1.2.3