#ifndef SERVER_H #define SERVER_H #include "sceneholder.h" #include "actor.h" #include "pacman.pb.h" #include class QTcpSocket; class Server : public SceneHolder { Q_OBJECT public: Server(QWidget *parent = 0); protected slots: void tick(); /* receive updates of client */ void keyPressUpdate(); protected: /* block until we have connections from all clients */ void waitForClientConnections(); /* calculate updates of current tick for sending to client */ Transmission::map_t calculateUpdates(); QSharedPointer createUpdatePacket(Transmission::map_t); /* update client maps */ void sendUpdate(QSharedPointer); QMap m_clientConnections; /* current movements. required to make pacmans continue their movement */ QMap m_actorMovements; }; #endif // SERVER_H