Index: branches/network/src/util/loading/game_loader.cc
===================================================================
--- branches/network/src/util/loading/game_loader.cc	(revision 5973)
+++ branches/network/src/util/loading/game_loader.cc	(revision 5974)
@@ -37,6 +37,6 @@
 
 SHELL_COMMAND(quit, GameLoader, stop)
-    ->describe("quits the game")
-    ->setAlias("orxoquit");
+->describe("quits the game")
+->setAlias("orxoquit");
 
 
@@ -67,4 +67,35 @@
 
 
+/**
+ *  load a StoryEntity
+ * @param element a XMLElement containing all the needed info
+ */
+BaseObject* GameLoader::fabricate(const TiXmlElement* element)
+{
+  assert( element != NULL);
+
+  if( Factory::getFirst() == NULL)
+  {
+    PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
+    return NULL;
+  }
+
+  if( element->Value() != NULL)
+  {
+    PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
+    BaseObject* b = Factory::getFirst()->fabricate( element);
+    if( b == NULL)
+      PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
+    else
+      PRINTF(4)("Successfully fabricated a '%s'\n", element->Value());
+    return b;
+  }
+
+  PRINTF(2)("Fabricate failed, TiElement did not contain a value\n");
+
+  return NULL;
+}
+
+
 
 /**
@@ -73,13 +104,12 @@
 ErrorMessage GameLoader::init()
 {
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->init();
 
-  this->eventHandler = EventHandler::getInstance();
-  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_PAUSE);
-  this->eventHandler->subscribe(this, ES_ALL, EV_MAIN_QUIT);          //< External Quit Event
-  this->eventHandler->subscribe(this, ES_ALL, KeyMapper::PEV_QUIT);
-  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_NEXT_WORLD);
-  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_PREVIOUS_WORLD);
+  EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_PAUSE);
+  EventHandler::getInstance()->subscribe(this, ES_ALL, EV_MAIN_QUIT);          //< External Quit Event
+  EventHandler::getInstance()->subscribe(this, ES_ALL, KeyMapper::PEV_QUIT);
+  EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_NEXT_WORLD);
+  EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_PREVIOUS_WORLD);
 }
 
@@ -97,12 +127,9 @@
   ErrorMessage errorCode;
   char* campaignName = ResourceManager::getFullName(fileName);
-  if (campaignName)
-    {
-      this->currentCampaign = this->fileToCampaign(campaignName);
-      delete[] campaignName;
-    }
-//   World* world0 = new World(DEBUG_WORLD_0);
-//   world0->setNextStoryID(WORLD_ID_GAMEEND);
-//   this->currentCampaign->addEntity(world0, WORLD_ID_2);
+  if( campaignName)
+  {
+    this->currentCampaign = this->fileToCampaign(campaignName);
+    delete[] campaignName;
+  }
 }
 
@@ -116,5 +143,5 @@
  * this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
  */
-ErrorMessage loadNetworkCampaign(const char* name)
+ErrorMessage GameLoader::loadNetworkCampaign(const char* name)
 {}
 
