Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/loading/game_loader.h @ 4398

Last change on this file since 4398 was 4262, checked in by bensch, 20 years ago

orxonox/trunk: moved around some files, and deleted the obsolete DataTank

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;
21class Factory;
22class TiXmlElement;
23class BaseObject;
24
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*/
37class GameLoader
38{
39
40 public:
41  static GameLoader* getInstance();
42
43  ErrorMessage init();
44  ErrorMessage loadCampaign(const char* name);
45  ErrorMessage start();
46  ErrorMessage stop();
47  ErrorMessage pause();
48  ErrorMessage resume();
49  ErrorMessage destroy();
50
51  void nextLevel();
52  void previousLevel();
53
54  bool worldCommand(Command* cmd);
55  ErrorMessage loadDebugCampaign(Uint32 campaignID);
56 
57  void registerFactory( Factory* factory);
58  BaseObject* fabricate( TiXmlElement* data);
59
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 
69  Campaign* fileToCampaign(const char* name);
70
71  Factory* first;
72};
73
74#endif /* _GAME_LOADER_H */
Note: See TracBrowser for help on using the repository browser.