Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/brnaches/textEngine: working with some default text, but far from finished

File size: 3.9 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 FontSet;
24class GLFont;
25class Terrain;
26class GarbageCollector;
27
28//! The game world Interface
29/**
30   this is a singleton interface, that enables world_entities to access the
31   world. for those objects, there is no easier way than over this interface!
32*/
33class WorldInterface : BaseObject {
34
35 public:
36  ~WorldInterface();
37  static WorldInterface* getInstance();
38  void init(World* world);
39  tList<WorldEntity>* getEntityList();
40
41 private:
42  WorldInterface();
43  static WorldInterface* singletonRef;    //!< singleton reference to this object
44  bool worldIsInitialized;                //!< true if the world has been initialized
45  World* worldReference;                  //!< this is a reference to the running world
46
47};
48
49//! The game world
50/**
51   this class initializes everything that should be displayed inside of the current level.
52   it is the main driving factor during gameplay.
53*/
54class World : public StoryEntity {
55
56 public:
57  World (char* name);
58  World (int worldID);
59  virtual ~World ();
60
61  double getGameTime();
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  Uint32 dt;                    //!< time needed to calculate this frame
93  double gameTime;              //!< this is where the game time is saved
94  bool bQuitOrxonox;            //!< quit this application
95  bool bQuitCurrentGame;        //!< quit only the current game and return to menu
96  bool bPause;                  //!< pause mode
97
98  FontSet* testFont;            //!< A test Font. \todo fix this, so it is for real.
99  GLFont* tmpFont;              //!< tmpFont \todo fix
100  GLMenuImageScreen* glmis;     //!< The Level-Loader Display
101
102  char* worldName;              //!< The name of this World
103  int debugWorldNr;             //!< The Debug Nr. needed, if something goes wrong
104
105  PNode* nullParent;            //!< The zero-point, that everything has as its parent.
106  TrackManager* trackManager;   //!< The reference of the TrackManager that handles the course through the Level.
107  Camera* localCamera;          //!< The current Camera
108  Skysphere* skySphere;         //!< The Environmental Heaven of orxonox \todo insert this to environment insted
109  LightManager* lightMan;       //!< The Lights of the Level
110  Terrain* terrain;             //!< The Terrain of the World.
111
112  GLuint objectList;            //!< temporary: \todo this will be ereased soon
113  tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
114  WorldEntity* localPlayer;     //!< The Player, you fly through the level.
115
116  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
117 
118  /* function for main-loop */
119  void mainLoop ();
120  void synchronize ();
121  void handleInput ();
122  void tick ();
123  void update ();
124  void collide ();
125  void draw ();
126  void display ();
127  void debug ();
128
129};
130
131#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.