Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/game_loader.h @ 4040

Last change on this file since 4040 was 4010, checked in by bensch, 20 years ago

orxonox/trunk: merged the levelloader from lltrunktemp to the trunk. Big thanks to fuzzy to make this so easy for us, and for implementing it in the first place.

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 "comincl.h"
12
13
14//-----------------------------------------------------------------------------
15// Forward declarations
16//-----------------------------------------------------------------------------
17class Campaign;
18class World;
19class Camera;
20class CammandNode;
21
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*/
34class GameLoader
35{
36
37 public:
38  static GameLoader* getInstance();
39
40  ErrorMessage init();
41  ErrorMessage loadCampaign(char* name);
42  ErrorMessage start();
43  ErrorMessage stop();
44  ErrorMessage pause();
45  ErrorMessage resume();
46  ErrorMessage destroy();
47
48  void nextLevel();
49  void previousLevel();
50
51  bool worldCommand(Command* cmd);
52  ErrorMessage loadDebugCampaign(Uint32 campaignID);
53 
54  void registerFactory( Factory* factory);
55  BaseObject* fabricate( TiXmlElement* data);
56
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 
66  Campaign* fileToCampaign(char* name);
67
68  Factory* first;
69};
70
71#endif /* _GAME_LOADER_H */
Note: See TracBrowser for help on using the repository browser.