Changeset 436 for code/branches/FICN/src/network/GameStateManager.h
- Timestamp:
- Dec 9, 2007, 12:42:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/GameStateManager.h
r425 r436 13 13 #define NETWORK_GAMESTATEMANAGER_H 14 14 15 #include < vector>15 #include <map> 16 16 17 17 #include "zlib.h" 18 18 19 #include "ClientInformation.h" 19 20 #include "Synchronisable.h" 20 21 #include "orxonox/core/IdentifierIncludes.h" … … 24 25 namespace network { 25 26 26 27 #define KEEP_GAMESTATES 20 27 28 28 29 /** … … 43 44 class GameStateManager{ 44 45 public: 45 GameStateManager( );46 GameStateManager(ClientInformation *head); 46 47 ~GameStateManager(); 47 48 void update(); 48 49 GameStateCompressed popGameState(int clientID); 49 50 void ackGameState(int clientID, int gamestateID); 50 void removeClient(int clientID);51 51 private: 52 52 GameState *getSnapshot(int id); 53 53 GameStateCompressed encode(GameState *a, GameState *b); 54 GameStateCompressed encode(GameState *a); 54 55 GameState diff(GameState *a, GameState *b); 55 GameStateCompressed compress_(GameState a);56 bool deleteUnusedGameState( GameState *state);56 GameStateCompressed compress_(GameState *a); 57 bool deleteUnusedGameState(int gamestateID); 57 58 58 std:: vector<GameState *> clientGameState;59 std:: vector<GameState *> idGameState;59 std::map<int, GameState*> gameStateMap; //map gsID to gamestate* 60 std::map<int, int> gameStateUsed; // save the number of clients, that use the specific gamestate 60 61 GameState *reference; 61 62 int id; 63 ClientInformation *head_; 62 64 }; 63 65
Note: See TracChangeset
for help on using the changeset viewer.