Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/parenting/src/world.h @ 3306

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

orxonox/branches/parenting: modified function passing routines - now having two lists: parenting list (tree) and entity list (array), that coexist - this is the only possibility to keep oversight.

File size: 1.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 "story_entity.h"
11
12
13
14class Track;
15class WorldEntity;
16class Camera;
17class PNode;
18
19//! The game environment
20class World : public StoryEntity {
21
22 public:
23  World (char* name);
24  World (int worldID);
25  virtual ~World ();
26
27  template<typename T> 
28    T* spawn (Location* loc, WorldEntity* owner);       // template to be able to spawn any derivation of WorldEntity
29  template<typename T> 
30    T* spawn (Placement* plc, WorldEntity* owner);
31 
32  virtual ErrorMessage init ();
33  virtual ErrorMessage start ();
34  virtual ErrorMessage stop ();
35  virtual ErrorMessage pause ();
36  virtual ErrorMessage resume ();
37
38  virtual void load ();
39  virtual void destroy ();
40
41  void timeSlice (Uint32 deltaT);
42  void collide ();
43  void draw ();
44  void update ();       // maps Locations to Placements
45  void calcCameraPos (Location* loc, Placement* plc);
46       
47  void unload ();
48  bool command (Command* cmd);
49 
50  void setTrackLen (Uint32 tracklen);
51  int getTrackLen ();
52  //bool system_command (Command* cmd);
53  Camera* getCamera ();
54
55  void spawn (WorldEntity* entity);
56  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
57
58  tList<WorldEntity>* entities;
59 
60  // base level data
61  Track* track;
62  Uint32 tracklen;   // number of Tracks the World consist of
63  Vector* pathnodes;
64  Camera* localCamera; 
65
66 private:
67  Uint32 lastFrame; //!> last time of frame
68  bool bQuitOrxonox; //!> quit this application
69  bool bQuitCurrentGame; //!> quit only the current game and return to menu
70  bool bPause;
71
72  char* worldName;
73  int debugWorldNr;
74  GLuint objectList;
75
76  WorldEntity* localPlayer;
77 
78  PNode* nullParent;
79 
80  void mainLoop ();
81  void synchronize ();
82  void handleInput ();
83  void timeSlice ();
84  void collision ();
85  void display ();
86  void debug ();
87};
88
89#endif /* _WORLD_H */
Note: See TracBrowser for help on using the repository browser.