@@ -128,6 +155,6 @@
 ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID)
 {
-  switch(campaignID)
-    {
+  switch( campaignID)
+  {
       /*
          Debug Level 0: Debug level used to test the base frame work.
@@ -155,5 +182,5 @@
         break;
       }
-    }
+  }
 }
 
@@ -165,5 +192,5 @@
 ErrorMessage GameLoader::start()
 {
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->start();
 }
@@ -182,5 +209,5 @@
 void GameLoader::stop()
 {
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->stop();
 }
@@ -196,5 +223,5 @@
 {
   this->isPaused = true;
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->pause();
 }
@@ -210,5 +237,5 @@
 {
   this->isPaused = false;
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->resume();
 }
@@ -220,5 +247,4 @@
 ErrorMessage GameLoader::destroy()
 {
-
 }
 
@@ -239,18 +265,18 @@
 
   if( fileName == NULL)
-    {
-      PRINTF(2)("No filename specified for loading");
-      return NULL;
-    }
+  {
+    PRINTF(2)("No filename specified for loading");
+    return NULL;
+  }
 
   TiXmlDocument* XMLDoc = new TiXmlDocument( fileName);
   // load the campaign document
   if( !XMLDoc->LoadFile())
-    {
-      // report an error
-      PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-      delete XMLDoc;
-      return NULL;
-    }
+  {
+    // report an error
+    PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
+    delete XMLDoc;
+    return NULL;
+  }
 
   // check basic validity
@@ -259,10 +285,10 @@
 
   if( strcmp( root->Value(), "Campaign"))
-    {
-      // report an error
-      PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
-      delete XMLDoc;
-      return NULL;
-    }
+  {
+    // report an error
+    PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
+    delete XMLDoc;
+    return NULL;
+  }
 
   // construct campaign
@@ -332,35 +358,7 @@
 void GameLoader::previousLevel()
 {
-  if(this->currentCampaign != NULL)
+  if( this->currentCampaign != NULL)
     this->currentCampaign->previousLevel();
 }
 
-/**
- *  load a StoryEntity
- * @param element a XMLElement containing all the needed info
- */
-BaseObject* GameLoader::fabricate(const TiXmlElement* element)
-{
-  assert( element != NULL);
-
-  if( Factory::getFirst() == NULL)
-    {
-      PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
-      return NULL;
-    }
-
-  if( element->Value() != NULL)
-    {
-      PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
-      BaseObject* b = Factory::getFirst()->fabricate( element);
-      if( b == NULL)
-        PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
-      else
-        PRINTF(4)("Successfully fabricated a '%s'\n", element->Value());
-      return b;
-    }
-
-  PRINTF(2)("Fabricate failed, TiElement did not contain a value\n");
-
-  return NULL;
-}
+
Index: branches/network/src/util/loading/game_loader.h
===================================================================
--- branches/network/src/util/loading/game_loader.h	(revision 5973)
+++ branches/network/src/util/loading/game_loader.h	(revision 5974)
@@ -40,5 +40,5 @@
 {
 
-  
+
  public:
   ~GameLoader ();
@@ -46,4 +46,7 @@
   /**  this class is a singleton class @returns an instance of itself  */
   static GameLoader* getInstance() { if(singletonRef == NULL) singletonRef = new GameLoader();  return singletonRef; }
+
+  void registerFactory( Factory* factory );
+  BaseObject* fabricate(const TiXmlElement* data);
 
   ErrorMessage init();
@@ -54,18 +57,14 @@
   ErrorMessage destroy();
 
+  ErrorMessage loadDebugCampaign(Uint32 campaignID);
+  ErrorMessage loadCampaign(const char* name);
+  ErrorMessage loadNetworkCampaign(const char* name);
+
+  void process(const Event &event);
+
   void nextLevel();
   void previousLevel();
 
-  ErrorMessage loadDebugCampaign(Uint32 campaignID);
-  ErrorMessage loadCampaign(const char* name);
-  ErrorMessage loadNetworkCampaign(const char* name);
-  
 
-  void registerFactory( Factory* factory );
-  BaseObject* fabricate(const TiXmlElement* data);
-
-  void process(const Event &event);
-
-  
  private:
   GameLoader ();
@@ -73,14 +72,10 @@
   Campaign* fileToCampaign(const char* name);
 
-  
+
  private:
   static GameLoader*     singletonRef;         //!< The singleton-reference to this object
-
-  Uint32                 startTime;            //!< start time of the campaign
-  bool                   isPaused;             //!< if the game is paused
-
   Campaign*              currentCampaign;      //!< reference to the current campaign playing
 
-  EventHandler*          eventHandler;         //!< reference to the eventHandler
+  bool                   isPaused;             //!< if the game is paused
 };
 
