Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3629 was 3629, checked in by patrick, 19 years ago

orxonox/trunk: some changes in the storyentity framework: added a preLoad() function, since there is some stuff to be initialized before load(). written some comments to level loading doxygen stuff. now the worldinterface works

File size: 3.6 KB
Line 
1/*!
2    \file world.h
3    \brief Holds and manages all game data
4*/ 
5
6#ifndef _WORLD_H
7#define _WORLD_H
8
9#include "stdincl.h"
10#include "comincl.h"
11#include "story_entity.h"
12#include "p_node.h"
13
14
15class World;
16class WorldEntity;
17
18//! The game world Interface
19/**
20   this is a singleton interface, that enables world_entities to access the
21   world. for those objects, there is no easier way than over this interface!
22*/
23class WorldInterface : BaseObject {
24
25 public:
26  ~WorldInterface();
27  static WorldInterface* getInstance();
28  void init(World* world);
29  tList<WorldEntity>* getEntityList();
30
31 private:
32  WorldInterface();
33  static WorldInterface* singletonRef;    //!< singleton reference to this object
34  bool worldIsInitialized;                //!< true if the world has been initialized
35  World* worldReference;                  //!< this is a reference to the running world
36
37};
38
39
40class TrackManager;
41class Camera;
42class PNode;
43class GLMenuImageScreen;
44class Skysphere;
45class LightManager;
46class FontSet;
47class Terrain;
48
49
50//! The game world
51/**
52   this class initializes everything that should be displayed inside of the current level.
53   it is the main driving factor during gameplay.
54*/
55class World : public StoryEntity {
56
57 public:
58  World (char* name);
59  World (int worldID);
60  virtual ~World ();
61
62
63  /* classes from story-entity */
64  virtual ErrorMessage preLoad();
65  virtual ErrorMessage load ();
66  virtual ErrorMessage init ();
67  virtual ErrorMessage start ();
68  virtual ErrorMessage stop ();
69  virtual ErrorMessage pause ();
70  virtual ErrorMessage resume ();
71  virtual ErrorMessage destroy ();
72
73  virtual void displayLoadScreen();
74  virtual void releaseLoadScreen();
75 
76  /* command node functions */
77  bool command (Command* cmd);
78
79  tList<WorldEntity>* getEntities();
80
81  /* interface to world */
82  void spawn (WorldEntity* entity);
83  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
84  void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, 
85             int parentingMode);
86
87
88 private:
89  void init(char* name, int worldID);
90
91  Uint32 lastFrame;             //!< last time of frame
92  bool bQuitOrxonox;            //!< quit this application
93  bool bQuitCurrentGame;        //!< quit only the current game and return to menu
94  bool bPause;                  //!< pause mode
95
96  FontSet* testFont;            //!< A test Font. \todo fix this, so it is for real.
97  GLMenuImageScreen* glmis;     //!< The Level-Loader Display
98
99  char* worldName;              //!< The name of this World
100  int debugWorldNr;             //!< The Debug Nr. needed, if something goes wrong
101
102  PNode* nullParent;            //!< The zero-point, that everything has as its parent.
103  TrackManager* trackManager;   //!< The reference of the TrackManager that handles the course through the Level.
104  Camera* localCamera;          //!< The current Camera
105  Skysphere* skySphere;         //!< The Environmental Heaven of orxonox \todo insert this to environment insted
106  LightManager* lightMan;       //!< The Lights of the Level
107  Terrain* terrain;             //!< The Terrain of the World.
108
109  GLuint objectList;            //!< temporary: \todo this will be ereased soon
110  tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
111  WorldEntity* localPlayer;     //!< The Player, you fly through the level.
112 
113  /* function for main-loop */
114  void mainLoop ();
115  void synchronize ();
116  void handleInput ();
117  void tick ();
118  void update ();
119  void collide ();
120  void draw ();
121  void display ();
122  void debug ();
123
124};
125
126#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.