Index: branches/new_class_id/src/story_entities/game_world.cc
===================================================================
--- branches/new_class_id/src/story_entities/game_world.cc	(revision 9683)
+++ branches/new_class_id/src/story_entities/game_world.cc	(revision 9709)
@@ -22,5 +22,4 @@
 #include "util/loading/resource_manager.h"
 #include "state.h"
-#include "class_list.h"
 
 #include "util/loading/game_loader.h"
@@ -40,5 +39,5 @@
 #include "util/loading/factory.h"
 #include "util/loading/load_param.h"
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 #include "shell_command.h"
 
@@ -63,5 +62,6 @@
 
 #include "script_class.h"
-CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD,
+NewObjectListDefinition(GameWorld);
+CREATE_SCRIPTABLE_CLASS(GameWorld, GameWorld::classID(),
                         addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode))
                         ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack))
@@ -77,9 +77,8 @@
 
 
-
 GameWorld::GameWorld()
     : StoryEntity()
 {
-  this->setClassID(CL_GAME_WORLD, "GameWorld");
+  this->registerObject(this, GameWorld::_objectList);
   this->setName("Preloaded World - no name yet");
 
@@ -432,5 +431,5 @@
     // TICK everything
     for (i = 0; i < this->dataTank->tickLists.size(); ++i)
-      this->tick(this->dataTank->objectManager->getObjectList(this->dataTank->tickLists[i]), this->dtS);
+      this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS);
 
     /* update tick the rest */
@@ -471,25 +470,25 @@
 {
   // object-object collision detection
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_02));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_02),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
-
-
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-      this->dataTank->objectManager->getObjectList(OM_COMMON));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_COMMON));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_02));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
+
+
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+      this->dataTank->objectManager->getEntityList(OM_COMMON));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_COMMON));
 
   // ground collision detection: BSP Model
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
 }
 
@@ -567,32 +566,29 @@
   //  glLoadIdentity();
 
-  const std::list<BaseObject*>* reflectedWaters;
   MappedWater* mw;
 
-  if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
-    {
-      mw =  dynamic_cast<MappedWater*>(*it);
-
-      //camera and light
-      //this->dataTank->localCamera->apply ();
-      //this->dataTank->localCamera->project ();
-
-      LightManager::getInstance()->draw();
-
-
-      // prepare for reflection rendering
-      mw->activateReflection();
-
-      // draw everything to be included in the reflection
-      this->drawEntityList(State::getObjectManager()->getReflectionList());
-      //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
-
-      // clean up from reflection rendering
-      mw->deactivateReflection();
-    }
+  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
+       it != MappedWater::objectList().end();
+       ++it)
+  {
+    mw =  (*it);
+
+    //camera and light
+    //this->dataTank->localCamera->apply ();
+    //this->dataTank->localCamera->project ();
+
+    LightManager::getInstance()->draw();
+
+
+    // prepare for reflection rendering
+    mw->activateReflection();
+
+    // draw everything to be included in the reflection
+    this->drawEntityList(State::getObjectManager()->getReflectionList());
+    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
+    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
+
+    // clean up from reflection rendering
+    mw->deactivateReflection();
   }
 
@@ -609,30 +605,27 @@
   //glLoadIdentity();
 
-  const std::list<BaseObject*>* reflectedWaters;
   MappedWater* mw;
 
-  if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
-    {
-      mw =  dynamic_cast<MappedWater*>(*it);
-
-      //camera and light
-      //this->dataTank->localCamera->apply ();
-      //this->dataTank->localCamera->project ();
-      // prepare for reflection rendering
-      mw->activateRefraction();
-
-
-      LightManager::getInstance()->draw();
-      // draw everything to be included in the reflection
-      this->drawEntityList(State::getObjectManager()->getReflectionList());
-      //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
-
-      // clean up from reflection rendering
-      mw->deactivateRefraction();
-    }
+  for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
+       it != MappedWater::objectList().end();
+       ++it)
+  {
+    mw =  dynamic_cast<MappedWater*>(*it);
+
+    //camera and light
+    //this->dataTank->localCamera->apply ();
+    //this->dataTank->localCamera->project ();
+    // prepare for reflection rendering
+    mw->activateRefraction();
+
+
+    LightManager::getInstance()->draw();
+    // draw everything to be included in the reflection
+    this->drawEntityList(State::getObjectManager()->getReflectionList());
+    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
+    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
+
+    // clean up from reflection rendering
+    mw->deactivateRefraction();
   }
 }
@@ -659,10 +652,10 @@
   {
     /* Draw the BackGround */
-    this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND));
+    this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND));
     engine->drawBackgroundElements();
 
     /* draw all WorldEntiy groups */
     for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
+      this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
 
     AtmosphericEngine::getInstance()->draw();
@@ -672,5 +665,5 @@
       CDEngine* engine = CDEngine::getInstance();
       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-        engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
+        engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel);
     }
 
