Last change
on this file since 5045 was
4122,
checked in by bensch, 20 years ago
|
orxonox/branches/heightMap: merged the Trunk back into branches/heightMap:
merged with Command
svn merge -r 3918:HEAD trunk branches/heightMap
conflicts resolved in favor of the Trunk
|
File size:
1.9 KB
|
Rev | Line | |
---|
[3629] | 1 | /*! |
---|
| 2 | \file game_loader.h |
---|
| 3 | \brief loads campaigns, worlds and all other story_entities |
---|
| 4 | */ |
---|
| 5 | |
---|
[3224] | 6 | #ifndef _GAME_LOADER_H |
---|
| 7 | #define _GAME_LOADER_H |
---|
[2636] | 8 | |
---|
[3608] | 9 | //#include "stdincl.h" |
---|
[2636] | 10 | #include "story_def.h" |
---|
[3608] | 11 | #include "comincl.h" |
---|
[2636] | 12 | |
---|
[4122] | 13 | |
---|
[2636] | 14 | //----------------------------------------------------------------------------- |
---|
| 15 | // Forward declarations |
---|
| 16 | //----------------------------------------------------------------------------- |
---|
| 17 | class Campaign; |
---|
| 18 | class World; |
---|
| 19 | class Camera; |
---|
| 20 | class CammandNode; |
---|
| 21 | |
---|
[3629] | 22 | //! The GameLoader |
---|
| 23 | /** |
---|
| 24 | The game loader loads all game date. this is performed in the following way: |
---|
| 25 | 1. Read the structure of campaings and worlds |
---|
| 26 | 2. Create the instances of the tree: here _ALL_ StoryEntities are created |
---|
| 27 | also if they are not yet used. the worlds should load their data in |
---|
| 28 | the StoryEntity::load() and StoryEntity::init() functions! NOWHERE ELSE! |
---|
| 29 | Elsewhere, all the data will be allocated at the beginning... mess... |
---|
| 30 | 3. StoryEntities are load() and init() before they start |
---|
| 31 | 4. once the gamloader starts the game there will be a campaing starting a |
---|
| 32 | world. this is done by callaing those StoryEntity::start() |
---|
| 33 | */ |
---|
[2636] | 34 | class GameLoader |
---|
| 35 | { |
---|
| 36 | |
---|
| 37 | public: |
---|
| 38 | static GameLoader* getInstance(); |
---|
| 39 | |
---|
[3222] | 40 | ErrorMessage init(); |
---|
| 41 | ErrorMessage loadCampaign(char* name); |
---|
| 42 | ErrorMessage start(); |
---|
| 43 | ErrorMessage stop(); |
---|
| 44 | ErrorMessage pause(); |
---|
| 45 | ErrorMessage resume(); |
---|
[3225] | 46 | ErrorMessage destroy(); |
---|
[2636] | 47 | |
---|
| 48 | void nextLevel(); |
---|
| 49 | void previousLevel(); |
---|
| 50 | |
---|
| 51 | bool worldCommand(Command* cmd); |
---|
[3222] | 52 | ErrorMessage loadDebugCampaign(Uint32 campaignID); |
---|
[2636] | 53 | |
---|
[4122] | 54 | void registerFactory( Factory* factory); |
---|
| 55 | BaseObject* fabricate( TiXmlElement* data); |
---|
| 56 | |
---|
[2636] | 57 | private: |
---|
| 58 | GameLoader (); |
---|
| 59 | ~GameLoader (); |
---|
| 60 | Uint32 startTime; //!> start time of the campaign |
---|
| 61 | static GameLoader* singletonRef; |
---|
| 62 | bool isPaused; |
---|
| 63 | |
---|
| 64 | Campaign* currentCampaign; //!> the current campaign playing |
---|
| 65 | |
---|
[4122] | 66 | Campaign* fileToCampaign(const char* name); |
---|
[2636] | 67 | |
---|
[4122] | 68 | Factory* first; |
---|
[2636] | 69 | }; |
---|
| 70 | |
---|
[3224] | 71 | #endif /* _GAME_LOADER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.