Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/ll2trunktemp/src/game_loader.h @ 4003

Last change on this file since 4003 was 3940, checked in by chris, 19 years ago

orxonox/branches/ll2trunktemp: I tried… Not working…

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// Forward declarations
15//-----------------------------------------------------------------------------
16class Campaign;
17class World;
18class Camera;
19class CammandNode;
20
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*/
33class GameLoader
34{
35
36 public:
37  static GameLoader* getInstance();
38
39  ErrorMessage init();
40  ErrorMessage loadCampaign(char* name);
41  ErrorMessage start();
42  ErrorMessage stop();
43  ErrorMessage pause();
44  ErrorMessage resume();
45  ErrorMessage destroy();
46
47  void nextLevel();
48  void previousLevel();
49
50  bool worldCommand(Command* cmd);
51  ErrorMessage loadDebugCampaign(Uint32 campaignID);
52 
53  void registerFactory( Factory* factory);
54  BaseObject* fabricate( TiXmlElement* data);
55
56 private:
57  GameLoader ();
58  ~GameLoader ();
59  Uint32 startTime; //!> start time of the campaign
60  static GameLoader* singletonRef;
61  bool isPaused;
62
63  Campaign* currentCampaign; //!> the current campaign playing
64 
65  Campaign* fileToCampaign(char* name);
66
67  Factory* first;
68};
69
70#endif /* _GAME_LOADER_H */
Note: See TracBrowser for help on using the repository browser.