Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/textEngine/src/story_entities/world.h @ 3766

Last change on this file since 3766 was 3766, checked in by bensch, 19 years ago

orxonox/branches/textEngine: moved the fonts into a new File textEngine, and also implemented a TextEngine-Singleton-class

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