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