#ifndef MAINWIDGET_H #define MAINWIDGET_H #include "sceneholder.h" #include "constants.h" #include "audio.h" #include "pacman.pb.h" #include #include #include class Actor; class MainWidget : public QWidget { Q_OBJECT public: MainWidget(QWidget *parent = 0); bool connected(); protected: /* handling of current key */ virtual void keyPressEvent(QKeyEvent* ); virtual void keyReleaseEvent(QKeyEvent* ); private slots: void startGame(); void playerScoreClicked(); void tick(); void sendKeyUpdate(); 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; AudioPlayer *m_sirenPlayer; QTcpSocket *m_socket; SceneHolder *m_scene; }; #endif // MAINWIDGET_H