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