40 #ifndef _GamestateManager_H__ 41 #define _GamestateManager_H__ 89 virtual bool ackGamestate(
unsigned int gamestateID,
unsigned int peerID)
override;
90 virtual uint32_t getLastReceivedGamestateID(
unsigned int peerID )
override;
93 bool processGamestates();
94 bool sendAck(
unsigned int gamestateID, uint32_t peerID);
96 std::vector<packet::Gamestate*> getGamestates();
101 void addPeer( uint32_t peerID );
103 { assert(peerMap_.find(peerID) != peerMap_.end()); peerMap_[peerID].isSynched =
true; }
104 void removePeer( uint32_t peerID );
105 bool hasPeers(){
return this->peerMap_.size() != 0; }
Shared library macros, enums, constants and forward declarations for the network library ...
bool isSynched
Definition: GamestateManager.h:79
virtual uint32_t getCurrentGamestateID() override
Definition: GamestateManager.h:91
Shared library macros, enums, constants and forward declarations for the core library ...
uint32_t lastReceivedGamestateID
id of the last gamestate which was received (and processed) from the peer
Definition: GamestateManager.h:77
ThreadPool * Pool_
Definition: GamestateManager.h:121
Definition: GamestateManager.h:74
std::map< uint32_t, peerInfo > peerMap_
Definition: GamestateManager.h:116
This Class implements a manager for gamestates:
Definition: GamestateManager.h:72
Definition: Gamestate.h:109
std::map< unsigned int, packet::Gamestate * > gamestateQueue
Definition: GamestateManager.h:113
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _NetworkExport
Definition: NetworkPrereqs.h:59
void setSynched(uint32_t peerID)
Definition: GamestateManager.h:102
const int KEEP_GAMESTATES
Definition: GamestateManager.h:53
uint32_t peerID
Definition: GamestateManager.h:76
Definition: ThreadPool.h:48
uint32_t lastAckedGamestateID
id of the last gamestate on which we received an ack from the peer
Definition: GamestateManager.h:78
bool hasPeers()
Definition: GamestateManager.h:105
An interface for any class that wants to handle gamestates.
Definition: GamestateHandler.h:42
packet::Gamestate * currentGamestate_
Definition: GamestateManager.h:119
static constexpr unsigned int GAMESTATEID_INITIAL
Definition: NetworkPrereqs.h:69
std::map< uint32_t, packet::Gamestate * > gamestates
Definition: GamestateManager.h:80
unsigned int id_
Definition: GamestateManager.h:120