Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/story_entities/world.h @ 6150

Last change on this file since 6150 was 6150, checked in by bensch, 18 years ago

orxonox/trunk: cleanup of the world begin

File size: 3.3 KB
RevLine 
[4558]1/*!
[5039]2 * @file world.h
[4836]3  *  Holds and manages all game data
[4558]4*/
[1853]5
[3224]6#ifndef _WORLD_H
7#define _WORLD_H
[1853]8
[2190]9#include "stdincl.h"
[3608]10#include "comincl.h"
[2636]11#include "story_entity.h"
[3521]12#include "p_node.h"
[6142]13#include "object_manager.h"
[2190]14
[6142]15
[3620]16class WorldEntity;
[3634]17class Camera;
[4396]18class Player;
[3634]19class GLMenuImageScreen;
20class Terrain;
[4261]21class TiXmlElement;
[3790]22
[5206]23class Shell;
[4961]24class OggPlayer;
[3620]25
[3449]26//! The game world
27/**
28   this class initializes everything that should be displayed inside of the current level.
29   it is the main driving factor during gameplay.
30*/
[2636]31class World : public StoryEntity {
[1853]32
33 public:
[4261]34  World (const TiXmlElement* root = NULL);
[3221]35  virtual ~World ();
[3459]36
[4261]37  void loadParams(const TiXmlElement* root);
38
[3646]39  double getGameTime();
[3459]40
41  /* classes from story-entity */
[3629]42  virtual ErrorMessage preLoad();
[3459]43  virtual ErrorMessage load ();
[3225]44  virtual ErrorMessage init ();
45  virtual ErrorMessage start ();
46  virtual ErrorMessage stop ();
47  virtual ErrorMessage pause ();
48  virtual ErrorMessage resume ();
[3459]49  virtual ErrorMessage destroy ();
[1917]50
[3459]51  virtual void displayLoadScreen();
52  virtual void releaseLoadScreen();
[4558]53
[3461]54  /* command node functions */
[3225]55  bool command (Command* cmd);
[3459]56
[3461]57  /* interface to world */
[3225]58  void spawn (WorldEntity* entity);
[2644]59
[5205]60  /** @param speed sets the speed of the Game */
61  inline void setSpeed(float speed) { this->speed = speed; };
[4010]62  const char* getPath();
63  void setPath( const char* name);
[3461]64
[5389]65  void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
[5429]66  void toggleBVVisibility() { this->showBV = !this->showBV; };
[5389]67
[3461]68 private:
[4978]69  void constuctorInit(const char* name, int worldID);
[3462]70  /* function for main-loop */
[3225]71  void synchronize ();
[3226]72  void handleInput ();
[6142]73  void tick (std::list<WorldEntity*> worldEntity, float dt);
[3551]74  void tick ();
75  void update ();
[3459]76  void collide ();
[3461]77  void draw ();
[6150]78  void mainLoop ();
79
[3225]80  void display ();
81  void debug ();
[3365]82
[5389]83  private:
[6150]84    char* path;                         //!< The file from which this world is loaded
85
[5389]86    bool   showPNodes;                  //!< if the PNodes should be visible.
[5429]87    bool   showBV;                      //!< if the Bounding Volumes should be visible.
[6150]88
[5389]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    bool bQuitOrxonox;                  //!< quit this application
96    bool bQuitCurrentGame;              //!< quit only the current game and return to menu
97    bool bPause;                        //!< pause mode
98
[6142]99    ObjectManager      objectManager;   //!< The ObjectManager of this World.
100
[5389]101    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
102
103    Shell*     shell;
104    OggPlayer* music;
105
106  // IMPORTANT WORLD-ENTITIES
107    Camera* localCamera;                //!< The current Camera
108    WorldEntity* sky;                   //!< The Environmental Heaven of orxonox @todo insert this to environment insted
109    Terrain* terrain;                   //!< The Terrain of the World.
110
111    Player* localPlayer;                //!< The Player, you fly through the level.
[2190]112};
[1883]113
[3224]114#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.