Index: branches/network/src/defs/class_id.h
===================================================================
--- branches/network/src/defs/class_id.h	(revision 6357)
+++ branches/network/src/defs/class_id.h	(revision 6358)
@@ -147,6 +147,7 @@
   // StoryEntities (range from 0x00000100 to 0x000001ff)
   CL_CAMPAIGN                   =    0x00000101,
-  CL_WORLD                      =    0x00000102,
-
+  CL_GAME_WORLD                 =    0x00000102,
+  CL_SINGLE_PLAYER_WORLD        =    0x00000103,
+  CL_MULTI_PLAYER_WORLD         =    0x00000104,
 
   // WorldEntities (range from 0x00000200 to 0x000004ff)
Index: branches/network/src/story_entities/game_world.cc
===================================================================
--- branches/network/src/story_entities/game_world.cc	(revision 6357)
+++ branches/network/src/story_entities/game_world.cc	(revision 6358)
@@ -17,5 +17,5 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
 
-#include "world.h"
+#include "game_world.h"
 
 #include "shell_command.h"
@@ -70,14 +70,16 @@
 
 
-SHELL_COMMAND(speed, World, setSpeed);
-SHELL_COMMAND(togglePNodeVisibility, World, togglePNodeVisibility);
-SHELL_COMMAND(toggleBVVisibility, World, toggleBVVisibility);
+SHELL_COMMAND(speed, GameWorld, setSpeed);
+SHELL_COMMAND(togglePNodeVisibility, GameWorld, togglePNodeVisibility);
+SHELL_COMMAND(toggleBVVisibility, GameWorld, toggleBVVisibility);
 
 using namespace std;
 
