Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/story_entities/game_world.h @ 6464

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

orxonox/trunk: merged the branche network back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/network . -r 6351:HEAD
no conflicts

File size: 3.0 KB
Line 
1/*!
2 * @file game_world.h
3 *  container for all game worlds (singleplayers, multiplayers..)
4 */
5
6#ifndef _GAME_WORLD_H
7#define _GAME_WORLD_H
8
9
10#include "story_entity.h"
11
12
13class TiXmlElement;
14class Shell;
15class WorldEntity;
16class GameWorldData;
17
18
19//! The game world
20/**
21 *  this class initializes everything that should be displayed inside of the current level.
22 *  it is the main driving factor during gameplay.
23 */
24class GameWorld : public StoryEntity
25{
26
27  public:
28    GameWorld (const TiXmlElement* root = NULL);
29    virtual ~GameWorld ();
30
31    void loadParams(const TiXmlElement* root);
32
33    /* functions from story-entity */
34    virtual ErrorMessage init();
35    virtual ErrorMessage loadData();
36    virtual ErrorMessage unloadData();
37
38    virtual bool start();
39    virtual bool stop();
40    virtual bool pause();
41    virtual bool resume();
42    virtual void run();
43
44    /**  this returns the current game time @returns elapsed game time     */
45    inline double getGameTime() { return this->gameTime; }
46    /** sets the game speed @param speed speed of the Game */
47    inline void setSpeed(float speed) { this->speed = speed; };
48    /**  returns the track path of this world @returns the track path */
49    const char* getPath() { return this->path; }
50    void setPath( const char* name);
51
52    /** toggles the PNode visibility in the world (drawn as boxes) */
53    void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
54    /** toggles the bounding volume (BV) visibility */
55    void toggleBVVisibility() { this->showBV = !this->showBV; };
56
57
58  protected:
59    /* world - running functions */
60    virtual void synchronize();
61    virtual void handleInput();
62    virtual void tick(std::list<WorldEntity*> worldEntity, float dt);
63    virtual void tick();
64    virtual void update();
65    virtual void collide();
66    virtual void draw();
67    virtual void display();
68
69
70  private:
71    void displayLoadScreen();
72    void releaseLoadScreen();
73
74
75  protected:
76    GameWorldData*      dataTank;                     //!< reference to the GameWorld Data Tank
77    char*               path;                         //!< The file from which this world is loaded
78
79    bool                showPNodes;                   //!< if the PNodes should be visible.
80    bool                showBV;                       //!< if the Bounding Volumes should be visible.
81
82    /* world timing */
83    Uint32              lastFrame;                    //!< last time of frame
84    Uint32              cycle;                        //!< The cycle we are in (starts with 0 and rises with every frame)
85    Uint32              dt;                           //!< time needed to calculate this frame (in milliSeconds)
86    float               dtS;                          //!< The time needed for caluculations in seconds
87    float               speed;                        //!< how fast the game flows
88    double              gameTime;                     //!< this is where the game time is saved
89
90    /* external modules interfaces */
91    Shell*              shell;
92};
93
94#endif /* _GAME_WORLD_H */
Note: See TracBrowser for help on using the repository browser.