Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6299 was 6152, checked in by bensch, 19 years ago

orxonox/trunk: some work in the loading process of worlds

File size: 2.2 KB
RevLine 
[4598]1/*!
[4885]2 * @file game_loader.h
3 *  loads campaigns, worlds and all other story_entities
[4598]4*/
[3629]5
[3224]6#ifndef _GAME_LOADER_H
7#define _GAME_LOADER_H
[2636]8
[3608]9//#include "stdincl.h"
[2636]10#include "story_def.h"
[3608]11#include "comincl.h"
[4410]12#include "event_listener.h"
[2636]13
[5819]14#include "error.h"
[4010]15
[2636]16//-----------------------------------------------------------------------------
17// Forward declarations
18//-----------------------------------------------------------------------------
19class Campaign;
20class World;
[4261]21class Factory;
22class TiXmlElement;
23class BaseObject;
[4410]24class Event;
[4411]25class EventHandler;
[2636]26
[3629]27//! The GameLoader
28/**
[6152]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()
[3629]38*/
[4410]39class GameLoader : public EventListener
[2636]40{
41 public:
[4487]42  ~GameLoader ();
43
[2636]44  static GameLoader* getInstance();
45
[3222]46  ErrorMessage init();
47  ErrorMessage start();
[5139]48  void stop();
[3222]49  ErrorMessage pause();
50  ErrorMessage resume();
[3225]51  ErrorMessage destroy();
[2636]52
[6139]53  ErrorMessage loadCampaign(const char* name);
54  ErrorMessage loadDebugCampaign(Uint32 campaignID);
55  ErrorMessage loadNetworkCampaign(const char* fileName);
56
[2636]57  void nextLevel();
58  void previousLevel();
59
[4410]60  void process(const Event &event);
61
[6139]62
[2636]63 private:
64  GameLoader ();
65
[4113]66  Campaign* fileToCampaign(const char* name);
[6139]67  Campaign* fileToNetworkCampaign(const char* fileName);
[2636]68
[6139]69
[4487]70 private:
71  static GameLoader*     singletonRef;         //!< The singleton-reference to this object
72
73  Uint32                 startTime;            //!< start time of the campaign
74  bool                   isPaused;             //!< if the game is paused
75
[4511]76  Campaign*              currentCampaign;      //!< reference to the current campaign playing
[4598]77
[4487]78  EventHandler*          eventHandler;         //!< reference to the eventHandler
[2636]79};
80
[3224]81#endif /* _GAME_LOADER_H */
Note: See TracBrowser for help on using the repository browser.