Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/levelloader/src/game_loader.h @ 3791

Last change on this file since 3791 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
Line 
1/*!
2    \file game_loader.h
3    \brief loads campaigns, worlds and all other story_entities
4*/ 
5
6#ifndef _GAME_LOADER_H
7#define _GAME_LOADER_H
8
9//#include "stdincl.h"
10#include "story_def.h"
11#include "factory.h"
12#include "comincl.h"
13#include "error.h"
14
15//-----------------------------------------------------------------------------
16// Forward declarations
17//-----------------------------------------------------------------------------
18class Campaign;
19class World;
20class Camera;
21class CammandNode;
22
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*/
35class GameLoader
36{
37
38 public:
39  static GameLoader* getInstance();
40
41  ErrorMessage init();
42  ErrorMessage loadCampaign(char* name);
43  ErrorMessage start();
44  ErrorMessage stop();
45  ErrorMessage pause();
46  ErrorMessage resume();
47  ErrorMessage destroy();
48
49  void nextLevel();
50  void previousLevel();
51
52  bool worldCommand(Command* cmd);
53  ErrorMessage loadDebugCampaign(Uint32 campaignID);
54 
55  void registerFactory( Factory* factory);
56  BaseObject* fabricate( TiXmlElement* data);
57 
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
69  Factory* first;
70};
71
72#endif /* _GAME_LOADER_H */
Note: See TracBrowser for help on using the repository browser.