Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4410 was 4410, checked in by patrick, 19 years ago

orxonox/trunk: prepeared to implement all system wide commands

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