-//! This creates a Factory to fabricate a World
-CREATE_FACTORY(World, CL_WORLD);
-
-World::World(const TiXmlElement* root)
+//! This creates a Factory to fabricate a GameWorld
+CREATE_FACTORY(GameWorld, CL_GAME_WORLD);
+
+
+
+GameWorld::GameWorld(const TiXmlElement* root)
 {
   this->constuctorInit("", -1);
@@ -88,13 +90,13 @@
 
 /**
- *  remove the World from memory
+ *  remove the GameWorld from memory
  *
  *  delete everything explicitly, that isn't contained in the parenting tree!
  *  things contained in the tree are deleted automaticaly
  */
-World::~World ()
+GameWorld::~GameWorld ()
 {
   delete this->shell;
-  PRINTF(3)("World::~World() - deleting current world\n");
+  PRINTF(3)("GameWorld::~GameWorld() - deleting current world\n");
 
   delete this->localPlayer;
@@ -129,5 +131,5 @@
 
 /**
- * initializes the world.
+ *  initializes the world.
  * @param name the name of the world
  * @param worldID the ID of this world
@@ -139,7 +141,7 @@
  * NO LEVEL LOADING HERE - NEVER!
 */
-void World::constuctorInit(const char* name, int worldID)
-{
-  this->setClassID(CL_WORLD, "World");
+void GameWorld::constuctorInit(const char* name, int worldID)
+{
+  this->setClassID(CL_GAME_WORLD, "GameWorld");
 
   this->setName(name);
@@ -156,19 +158,19 @@
 
 /**
- * loads the parameters of a World from an XML-element
+ * loads the parameters of a GameWorld from an XML-element
  * @param root the XML-element to load from
  */
-void World::loadParams(const TiXmlElement* root)
-{
-  PRINTF(4)("Creating a World\n");
-
-  LoadParam(root, "identifier", this, World, setStoryID)
+void GameWorld::loadParams(const TiXmlElement* root)
+{
+  PRINTF(4)("Creating a GameWorld\n");
+
+  LoadParam(root, "identifier", this, GameWorld, setStoryID)
     .describe("Sets the StoryID of this world");
 
-  LoadParam(root, "nextid", this, World, setNextStoryID)
+  LoadParam(root, "nextid", this, GameWorld, setNextStoryID)
     .describe("Sets the ID of the next world");
 
-  LoadParam(root, "path", this, World, setPath)
-    .describe("The Filename of this World (relative from the data-dir)");
+  LoadParam(root, "path", this, GameWorld, setPath)
+    .describe("The Filename of this GameWorld (relative from the data-dir)");
 }
 
@@ -179,5 +181,5 @@
  * before the load and after the proceeding storyentity has finished
 */
-ErrorMessage World::preLoad()
+ErrorMessage GameWorld::preLoad()
 {
   State::setObjectManager(&this->objectManager);
@@ -195,5 +197,5 @@
 
   this->localCamera = new Camera();
-  this->localCamera->setName ("World-Camera");
+  this->localCamera->setName ("GameWorld-Camera");
 
   State::setCamera(this->localCamera, this->localCamera->getTarget());
@@ -205,7 +207,7 @@
 
 /**
- *  loads the World by initializing all resources, and set their default values.
+ *  loads the GameWorld by initializing all resources, and set their default values.
  */
-ErrorMessage World::load()
+ErrorMessage GameWorld::load()
 {
   PRINTF(3)("> Loading world: '%s'\n", getPath());
@@ -215,6 +217,6 @@
   if( getPath() == NULL)
     {
-      PRINTF(1)("World has no path specified for loading");
-      return (ErrorMessage){213,"Path not specified","World::load()"};
+      PRINTF(1)("GameWorld has no path specified for loading");
+      return (ErrorMessage){213,"Path not specified","GameWorld::load()"};
     }
 
@@ -226,5 +228,5 @@
     PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","World::load()"};
+    return (ErrorMessage){213,"XML File parsing error","GameWorld::load()"};
   }
 
@@ -238,5 +240,5 @@
       PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
       delete XMLDoc;
-      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
+      return (ErrorMessage){213,"Path not a WorldDataFile","GameWorld::load()"};
     }
 
@@ -246,5 +248,5 @@
   if( string == NULL)
     {
-      PRINTF(2)("World is missing a proper 'name'\n");
+      PRINTF(2)("GameWorld is missing a proper 'name'\n");
       this->setName("Unknown");
     }
@@ -281,5 +283,5 @@
   if( element == NULL)
     {
-      PRINTF(1)("World is missing 'WorldEntities'\n");
+      PRINTF(1)("GameWorld is missing 'WorldEntities'\n");
     }
   else
@@ -353,25 +355,5 @@
   SoundEngine::getInstance()->setListener(this->localCamera);
 
-
-
-  ////////////
-  // STATIC //
-  ////////////
-
-
-//   TestEntity* testEntity = new TestEntity();
-//   testEntity->setRelCoor(Vector(570, 10, -15));
-//   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity);
-
-  for(int i = 0; i < 100; i++)
-  {
-    WorldEntity* tmp = new NPCTest1();
-    char npcChar[10];
-    sprintf (npcChar, "NPC_%d", i);
-        tmp->setName(npcChar);
-    tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
-    this->spawn(tmp);
-  }
+  /* some static stuff*/
 
   this->music = NULL;
@@ -380,5 +362,5 @@
 }
 
-ErrorMessage World::postLoad()
+ErrorMessage GameWorld::postLoad()
 {
   this->releaseLoadScreen();
@@ -387,10 +369,10 @@
 
 /**
- *  initializes a new World shortly before start
+ *  initializes a new GameWorld shortly before start
  *
  * this is the function, that will be loaded shortly before the world is
  * started
 */
-ErrorMessage World::preStart()
+ErrorMessage GameWorld::preStart()
 {
   this->bPause = false;
@@ -403,7 +385,7 @@
 
 /**
- *  starts the World
+ *  starts the GameWorld
  */
-ErrorMessage World::start()
+ErrorMessage GameWorld::start()
 {
   this->bQuitWorld = false;
@@ -416,7 +398,7 @@
    This happens, when the player decides to end the Level.
 */
-ErrorMessage World::stop()
-{
-  PRINTF(3)("World::stop() - got stop signal\n");
+ErrorMessage GameWorld::stop()
+{
+  PRINTF(3)("GameWorld::stop() - got stop signal\n");
   this->bQuitWorld= true;
 }
@@ -425,5 +407,5 @@
  *  pauses the Game
 */
-ErrorMessage World::pause()
+ErrorMessage GameWorld::pause()
 {
   this->isPaused = true;
@@ -433,5 +415,5 @@
  *  ends the pause Phase
 */
-ErrorMessage World::resume()
+ErrorMessage GameWorld::resume()
 {
   this->isPaused = false;
@@ -439,7 +421,7 @@
 
 /**
- *  destroys the World
-*/
-ErrorMessage World::destroy()
+ *  destroys the GameWorld
+*/
+ErrorMessage GameWorld::destroy()
 {
 
@@ -449,7 +431,7 @@
  *  shows the loading screen
 */
-void World::displayLoadScreen ()
-{
-  PRINTF(3)("World::displayLoadScreen - start\n");
+void GameWorld::displayLoadScreen ()
+{
+  PRINTF(3)("GameWorld::displayLoadScreen - start\n");
 
   //GLMenuImageScreen*
@@ -457,5 +439,5 @@
   this->glmis->setMaximum(8);
 
-  PRINTF(3)("World::displayLoadScreen - end\n");
+  PRINTF(3)("GameWorld::displayLoadScreen - end\n");
 }
 
@@ -465,9 +447,9 @@
  * @todo take out the delay
 */
-void World::releaseLoadScreen ()
-{
-  PRINTF(3)("World::releaseLoadScreen - start\n");
+void GameWorld::releaseLoadScreen ()
+{
+  PRINTF(3)("GameWorld::releaseLoadScreen - start\n");
   this->glmis->setValue(this->glmis->getMaximum());
-  PRINTF(3)("World::releaseLoadScreen - end\n");
+  PRINTF(3)("GameWorld::releaseLoadScreen - end\n");
   delete this->glmis;
 }
@@ -478,5 +460,5 @@
  * @returns elapsed game time
 */
-double World::getGameTime()
+double GameWorld::getGameTime()
 {
   return this->gameTime;
@@ -488,5 +470,5 @@
  *  synchronize local data with remote data
 */
-void World::synchronize ()
+void GameWorld::synchronize ()
 {
   // Get remote input
@@ -502,5 +484,5 @@
    sdl and has its own event-passing-queue.
 */
-void World::handleInput ()
+void GameWorld::handleInput ()
 {
   EventHandler::getInstance()->process();
@@ -509,5 +491,5 @@
 }
 
-void World::tick(std::list<WorldEntity*> entityList, float dt)
+void GameWorld::tick(std::list<WorldEntity*> entityList, float dt)
 {
   std::list<WorldEntity*>::iterator entity;
@@ -524,5 +506,5 @@
    a heart-beat.
 */
-void World::tick ()
+void GameWorld::tick ()
 {
   Uint32 currentFrame = SDL_GetTicks();
@@ -588,5 +570,5 @@
    state to the whole system.
 */
-void World::update()
+void GameWorld::update()
 {
   GraphicsEngine::getInstance()->update(this->dtS);
@@ -597,5 +579,5 @@
 
 
-void World::collide()
+void GameWorld::collide()
 {
   CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
@@ -610,5 +592,5 @@
    clear all buffers and draw the world
 */
-void World::display ()
+void GameWorld::display ()
 {
   // clear buffer
@@ -630,5 +612,5 @@
  *  runs through all entities calling their draw() methods
  */
-void World::draw ()
+void GameWorld::draw ()
 {
   GraphicsEngine* engine = GraphicsEngine::getInstance();
@@ -674,8 +656,8 @@
  * collisions drawing everything to the screen.
  */
-void World::mainLoop()
+void GameWorld::mainLoop()
 {
   this->lastFrame = SDL_GetTicks ();
-  PRINTF(3)("World::mainLoop() - Entering main loop\n");
+  PRINTF(3)("GameWorld::mainLoop() - Entering main loop\n");
 
   while(!this->bQuitWorld) /* @todo implement pause */
@@ -698,5 +680,5 @@
   }
 
-  PRINTF(3)("World::mainLoop() - Exiting the main loop\n");
+  PRINTF(3)("GameWorld::mainLoop() - Exiting the main loop\n");
 }
 
@@ -707,5 +689,5 @@
  * @param entity to be added
 */
-void World::spawn(WorldEntity* entity)
+void GameWorld::spawn(WorldEntity* entity)
 {
 //   this->entities->add (entity);
@@ -713,5 +695,5 @@
 }
 
-void World::setPath( const char* name)
+void GameWorld::setPath( const char* name)
 {
   if (this->path)
@@ -729,5 +711,5 @@
 }
 
-const char* World::getPath( void)
+const char* GameWorld::getPath( void)
 {
   return path;
Index: branches/network/src/story_entities/game_world.h
===================================================================
--- branches/network/src/story_entities/game_world.h	(revision 6357)
+++ branches/network/src/story_entities/game_world.h	(revision 6358)
@@ -38,7 +38,7 @@
 
     /* classes from story-entity */
-    virtual ErrorMessage preLoad();
-    virtual ErrorMessage load ();
-    virtual ErrorMessage postLoad();
+    ErrorMessage preLoad();
+    ErrorMessage load ();
+    ErrorMessage postLoad();
 
     virtual ErrorMessage preStart();
@@ -92,4 +92,6 @@
     bool showBV;                        //!< if the Bounding Volumes should be visible.
 
+    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
+
     /* world timing */
     Uint32 lastFrame;                   //!< last time of frame
@@ -103,4 +105,7 @@
     ObjectManager objectManager;        //!< The ObjectManager of this GameWorld.
 
+    /* external modules interfaces */
+    Shell*     shell;
+    OggPlayer* music;
 
     /* important entities */
Index: branches/network/src/story_entities/multi_player_world.cc
===================================================================
--- branches/network/src/story_entities/multi_player_world.cc	(revision 6357)
+++ branches/network/src/story_entities/multi_player_world.cc	(revision 6358)
@@ -11,74 +11,30 @@
    ### File Specific:
    main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
-   co-programmer: Benjamin Grauer
 */
 
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
 
-#include "network_world.h"
+#include "multi_player_world.h"
 
-#include "shell_command.h"
-#include "resource_manager.h"
 #include "state.h"
+#include "class_list.h"
 
-#include "p_node.h"
-#include "world_entity.h"
-#include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "terrain.h"
-
-#include "test_entity.h"
-#include "terrain.h"
-#include "light.h"
 #include "load_param.h"
-#include "shell.h"
-
 #include "fast_factory.h"
-#include "animation_player.h"
-#include "particle_engine.h"
-#include "graphics_engine.h"
-#include "physics_engine.h"
-#include "fields.h"
-
-#include "md2Model.h"
-
-#include "glmenu_imagescreen.h"
-#include "game_loader.h"
-
-#include "animation3d.h"
-
-#include "substring.h"
-
 #include "factory.h"
 
-#include "weapons/projectile.h"
-#include "event_handler.h"
-#include "sound_engine.h"
-#include "ogg_player.h"
-
-#include "class_list.h"
-
-#include "cd_engine.h"
-#include "npcs/npc_test1.h"
-#include "shader.h"
-
-#include "playable.h"
-#include "network_manager.h"
-#include "network_game_manager.h"
-#include "playable.h"
 
 
-SHELL_COMMAND(speed, NetworkWorld, setSpeed);
-SHELL_COMMAND(togglePNodeVisibility, NetworkWorld, togglePNodeVisibility);
-SHELL_COMMAND(toggleBVVisibility, NetworkWorld, toggleBVVisibility);
+
+SHELL_COMMAND(speed, MultiPlayerWorld, setSpeed);
+SHELL_COMMAND(togglePNodeVisibility, MultiPlayerWorld, togglePNodeVisibility);
+SHELL_COMMAND(toggleBVVisibility, MultiPlayerWorld, toggleBVVisibility);
 
 using namespace std;
 
-//! This creates a Factory to fabricate a NetworkWorld
-CREATE_FACTORY(NetworkWorld, CL_WORLD);
+//! This creates a Factory to fabricate a MultiPlayerWorld
+CREATE_FACTORY(MultiPlayerWorld, CL_WORLD);
 
-NetworkWorld::NetworkWorld(const TiXmlElement* root)
+MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root)
 {
   this->constuctorInit("", -1);
@@ -89,13 +45,13 @@
 
 /**
- *  remove the NetworkWorld from memory
+ *  remove the MultiPlayerWorld from memory
  *
  *  delete everything explicitly, that isn't contained in the parenting tree!
  *  things contained in the tree are deleted automaticaly
  */
-NetworkWorld::~NetworkWorld ()
+MultiPlayerWorld::~MultiPlayerWorld ()
 {
   delete this->shell;
-  PRINTF(3)("NetworkWorld::~NetworkWorld() - deleting current world\n");
+  PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n");
 
   delete this->localPlayer;
@@ -140,7 +96,7 @@
  * NO LEVEL LOADING HERE - NEVER!
 */
-void NetworkWorld::constuctorInit(const char* name, int worldID)
+void MultiPlayerWorld::constuctorInit(const char* name, int worldID)
 {
-  this->setClassID(CL_WORLD, "NetworkWorld");
+  this->setClassID(CL_WORLD, "MultiPlayerWorld");
   PRINTF(0)("START\n");
 
@@ -157,21 +113,17 @@
 }
 
+
 /**
- * loads the parameters of a NetworkWorld from an XML-element
+ * loads the parameters of a MultiPlayerWorld from an XML-element
  * @param root the XML-element to load from
  */
-void NetworkWorld::loadParams(const TiXmlElement* root)
+void MultiPlayerWorld::loadParams(const TiXmlElement* root)
 {
-  PRINTF(4)("Creating a NetworkWorld\n");
+  static_cast<GameWorld*>(this)->loadParams(root);
 
-  LoadParam(root, "identifier", this, NetworkWorld, setStoryID)
-    .describe("Sets the StoryID of this world");
+  PRINTF(4)("Creating a MultiPlayerWorld\n");
+}
 
-  LoadParam(root, "nextid", this, NetworkWorld, setNextStoryID)
-    .describe("Sets the ID of the next world");
 
-  LoadParam(root, "path", this, NetworkWorld, setPath)
-    .describe("The Filename of this NetworkWorld (relative from the data-dir)");
-}
 
 /**
@@ -180,617 +132,43 @@
  * since the load function sometimes needs data, that has been initialized
  * before the load and after the proceeding storyentity has finished
-*/
-ErrorMessage NetworkWorld::preLoad()
+ */
+ErrorMessage GameWorld::preLoad()
 {
-  State::setObjectManager(&this->objectManager);
-  this->cycle = 0;
+  static_cast<GameWorld*>(this)->preLoad();
 
-  /* init the world interface */
-  this->shell = new Shell();
-
-  LightManager::getInstance();
-  PNode::getNullParent();
-
-  AnimationPlayer::getInstance(); // initializes the animationPlayer
-  ParticleEngine::getInstance();
-  PhysicsEngine::getInstance();
-
-  this->localCamera = new Camera();
-  this->localCamera->setName ("NetworkWorld-Camera");
-
-  State::setCamera(this->localCamera, this->localCamera->getTarget());
-
-  GraphicsEngine::getInstance()->displayFPS(true);
-  this->displayLoadScreen();
+  /* the the single player specific stuff */
 }
 
 
 /**
- *  loads the NetworkWorld by initializing all resources, and set their default values.
+ *  loads the GameWorld by initializing all resources, and set their default values.
  */
-ErrorMessage NetworkWorld::load()
+ErrorMessage GameWorld::load()
 {
-  PRINTF(3)("> Loading world: '%s'\n", getPath());
-  TiXmlElement* element;
-  GameLoader* loader = GameLoader::getInstance();
+  static_cast<GameWorld*>(this)->load();
 
-  if( getPath() == NULL)
-    {
-      PRINTF(1)("World has no path specified for loading");
-      return (ErrorMessage){213,"Path not specified","World::load()"};
-    }
+  /* the the single player specific stuff here */
 
-  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
-  // load the campaign document
-  if( !XMLDoc->LoadFile())
+  /* some static world entities */
+  for(int i = 0; i < 100; i++)
   {
-    // report an error
-    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-    delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","NetworkWorld::load()"};
+    WorldEntity* tmp = new NPCTest1();
+    char npcChar[10];
+    sprintf (npcChar, "NPC_%d", i);
+    tmp->setName(npcChar);
+    tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
+    this->spawn(tmp);
   }
-
-  // check basic validity
-  TiXmlElement* root = XMLDoc->RootElement();
-  assert( root != NULL);
-
-  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
-    {
-      // report an error
-      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
-      delete XMLDoc;
-      return (ErrorMessage){213,"Path not a WorldDataFile","NetworkWorld::load()"};
-    }
-
-
-  // load the parameters
-  // name
-  const char* string = grabParameter( root, "name");
-  if( string == NULL)
-    {
-      PRINTF(2)("World is missing a proper 'name'\n");
-      this->setName("Unknown");
-    }
-  else
-    {
-      this->setName(string);
-    }
-
-
-  ////////////////
-  // LOADSCREEN //
-  ////////////////
-  element = root->FirstChildElement("LoadScreen");
-  if (element == NULL)
-    {
-      PRINTF(2)("no LoadScreen specified, loading default\n");
-
-      glmis->setBackgroundImage("pictures/load_screen.jpg");
-      this->glmis->setMaximum(8);
-      this->glmis->draw();
-    }
-  else
-    {
-      this->glmis->loadParams(element);
-      this->glmis->draw();
-    }
-  this->glmis->draw();
-
-
-
-  ////////////////////////////
-  // Loading Spawning Point //
-  ////////////////////////////
-  element = root->FirstChildElement("SpawningPoints");
-  if( element == NULL)
-  {
-    PRINTF(1)("NetworkWorld is missing 'SpawningPoints'\n");
-  }
-  else
-  {
-    element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-    PRINTF(4)("Loading Spawning Points\n");
-    while( element != NULL)
-    {
-      BaseObject* created = Factory::fabricate(element);
-      if( created != NULL )
-      {
-//        if(created->isA(CL_SPAWNING_POINT))
-//          this->spawn(dynamic_cast<WorldEntity*>(created));
-        printf("Created a Spawning Point %s: %s\n", created->getClassName(), created->getName());
-      }
-
-
-      element = element->NextSiblingElement();
-      glmis->step(); //! @todo temporary
-    }
-    PRINTF(4)("Done loading NetworkWorldEntities\n");
-  }
-
-
-  ////////////////////////
-  // find WorldEntities //
-  ////////////////////////
-  element = root->FirstChildElement("WorldEntities");
-  if( element == NULL)
-  {
-    PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n");
-  }
-  else
-  {
-    element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-    PRINTF(4)("Loading NetworkWorldEntities\n");
-    while( element != NULL)
-    {
-      if( NetworkManager::getInstance()->isGameServer())
-      {
-
-        BaseObject* created = NetworkGameManager::getInstance()->createEntity(element);
-        if( created != NULL )
-        {
-//          if(created->isA(CL_WORLD_ENTITY))
-//            this->spawn(dynamic_cast<WorldEntity*>(created));
-          printf("Created a %s: %s\n", created->getClassName(), created->getName());
-        }
-        else
-          PRINTF(1)("NetworkWorld: could not create this entity\n");
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-        if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-          sky = dynamic_cast<WorldEntity*>(created);
-        if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-        {
-          terrain = dynamic_cast<Terrain*>(created);
-          CDEngine::getInstance()->setTerrain(terrain);
-
-        }
-
-      }
-      else if( /* !strcmp( element->Value(), "SkyBox") || */ /* !strcmp( element->Value(), "Terrain") || */ !strcmp( element->Value(), "SpaceShip"))
-      {
-        BaseObject* created = Factory::fabricate(element);
-        if( created != NULL )
-        {
-//          if(created->isA(CL_WORLD_ENTITY))
-//            this->spawn(dynamic_cast<WorldEntity*>(created));
-          printf("Created a %s: %s\n", created->getClassName(), created->getName());
-        }
-        else
-          PRINTF(1)("NetworkWorld: could not create this entity\n");
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-        if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-          sky = dynamic_cast<WorldEntity*>(created);
-        if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-        {
-          terrain = dynamic_cast<Terrain*>(created);
-          CDEngine::getInstance()->setTerrain(terrain);
-        }
-      }
-      element = element->NextSiblingElement();
-      glmis->step(); //! @todo temporary
-      PRINTF(4)("Done loading NetworkWorldEntities\n");
-    }
-  }
-
-
-    //////////////////////////////
-    // LOADING ADDITIONAL STUFF //
-    //////////////////////////////
-
-    LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
-
-   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
-
-  // free the XML data
-
-  delete XMLDoc;
-  /* GENERIC LOADING PROCESS FINISHED */
-
-
-  // Create a Player
-  this->localPlayer = new Player();
-
-  Playable* playable;
-  const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  if (playableList != NULL)
-  {
-    playable = dynamic_cast<Playable*>(playableList->front());
-    this->localPlayer->setControllable(playable);
-  }
-
-
-//   //localCamera->setParent(TrackNode::getInstance());
-//  tn->addChild(this->localCamera);
-  localCamera->setClipRegion(1, 10000.0);
-//  localCamera->lookAt(playable);
-//  this->localPlayer->setParentMode(PNODE_ALL);
-  if (this->sky != NULL)
-  {
-    this->localCamera->addChild(sky);
-  }
-  SoundEngine::getInstance()->setListener(this->localCamera);
-
-
-
-  ////////////
-  // STATIC //
-  ////////////
-
-
-//   TestEntity* testEntity = new TestEntity();
-//   testEntity->setRelCoor(Vector(570, 10, -15));
-//   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity);
-
-//   for(int i = 0; i < 100; i++)
-//   {
-//     WorldEntity* tmp = NetworkGameManager::;
-//     char npcChar[10];
-//     sprintf (npcChar, "NPC_%d", i);
-//         tmp->setName(npcChar);
-//     tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
-//     this->spawn(tmp);
-//   }
-
-  this->music = NULL;
-  //(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
-  //music->playback();
-}
-
-ErrorMessage NetworkWorld::postLoad()
-{
-  /*monitor progress*/
-  this->glmis->step();
-  // stuff beyond this point remains to be loaded properly
-
-  // LIGHT initialisation
-  LightManager::getInstance()->setAmbientColor(.1,.1,.1);
-//  LightManager::getInstance()->addLight();
-  LightManager::getInstance()->debug();
-
-  this->releaseLoadScreen();
 }
 
 
 /**
- *  initializes a new NetworkWorld shortly before start
- *
- * this is the function, that will be loaded shortly before the world is
- * started
-*/
-ErrorMessage NetworkWorld::preStart()
+ *  post loads the GameWorld by initializing all resources, and set their default values.
+ */
+ErrorMessage GameWorld::postLoad()
 {
-  this->bPause = false;
+  static_cast<GameWorld*>(this)->postLoad();
 
-  /* update the object position before game start - so there are no wrong coordinates used in the first processing */
-  PNode::getNullParent()->updateNode (0.001f);
-  PNode::getNullParent()->updateNode (0.001f);
+  /* the single player specific stuff here */
 }
 
-
-/**
- *  starts the NetworkWorld
- */
-ErrorMessage NetworkWorld::start()
-{
-  this->bQuitWorld = false;
-  this->mainLoop();
-}
-
-/**
- *  stops the world.
-
-   This happens, when the player decides to end the Level.
-*/
-ErrorMessage NetworkWorld::stop()
-{
-  PRINTF(3)("NetworkWorld::stop() - got stop signal\n");
-  this->bQuitWorld= true;
-}
-
-/**
- *  pauses the Game
-*/
-ErrorMessage NetworkWorld::pause()
-{
-  this->isPaused = true;
-}
-
-/**
- *  ends the pause Phase
-*/
-ErrorMessage NetworkWorld::resume()
-{
-  this->isPaused = false;
-}
-
-/**
- *  destroys the NetworkWorld
-*/
-ErrorMessage NetworkWorld::destroy()
-{
-
-}
-
-/**
- *  shows the loading screen
-*/
-void NetworkWorld::displayLoadScreen ()
-{
-  PRINTF(3)("NetworkWorld::displayLoadScreen - start\n");
-
-  //GLMenuImageScreen*
-  this->glmis = new GLMenuImageScreen();
-  this->glmis->setMaximum(8);
-
-  PRINTF(3)("NetworkWorld::displayLoadScreen - end\n");
-}
-
-/**
- * @brief removes the loadscreen, and changes over to the game
- *
- * @todo take out the delay
-*/
-void NetworkWorld::releaseLoadScreen ()
-{
-  PRINTF(3)("NetworkWorld::releaseLoadScreen - start\n");
-  this->glmis->setValue(this->glmis->getMaximum());
-  PRINTF(3)("NetworkWorld::releaseLoadScreen - end\n");
-  delete this->glmis;
-}
-
-
-/**
- *  this returns the current game time
- * @returns elapsed game time
-*/
-double NetworkWorld::getGameTime()
-{
-  return this->gameTime;
-}
-
-/**
-  \brief main loop of the world: executing all world relevant function
-  in this loop we synchronize (if networked), handle input events, give the heart-beat to
-  all other member-entities of the world (tick to player, enemies etc.), checking for
-  collisions drawing everything to the screen.
-*/
-void NetworkWorld::mainLoop()
-{
-  this->lastFrame = SDL_GetTicks ();
-  PRINTF(3)("World::mainLoop() - Entering main loop\n");
-
-  while(!this->bQuitWorld) /* @todo implement pause */
-  {
-    ++this->cycle;
-      // Network
-    this->synchronize ();
-      // Process input
-    this->handleInput ();
-    if( this->bQuitWorld)
-      break;
-      // Process time
-    this->tick ();
-      // Process collision
-    this->collide ();
-      // Update the state
-    this->update ();
-      // Draw
-    this->display ();
-  }
-
-  PRINTF(3)("NetworkWorld::mainLoop() - Exiting the main loop\n");
-}
-
-
-/**
- *  synchronize local data with remote data
-*/
-void NetworkWorld::synchronize ()
-{
-  // Get remote input
-  // Update synchronizables
-  NetworkManager::getInstance()->synchronize();
-}
-
-
-/**
- *  run all input processing
-
-   the command node is the central input event dispatcher. the node uses the even-queue from
-   sdl and has its own event-passing-queue.
-*/
-void NetworkWorld::handleInput ()
-{
-  EventHandler::getInstance()->process();
-
-  // remoteinput
-}
-
-void NetworkWorld::tick(std::list<WorldEntity*> entityList, float dt)
-{
-  std::list<WorldEntity*>::iterator entity;
-  for (entity = entityList.begin(); entity != entityList.end(); entity++)
-    (*entity)->tick(dt);
-
-}
-
-/**
- *  advance the timeline
-
-   this calculates the time used to process one frame (with all input handling, drawing, etc)
-   the time is mesured in ms and passed to all world-entities and other classes that need
-   a heart-beat.
-*/
-void NetworkWorld::tick ()
-{
-  Uint32 currentFrame = SDL_GetTicks();
-  if(!this->bPause)
-    {
-      this->dt = currentFrame - this->lastFrame;
-
-      if( this->dt > 10)
-        {
-          float fps = 1000/dt;
-
-          // temporary, only for showing how fast the text-engine is
-          char tmpChar[20];
-          sprintf(tmpChar, "fps: %4.0f", fps);
-        }
-      else
-        {
-          /* the frame-rate is limited to 100 frames per second, all other things are for
-             nothing.
-          */
-          PRINTF(3)("fps = 1000 - frame rate is adjusted\n");
-          SDL_Delay(10-dt);
-          this->dt = 10;
-        }
-
-      this->dtS = (float)this->dt / 1000.0 * this->speed;
-      this->gameTime += this->dtS;
-
-      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
-
-      /* update tick the rest */
-      this->localCamera->tick(this->dtS);
-      // tick the engines
-      AnimationPlayer::getInstance()->tick(this->dtS);
-//      if (this->cycle > 5)
-        PhysicsEngine::getInstance()->tick(this->dtS);
-
-      ParticleEngine::getInstance()->tick(this->dtS);
-
-
-      /** actualy the Graphics Engine should tick the world not the other way around...
-         but since we like the things not too complicated we got it this way around
-         until there is need or time to do it the other way around.
-         @todo: GraphicsEngine ticks world: separation of processes and data...
-
-        bensch: in my opinion the GraphicsEngine could draw the world, but not tick it,
-         beceause graphics have nothing(or at least not much) to do with Motion.
-      */
-      GraphicsEngine::getInstance()->tick(this->dtS);
-    }
-  this->lastFrame = currentFrame;
-}
-
-
-/**
- *  this function gives the world a consistant state
-
-   after ticking (updating the world state) this will give a constistant
-   state to the whole system.
-*/
-void NetworkWorld::update()
-{
-  GraphicsEngine::getInstance()->update(this->dtS);
-  PNode::getNullParent()->updateNode (this->dtS);
-  SoundEngine::getInstance()->update();
-  //music->update();
-}
-
-
-void NetworkWorld::collide()
-{
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
-                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
-                                            this->objectManager.getObjectList(OM_COMMON));
-}
-
-/**
- *  render the current frame
-
-   clear all buffers and draw the world
-*/
-void NetworkWorld::display ()
-{
-  // clear buffer
-  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-  // set camera
-  this->localCamera->apply ();
-  // draw world
-  this->draw();
-  // draw HUD
-  /** @todo draw HUD */
-  // flip buffers
-  GraphicsEngine::swapBuffers();
-  //SDL_Surface* screen = Orxonox::getInstance()->getScreen ();
-  //SDL_Flip (screen);
-}
-
-
-/**
- *  runs through all entities calling their draw() methods
- */
-void NetworkWorld::draw ()
-{
-  GraphicsEngine* engine = GraphicsEngine::getInstance();
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-
-   if( unlikely( this->showBV))  // to draw the bounding boxes of the objects at level 2 for debug purp
-   {
-     CDEngine* engine = CDEngine::getInstance();
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_COMMON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_00));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-   }
-
-//   {
-//     if( entity->isVisible() ) entity->draw();
-  //FIXME
-//     entity = iterator->nextElement();
-//   }
-
-  ParticleEngine::getInstance()->draw();
-
-  if (unlikely(this->showPNodes))
-    PNode::getNullParent()->debugDraw(0);
-
-  engine->draw();
-  //TextEngine::getInstance()->draw();
-}
-
-void NetworkWorld::setPath( const char* name)
-{
-  if (this->path)
-    delete this->path;
-  if (ResourceManager::isFile(name))
-  {
-    this->path = new char[strlen(name)+1];
-    strcpy(this->path, name);
-  }
-  else
-    {
-      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
-      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
-    }
-}
-
-const char* NetworkWorld::getPath( void)
-{
-  return path;
-}
Index: branches/network/src/story_entities/single_player_world.cc
===================================================================
--- branches/network/src/story_entities/single_player_world.cc	(revision 6357)
+++ branches/network/src/story_entities/single_player_world.cc	(revision 6358)
@@ -11,120 +11,44 @@
    ### File Specific:
    main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
-   co-programmer: Benjamin Grauer
 */
 
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
 
-#include "world.h"
+#include "single_player_world.h"
 
-#include "shell_command.h"
-#include "resource_manager.h"
 #include "state.h"
+#include "class_list.h"
 
-#include "p_node.h"
-#include "world_entity.h"
-#include "player.h"
-#include "camera.h"
-#include "environment.h"
-#include "terrain.h"
-
-#include "test_entity.h"
-#include "terrain.h"
-#include "light.h"
 #include "load_param.h"
-#include "shell.h"
-
 #include "fast_factory.h"
-#include "animation_player.h"
-#include "particle_engine.h"
-#include "graphics_engine.h"
-#include "physics_engine.h"
-#include "fields.h"
-
-#include "md2Model.h"
-
-#include "glmenu_imagescreen.h"
-#include "game_loader.h"
-
-#include "animation3d.h"
-
-#include "substring.h"
-
 #include "factory.h"
 
-#include "weapons/projectile.h"
-#include "event_handler.h"
-#include "sound_engine.h"
-#include "ogg_player.h"
 
-#include "class_list.h"
-
-#include "cd_engine.h"
-#include "npcs/npc_test1.h"
-#include "shader.h"
-
-#include "playable.h"
-#include "network_manager.h"
-#include "playable.h"
-
-
-SHELL_COMMAND(speed, World, setSpeed);
-SHELL_COMMAND(togglePNodeVisibility, World, togglePNodeVisibility);
-SHELL_COMMAND(toggleBVVisibility, World, toggleBVVisibility);
 
 using namespace std;
 
-//! This creates a Factory to fabricate a World
-CREATE_FACTORY(World, CL_WORLD);
+//! This creates a Factory to fabricate a SinglePlayerWorld
+CREATE_FACTORY(SinglePlayerSinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
 
-World::World(const TiXmlElement* root)
+
+
+SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
+  : GameWorld(root)
 {
-  this->constuctorInit("", -1);
-  this->path = NULL;
-
   this->loadParams(root);
 }
 
+
 /**
- *  remove the World from memory
+ *  remove the SinglePlayerWorld from memory
  *
  *  delete everything explicitly, that isn't contained in the parenting tree!
  *  things contained in the tree are deleted automaticaly
  */
-World::~World ()
+SinglePlayerWorld::~SinglePlayerWorld ()
 {
-  delete this->shell;
-  PRINTF(3)("World::~World() - deleting current world\n");
+  PRINTF(3)("SinglePlayerWorld::~SinglePlayerWorld() - deleting current world\n");
+}
 
-  delete this->localPlayer;
-
-  // delete all the initialized Engines.
-  FastFactory::flushAll(true);
-  delete LightManager::getInstance();
-  delete ParticleEngine::getInstance();
-  delete AnimationPlayer::getInstance();
-  delete PhysicsEngine::getInstance();
-
-  // external engines initialized by the orxonox-class get deleted
-  SoundEngine::getInstance()->flushAllBuffers();
-  SoundEngine::getInstance()->flushAllSources();
-
-  if (State::getObjectManager() == &this->objectManager)
-    State::setObjectManager(NULL);
-  // erease everything that is left.
-  delete PNode::getNullParent();
-
-  //secondary cleanup of PNodes;
-  const std::list<BaseObject*>* nodeList = ClassList::getList(CL_PARENT_NODE);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-      delete nodeList->front();
-
-  Shader::suspendShader();
-
-  // unload the resources !!
-  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
-}
 
 /**
@@ -139,9 +63,9 @@
  * NO LEVEL LOADING HERE - NEVER!
 */
-void World::constuctorInit(const char* name, int worldID)
+void SinglePlayerWorld::constuctorInit(const char* name, int worldID)
 {
-  this->setClassID(CL_WORLD, "World");
+  this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerSinglePlayerWorld");
+  this->setName(name);
 
-  this->setName(name);
   this->gameTime = 0.0f;
   this->setSpeed(1.0);
@@ -155,21 +79,17 @@
 }
 
+
 /**
- * loads the parameters of a World from an XML-element
+ * loads the parameters of a SinglePlayerWorld from an XML-element
  * @param root the XML-element to load from
  */
-void World::loadParams(const TiXmlElement* root)
+void SinglePlayerWorld::loadParams(const TiXmlElement* root)
 {
-  PRINTF(4)("Creating a World\n");
+  static_cast<GameWorld*>(this)->loadParams(root);
 
-  LoadParam(root, "identifier", this, World, setStoryID)
-    .describe("Sets the StoryID of this world");
+  PRINTF(4)("Creating a SinglePlayerWorld\n");
+}
 
-  LoadParam(root, "nextid", this, World, setNextStoryID)
-    .describe("Sets the ID of the next world");
 
-  LoadParam(root, "path", this, World, setPath)
-    .describe("The Filename of this World (relative from the data-dir)");
-}
 
 /**
@@ -178,191 +98,23 @@
  * since the load function sometimes needs data, that has been initialized
  * before the load and after the proceeding storyentity has finished
-*/
-ErrorMessage World::preLoad()
+ */
+ErrorMessage GameWorld::preLoad()
 {
-  State::setObjectManager(&this->objectManager);
-  this->cycle = 0;
+  static_cast<GameWorld*>(this)->preLoad();
 
-  /* init the world interface */
-  this->shell = new Shell();
-
-  LightManager::getInstance();
-  PNode::getNullParent();
-
-  AnimationPlayer::getInstance(); // initializes the animationPlayer
-  ParticleEngine::getInstance();
-  PhysicsEngine::getInstance();
-
-  this->localCamera = new Camera();
-  this->localCamera->setName ("World-Camera");
-
-  State::setCamera(this->localCamera, this->localCamera->getTarget());
-
-  GraphicsEngine::getInstance()->displayFPS(true);
-  this->displayLoadScreen();
+  /* the the single player specific stuff */
 }
 
 
 /**
- *  loads the World by initializing all resources, and set their default values.
+ *  loads the GameWorld by initializing all resources, and set their default values.
  */
-ErrorMessage World::load()
+ErrorMessage GameWorld::load()
 {
-  PRINTF(3)("> Loading world: '%s'\n", getPath());
-  TiXmlElement* element;
-  GameLoader* loader = GameLoader::getInstance();
+  static_cast<GameWorld*>(this)->load();
 
-  if( getPath() == NULL)
-    {
-      PRINTF(1)("World has no path specified for loading");
-      return (ErrorMessage){213,"Path not specified","World::load()"};
-    }
+  /* the the single player specific stuff here */
 
-  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
-  // load the campaign document
-  if( !XMLDoc->LoadFile())
-  {
-    // report an error
-    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
-    delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","World::load()"};
-  }
-
-  // check basic validity
-  TiXmlElement* root = XMLDoc->RootElement();
-  assert( root != NULL);
-
-  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
-    {
-      // report an error
-      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
-      delete XMLDoc;
-      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
-    }
-
-  // load the parameters
-  // name
-  const char* string = grabParameter( root, "name");
-  if( string == NULL)
-    {
-      PRINTF(2)("World is missing a proper 'name'\n");
-      this->setName("Unknown");
-    }
-  else
-    {
-      this->setName(string);
-    }
-
-  ////////////////
-  // LOADSCREEN //
-  ////////////////
-  element = root->FirstChildElement("LoadScreen");
-  if (element == NULL)
-    {
-      PRINTF(2)("no LoadScreen specified, loading default\n");
-
-      glmis->setBackgroundImage("pictures/load_screen.jpg");
-      this->glmis->setMaximum(8);
-      this->glmis->draw();
-    }
-  else
-    {
-      this->glmis->loadParams(element);
-      this->glmis->draw();
-    }
-  this->glmis->draw();
-
-  ////////////////////////
-  // find WorldEntities //
-  ////////////////////////
-
-  element = root->FirstChildElement("WorldEntities");
-
-  if( element == NULL)
-    {
-      PRINTF(1)("World is missing 'WorldEntities'\n");
-    }
-  else
-    {
-      element = element->FirstChildElement();
-      // load Players/Objects/Whatever
-      PRINTF(4)("Loading WorldEntities\n");
-      while( element != NULL)
-        {
-          BaseObject* created = Factory::fabricate(element);
-          if( created != NULL )
-          {
-            if(created->isA(CL_WORLD_ENTITY))
-              this->spawn(dynamic_cast<WorldEntity*>(created));
-            printf("Created a %s: %s\n", created->getClassName(), created->getName());
-          }
-
-          // if we load a 'Player' we use it as localPlayer
-
-
-          //todo do this more elegant
-          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
-            this->sky = dynamic_cast<WorldEntity*>(created);
-          if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
-          {
-            terrain = dynamic_cast<Terrain*>(created);
-            CDEngine::getInstance()->setTerrain(terrain);
-          }
-          element = element->NextSiblingElement();
-          glmis->step(); //! @todo temporary
-        }
-      PRINTF(4)("Done loading WorldEntities\n");
-    }
-
-    //////////////////////////////
-    // LOADING ADDITIONAL STUFF //
-    //////////////////////////////
-
-    LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
-
-   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
-
-  // free the XML data
-
-  delete XMLDoc;
-  /* GENERIC LOADING PROCESS FINISHED */
-
-
-  // Create a Player
-  this->localPlayer = new Player();
-
-  Playable* playable;
-  const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  if (playableList != NULL)
-  {
-    playable = dynamic_cast<Playable*>(playableList->front());
-    this->localPlayer->setControllable(playable);
-  }
-
-
-//   //localCamera->setParent(TrackNode::getInstance());
-//  tn->addChild(this->localCamera);
-  localCamera->setClipRegion(1, 10000.0);
-//  localCamera->lookAt(playable);
-//  this->localPlayer->setParentMode(PNODE_ALL);
-  if (this->sky != NULL)
-  {
-    this->localCamera->addChild(sky);
-  }
-  SoundEngine::getInstance()->setListener(this->localCamera);
-
-
-
-  ////////////
-  // STATIC //
-  ////////////
-
-
-//   TestEntity* testEntity = new TestEntity();
-//   testEntity->setRelCoor(Vector(570, 10, -15));
-//   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity);
-
+  /* some static world entities */
   for(int i = 0; i < 100; i++)
   {
@@ -370,365 +122,18 @@
     char npcChar[10];
     sprintf (npcChar, "NPC_%d", i);
-        tmp->setName(npcChar);
+    tmp->setName(npcChar);
     tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
     this->spawn(tmp);
   }
-
-  this->music = NULL;
-  //(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
-  //music->playback();
-}
-
-ErrorMessage World::postLoad()
-{
-  this->releaseLoadScreen();
 }
 
 
 /**
- *  initializes a new World shortly before start
- *
- * this is the function, that will be loaded shortly before the world is
- * started
-*/
-ErrorMessage World::preStart()
+ *  post loads the GameWorld by initializing all resources, and set their default values.
+ */
+ErrorMessage GameWorld::postLoad()
 {
-  this->bPause = false;
+  static_cast<GameWorld*>(this)->postLoad();
 
-  /* update the object position before game start - so there are no wrong coordinates used in the first processing */
-  PNode::getNullParent()->updateNode (0.001f);
-  PNode::getNullParent()->updateNode (0.001f);
+  /* the single player specific stuff here */
 }
-
-
-/**
- *  starts the World
- */
-ErrorMessage World::start()
-{
-  this->bQuitWorld = false;
-  this->mainLoop();
-}
-
-/**
- *  stops the world.
-
-   This happens, when the player decides to end the Level.
-*/
-ErrorMessage World::stop()
-{
-  PRINTF(3)("World::stop() - got stop signal\n");
-  this->bQuitWorld= true;
-}
-
-/**
- *  pauses the Game
-*/
-ErrorMessage World::pause()
-{
-  this->isPaused = true;
-}
-
-/**
- *  ends the pause Phase
-*/
-ErrorMessage World::resume()
-{
-  this->isPaused = false;
-}
-
-/**
- *  destroys the World
-*/
-ErrorMessage World::destroy()
-{
-
-}
-
-/**
- *  shows the loading screen
-*/
-void World::displayLoadScreen ()
-{
-  PRINTF(3)("World::displayLoadScreen - start\n");
-
-  //GLMenuImageScreen*
-  this->glmis = new GLMenuImageScreen();
-  this->glmis->setMaximum(8);
-
-  PRINTF(3)("World::displayLoadScreen - end\n");
-}
-
-/**
- * @brief removes the loadscreen, and changes over to the game
- *
- * @todo take out the delay
-*/
-void World::releaseLoadScreen ()
-{
-  PRINTF(3)("World::releaseLoadScreen - start\n");
-  this->glmis->setValue(this->glmis->getMaximum());
-  PRINTF(3)("World::releaseLoadScreen - end\n");
-  delete this->glmis;
-}
-
-
-/**
- *  this returns the current game time
- * @returns elapsed game time
-*/
-double World::getGameTime()
-{
-  return this->gameTime;
-}
-
-
-
-/**
- *  synchronize local data with remote data
-*/
-void World::synchronize ()
-{
-  // Get remote input
-  // Update synchronizables
-/*  NetworkManager::getInstance()->synchronize();*/
-}
-
-
-/**
- *  run all input processing
-
-   the command node is the central input event dispatcher. the node uses the even-queue from
-   sdl and has its own event-passing-queue.
-*/
-void World::handleInput ()
-{
-  EventHandler::getInstance()->process();
-
-  // remoteinput
-}
-
-void World::tick(std::list<WorldEntity*> entityList, float dt)
-{
-  std::list<WorldEntity*>::iterator entity;
-  for (entity = entityList.begin(); entity != entityList.end(); entity++)
-    (*entity)->tick(dt);
-
-}
-
-/**
- *  advance the timeline
-
-   this calculates the time used to process one frame (with all input handling, drawing, etc)
-   the time is mesured in ms and passed to all world-entities and other classes that need
-   a heart-beat.
-*/
-void World::tick ()
-{
-  Uint32 currentFrame = SDL_GetTicks();
-  if(!this->bPause)
-    {
-      this->dt = currentFrame - this->lastFrame;
-
-      if( this->dt > 10)
-        {
-          float fps = 1000/dt;
-
-          // temporary, only for showing how fast the text-engine is
-          char tmpChar[20];
-          sprintf(tmpChar, "fps: %4.0f", fps);
-        }
-      else
-        {
-          /* the frame-rate is limited to 100 frames per second, all other things are for
-             nothing.
-          */
-          PRINTF(3)("fps = 1000 - frame rate is adjusted\n");
-          SDL_Delay(10-dt);
-          this->dt = 10;
-        }
-
-      this->dtS = (float)this->dt / 1000.0 * this->speed;
-      this->gameTime += this->dtS;
-
-      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
-      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
-
-      /* update tick the rest */
-      this->localCamera->tick(this->dtS);
-      // tick the engines
-      AnimationPlayer::getInstance()->tick(this->dtS);
-//      if (this->cycle > 5)
-        PhysicsEngine::getInstance()->tick(this->dtS);
-
-      ParticleEngine::getInstance()->tick(this->dtS);
-
-
-      /** actualy the Graphics Engine should tick the world not the other way around...
-         but since we like the things not too complicated we got it this way around
-         until there is need or time to do it the other way around.
-         @todo: GraphicsEngine ticks world: separation of processes and data...
-
-        bensch: in my opinion the GraphicsEngine could draw the world, but not tick it,
-         beceause graphics have nothing(or at least not much) to do with Motion.
-      */
-      GraphicsEngine::getInstance()->tick(this->dtS);
-    }
-  this->lastFrame = currentFrame;
-}
-
-
-/**
- *  this function gives the world a consistant state
-
-   after ticking (updating the world state) this will give a constistant
-   state to the whole system.
-*/
-void World::update()
-{
-  GraphicsEngine::getInstance()->update(this->dtS);
-  PNode::getNullParent()->updateNode (this->dtS);
-  SoundEngine::getInstance()->update();
-  //music->update();
-}
-
-
-void World::collide()
-{
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
-                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
-                                            this->objectManager.getObjectList(OM_COMMON));
-}
-
-/**
- *  render the current frame
-
-   clear all buffers and draw the world
-*/
-void World::display ()
-{
-  // clear buffer
-  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-  // set camera
-  this->localCamera->apply ();
-  // draw world
-  this->draw();
-  // draw HUD
-  /** @todo draw HUD */
-  // flip buffers
-  GraphicsEngine::swapBuffers();
-  //SDL_Surface* screen = Orxonox::getInstance()->getScreen ();
-  //SDL_Flip (screen);
-}
-
-
-/**
- *  runs through all entities calling their draw() methods
- */
-void World::draw ()
-{
-  GraphicsEngine* engine = GraphicsEngine::getInstance();
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-  engine->draw(State::getObjectManager()->getObjectList(OM_ENVIRON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_COMMON));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_00));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01));
-  engine->draw(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-
-   if( unlikely( this->showBV))  // to draw the bounding boxes of the objects at level 2 for debug purp
-   {
-     CDEngine* engine = CDEngine::getInstance();
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON_NOTICK));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_ENVIRON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_COMMON));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_00));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01));
-     engine->drawBV(State::getObjectManager()->getObjectList(OM_GROUP_01_PROJ));
-   }
-
-//   {
-//     if( entity->isVisible() ) entity->draw();
-  //FIXME
-//     entity = iterator->nextElement();
-//   }
-
-  ParticleEngine::getInstance()->draw();
-
-  if (unlikely(this->showPNodes))
-    PNode::getNullParent()->debugDraw(0);
-
-  engine->draw();
-  //TextEngine::getInstance()->draw();
-}
-
-
-/**
- * \brief main loop of the world: executing all world relevant function
- *
- * in this loop we synchronize (if networked), handle input events, give the heart-beat to
- * all other member-entities of the world (tick to player, enemies etc.), checking for
- * collisions drawing everything to the screen.
- */
-void World::mainLoop()
-{
-  this->lastFrame = SDL_GetTicks ();
-  PRINTF(3)("World::mainLoop() - Entering main loop\n");
-
-  while(!this->bQuitWorld) /* @todo implement pause */
-  {
-    ++this->cycle;
-      // Network
-    this->synchronize ();
-      // Process input
-    this->handleInput ();
-    if( this->bQuitWorld)
-      break;
-      // Process time
-    this->tick ();
-      // Process collision
-    this->collide ();
-      // Update the state
-    this->update ();
-      // Draw
-    this->display ();
-  }
-
-  PRINTF(3)("World::mainLoop() - Exiting the main loop\n");
-}
-
-
-
-/**
- *  add and spawn a new entity to this world
- * @param entity to be added
-*/
-void World::spawn(WorldEntity* entity)
-{
-//   this->entities->add (entity);
-  entity->postSpawn ();
-}
-
-void World::setPath( const char* name)
-{
-  if (this->path)
-    delete this->path;
-  if (ResourceManager::isFile(name))
-  {
-    this->path = new char[strlen(name)+1];
-    strcpy(this->path, name);
-  }
-  else
-    {
-      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
-      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
-    }
-}
-
-const char* World::getPath( void)
-{
-  return path;
-}
Index: branches/network/src/story_entities/single_player_world.h
===================================================================
--- branches/network/src/story_entities/single_player_world.h	(revision 6357)
+++ branches/network/src/story_entities/single_player_world.h	(revision 6358)
@@ -33,48 +33,7 @@
     void loadParams(const TiXmlElement* root);
 
-
-    /* classes from story-entity */
-    virtual ErrorMessage preLoad();
-    virtual ErrorMessage load ();
-    virtual ErrorMessage postLoad();
-
-    virtual ErrorMessage preStart();
-    virtual ErrorMessage start ();
-    virtual ErrorMessage stop ();
-    virtual ErrorMessage pause ();
-    virtual ErrorMessage resume ();
-    virtual ErrorMessage destroy ();
-
-    virtual void displayLoadScreen();
-    virtual void releaseLoadScreen();
-
-    /* interface to world */
-    virtual void spawn (WorldEntity* entity);
-
-
-  protected:
-    virtual void constuctorInit(const char* name, int worldID);
-
-    /* world - running functions */
-    virtual void mainLoop ();
-
-    virtual void synchronize ();
-    virtual void handleInput ();
-    virtual void tick (std::list<WorldEntity*> worldEntity, float dt);
-    virtual void tick ();
-    virtual void update ();
-    virtual void collide ();
-    virtual void draw ();
-    virtual void display ();
-
-    virtual void debug ();
-
-
-  private:
-    /* external modules interfaces */
-    Shell*     shell;
-    OggPlayer* music;
-
-    GLMenuImageScreen* glmis;           //!< The Level-Loader Display
+    ErrorMessage preLoad();
+    ErrorMessage load ();
+    ErrorMessage postLoad();
 
 };
