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