#ifndef MAINWIDGET_H #define MAINWIDGET_H #include "sceneholder.h" #include "constants.h" #include "pixmapitem.h" #include "pacman.pb.h" #include #include #include class Actor; class MainWidget : public SceneHolder { Q_OBJECT public: MainWidget(QWidget *parent = 0); protected: // handling of current key virtual void keyPressEvent(QKeyEvent* ); virtual void keyReleaseEvent(QKeyEvent* ); private slots: void startGame(); void playerScoreClicked(); void tick(); private: void createGui(); void createMenu(); void updateScore(const ProtoBuf::MapUpdate&); bool isRunning(); Color::Color connectToServer(); /* GUI elements needed in the progress of the game */ QList m_playerScoreLayouts; /* key currently pressed by user */ Transmission::field_t m_currentKey; /* translate Qt::Key to our key format */ Transmission::field_t translateKey(int key); /* game running */ bool m_running; QTcpSocket *m_socket; }; #endif // MAINWIDGET_H