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 | #include "p_node.h" |
---|
12 | |
---|
13 | class TrackManager; |
---|
14 | class WorldEntity; |
---|
15 | class Camera; |
---|
16 | class PNode; |
---|
17 | class GLMenuImageScreen; |
---|
18 | class Skysphere; |
---|
19 | class Light; |
---|
20 | class FontSet; |
---|
21 | |
---|
22 | |
---|
23 | //! The game world |
---|
24 | /** |
---|
25 | this class initializes everything that should be displayed inside of the current level. |
---|
26 | it is the main driving factor during gameplay. |
---|
27 | */ |
---|
28 | class World : public StoryEntity { |
---|
29 | |
---|
30 | public: |
---|
31 | World (char* name); |
---|
32 | World (int worldID); |
---|
33 | virtual ~World (); |
---|
34 | |
---|
35 | |
---|
36 | /* classes from story-entity */ |
---|
37 | virtual ErrorMessage load (); |
---|
38 | virtual ErrorMessage init (); |
---|
39 | virtual ErrorMessage start (); |
---|
40 | virtual ErrorMessage stop (); |
---|
41 | virtual ErrorMessage pause (); |
---|
42 | virtual ErrorMessage resume (); |
---|
43 | virtual ErrorMessage destroy (); |
---|
44 | |
---|
45 | virtual void displayLoadScreen(); |
---|
46 | virtual void releaseLoadScreen(); |
---|
47 | |
---|
48 | /* command node functions */ |
---|
49 | bool command (Command* cmd); |
---|
50 | |
---|
51 | /* interface to world */ |
---|
52 | void spawn (WorldEntity* entity); |
---|
53 | void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); |
---|
54 | void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, |
---|
55 | parentingMode mode); |
---|
56 | |
---|
57 | |
---|
58 | private: |
---|
59 | void init(char* name, int worldID); |
---|
60 | |
---|
61 | Uint32 lastFrame; //!< last time of frame |
---|
62 | bool bQuitOrxonox; //!< quit this application |
---|
63 | bool bQuitCurrentGame; //!< quit only the current game and return to menu |
---|
64 | bool bPause; //!< pause mode |
---|
65 | |
---|
66 | FontSet* testFont; //!< A test Font. \todo fix this, so it is for real. |
---|
67 | GLMenuImageScreen* glmis; //!< The Level-Loader Display |
---|
68 | |
---|
69 | char* worldName; //!< The name of this World |
---|
70 | int debugWorldNr; //!< The Debug Nr. needed, if something goes wrong |
---|
71 | |
---|
72 | PNode* nullParent; //!< The zero-point, that everything has as its parent. |
---|
73 | TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level. |
---|
74 | Camera* localCamera; //!< The current Camera |
---|
75 | Skysphere* skySphere; //!< The Environmental Heaven of orxonox \todo insert this to environment insted |
---|
76 | Light* light; //!< The Lights of the Level |
---|
77 | |
---|
78 | GLuint objectList; //!< temporary: \todo this will be ereased soon |
---|
79 | tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them. |
---|
80 | WorldEntity* localPlayer; //!< The Player, you fly through the level. |
---|
81 | |
---|
82 | /* function for main-loop */ |
---|
83 | void mainLoop (); |
---|
84 | void synchronize (); |
---|
85 | void handleInput (); |
---|
86 | void tick (); |
---|
87 | void update (); |
---|
88 | void collide (); |
---|
89 | void draw (); |
---|
90 | void display (); |
---|
91 | void debug (); |
---|
92 | |
---|
93 | }; |
---|
94 | |
---|
95 | #endif /* _WORLD_H */ |
---|