Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/story_entities/multi_player_world.h @ 6356

Last change on this file since 6356 was 6356, checked in by patrick, 18 years ago

network: the new world setup

File size: 3.3 KB
Line 
1/*!
2 * @file multi_player_world.h
3  *  Holds and manages all game data
4*/
5
6#ifndef _MULTI_PLAYER_WORLD_H
7#define _MULTI_PLAYER_WORLD_H
8
9#include "game_world.h"
10
11
12class WorldEntity;
13class Camera;
14class Player;
15class GLMenuImageScreen;
16class Terrain;
17class TiXmlElement;
18
19class Shell;
20class OggPlayer;
21
22//! The multiplayer game world
23/**
24   this class initializes everything that should be displayed inside of the current level.
25   it is the main driving factor during gameplay.
26*/
27class MultiPlayerWorld : public GameWorld {
28
29 public:
30  MultiPlayerWorld (const TiXmlElement* root = NULL);
31  virtual ~MultiPlayerWorld ();
32
33  void loadParams(const TiXmlElement* root);
34
35  double getGameTime();
36
37  /* classes from story-entity */
38  virtual ErrorMessage preLoad();
39  virtual ErrorMessage load ();
40  virtual ErrorMessage postLoad();
41
42  virtual ErrorMessage preStart();
43  virtual ErrorMessage start ();
44  virtual ErrorMessage stop ();
45  virtual ErrorMessage pause ();
46  virtual ErrorMessage resume ();
47  virtual ErrorMessage destroy ();
48
49  void displayLoadScreen();
50  void releaseLoadScreen();
51
52  /* interface to world */
53//  void spawn (WorldEntity* entity);
54
55  /** @param speed sets the speed of the Game */
56  inline void setSpeed(float speed) { this->speed = speed; };
57  const char* getPath();
58  void setPath( const char* name);
59
60  void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
61  void toggleBVVisibility() { this->showBV = !this->showBV; };
62
63 private:
64  void constuctorInit(const char* name, int worldID);
65  /* function for main-loop */
66  void synchronize ();
67  void handleInput ();
68  void tick (std::list<WorldEntity*> worldEntity, float dt);
69  void tick ();
70  void update ();
71  void collide ();
72  void draw ();
73  void mainLoop ();
74
75  void display ();
76  void debug ();
77
78  private:
79    char* path;                         //!< The file from which this world is loaded
80
81    // FLAGS //
82    bool bQuitWorld;                    //!< quit only the current game and return to menu
83    bool bPause;                        //!< pause mode
84
85    bool showPNodes;                    //!< if the PNodes should be visible.
86    bool showBV;                        //!< if the Bounding Volumes should be visible.
87
88    // TIMING //
89    Uint32 lastFrame;                   //!< last time of frame
90    Uint32 cycle;                       //!< The cycle we are in (starts with 0 and rises with every frame)
91    Uint32 dt;                          //!< time needed to calculate this frame (in milliSeconds)
92    float dtS;                          //!< The time needed for caluculations in seconds
93    float speed;                        //!< how fast the game flows
94    double gameTime;                    //!< this is where the game time is saved
95
96    // INTERNAL ENGINES
97    ObjectManager objectManager;        //!< The ObjectManager of this World.
98    Shell*     shell;
99    OggPlayer* music;
100
101    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
102
103
104    // IMPORTANT ENTITIES
105    Camera* localCamera;                //!< The current Camera
106    Player* localPlayer;                //!< The Player, you fly through the level.
107
108    WorldEntity* sky;                   //!< The Environmental Heaven of orxonox @todo insert this to environment insted
109    Terrain* terrain;                   //!< The Terrain of the MultiPlayerWorld.
110};
111
112#endif /* _MULTI_PLAYER_WORLD_H */
Note: See TracBrowser for help on using the repository browser.