Last change
on this file since 351 was
346,
checked in by rgrieder, 17 years ago
|
- adjusted the entire source to compile under windows visual studio too:
- added some ugly conversions
- changed some illegal code pieces (gcc however accepted it)
- added a few files from reto's framework to evade linker errors (no more dynamic linking)
- inserted some 'return true' to justify the return type
- excluded the levelLoader in the orxonox.cc (couldn't make it work, parsing error)
- wrote about 5 code #branches to compensate for missing usleep() under windows
|
File size:
999 bytes
|
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 "Synchronisable.h" |
---|
16 | #include "orxonox/core/IdentifierIncludes.h" |
---|
17 | #include "orxonox/core/Iterator.h" |
---|
18 | |
---|
19 | namespace network { |
---|
20 | |
---|
21 | /** |
---|
22 | * This struct defines a gamestate: |
---|
23 | * size: total size of the data in *data |
---|
24 | * data: pointer to the data allocated in the memory |
---|
25 | */ |
---|
26 | struct GameState{ |
---|
27 | int id; |
---|
28 | int size; |
---|
29 | unsigned char *data; |
---|
30 | }; |
---|
31 | |
---|
32 | /** |
---|
33 | * This Class implements a manager for gamestates: |
---|
34 | * - creating snapshots of gamestates |
---|
35 | * - writing gamestates to universe |
---|
36 | * - diffing gamestates ? |
---|
37 | * @author Oliver Scheuss |
---|
38 | */ |
---|
39 | class GameStateManager{ |
---|
40 | public: |
---|
41 | GameStateManager(); |
---|
42 | ~GameStateManager(); |
---|
43 | GameState getSnapshot(int id); |
---|
44 | bool loadSnapshot(GameState state); |
---|
45 | private: |
---|
46 | void removeObject(orxonox::Iterator<Synchronisable> &it); |
---|
47 | |
---|
48 | }; |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.