Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/GameStateManager.h @ 415

Last change on this file since 415 was 415, checked in by scheusso, 16 years ago

errorless

File size: 1.2 KB
Line 
1//
2// C++ Interface: GameStateManager
3//
4// Description:
5//
6//
7// Author:  Oliver Scheuss, (C) 2007
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef NETWORK_GAMESTATEMANAGER_H
13#define NETWORK_GAMESTATEMANAGER_H
14
15#include <vector>
16
17#include "zlib.h"
18
19#include "Synchronisable.h"
20#include "orxonox/core/IdentifierIncludes.h"
21#include "orxonox/core/Iterator.h"
22#include "PacketTypes.h"
23
24namespace network {
25
26
27
28/**
29 * This Class implements a manager for gamestates:
30 * - creating snapshots of gamestates
31 * - writing gamestates to universe
32 * - diffing gamestates ?
33 *
34 * EN/DECODATION:
35 * a: last Gamestate a client has received
36 * b: new Gamestate
37 * x: diffed and compressed gamestate
38 * x=(a^b)
39 * b=(a^x)
40 * diff(a,diff(a,x))=x (hope this is correct)
41 * @author Oliver Scheuss
42*/
43class GameStateManager{
44public:
45  GameStateManager();
46  ~GameStateManager();
47  void update();
48  GameStateCompressed popGameState(int clientID);
49private:
50  GameState getSnapshot(int id);
51  GameStateCompressed encode(GameState *a, GameState *b);
52  GameState diff(GameState *a, GameState *b);
53  GameStateCompressed compress_(GameState a);
54 
55  std::vector<GameState *> clientGameState;
56  GameState reference;
57  int id;
58};
59
60}
61
62#endif
Note: See TracBrowser for help on using the repository browser.