Last change
on this file since 3729 was
3629,
checked in by patrick, 20 years ago
|
orxonox/trunk: some changes in the storyentity framework: added a preLoad() function, since there is some stuff to be initialized before load(). written some comments to level loading doxygen stuff. now the worldinterface works
|
File size:
1.8 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 | |
---|
| 13 | //----------------------------------------------------------------------------- |
---|
| 14 | // Forward declarations |
---|
| 15 | //----------------------------------------------------------------------------- |
---|
| 16 | class Campaign; |
---|
| 17 | class World; |
---|
| 18 | class Camera; |
---|
| 19 | class CammandNode; |
---|
| 20 | |
---|
[3629] | 21 | //! The GameLoader |
---|
| 22 | /** |
---|
| 23 | The game loader loads all game date. this is performed in the following way: |
---|
| 24 | 1. Read the structure of campaings and worlds |
---|
| 25 | 2. Create the instances of the tree: here _ALL_ StoryEntities are created |
---|
| 26 | also if they are not yet used. the worlds should load their data in |
---|
| 27 | the StoryEntity::load() and StoryEntity::init() functions! NOWHERE ELSE! |
---|
| 28 | Elsewhere, all the data will be allocated at the beginning... mess... |
---|
| 29 | 3. StoryEntities are load() and init() before they start |
---|
| 30 | 4. once the gamloader starts the game there will be a campaing starting a |
---|
| 31 | world. this is done by callaing those StoryEntity::start() |
---|
| 32 | */ |
---|
[2636] | 33 | class GameLoader |
---|
| 34 | { |
---|
| 35 | |
---|
| 36 | public: |
---|
| 37 | static GameLoader* getInstance(); |
---|
| 38 | |
---|
[3222] | 39 | ErrorMessage init(); |
---|
| 40 | ErrorMessage loadCampaign(char* name); |
---|
| 41 | ErrorMessage start(); |
---|
| 42 | ErrorMessage stop(); |
---|
| 43 | ErrorMessage pause(); |
---|
| 44 | ErrorMessage resume(); |
---|
[3225] | 45 | ErrorMessage destroy(); |
---|
[2636] | 46 | |
---|
| 47 | void nextLevel(); |
---|
| 48 | void previousLevel(); |
---|
| 49 | |
---|
| 50 | bool worldCommand(Command* cmd); |
---|
[3222] | 51 | ErrorMessage loadDebugCampaign(Uint32 campaignID); |
---|
[2636] | 52 | |
---|
| 53 | private: |
---|
| 54 | GameLoader (); |
---|
| 55 | ~GameLoader (); |
---|
| 56 | Uint32 startTime; //!> start time of the campaign |
---|
| 57 | static GameLoader* singletonRef; |
---|
| 58 | bool isPaused; |
---|
| 59 | |
---|
| 60 | Campaign* currentCampaign; //!> the current campaign playing |
---|
| 61 | |
---|
| 62 | Campaign* fileToCampaign(char* name); |
---|
| 63 | |
---|
| 64 | }; |
---|
| 65 | |
---|
[3224] | 66 | #endif /* _GAME_LOADER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.