Index: branches/new_class_id/src/lib/event/event_handler.cc
===================================================================
--- branches/new_class_id/src/lib/event/event_handler.cc	(revision 9685)
+++ branches/new_class_id/src/lib/event/event_handler.cc	(revision 9686)
@@ -28,4 +28,6 @@
 #include <algorithm>
 
+
+NewObjectListDefinition(EventHandler);
 /**
  * @brief standard constructor
@@ -33,5 +35,5 @@
 EventHandler::EventHandler ()
 {
-  this->setClassID(CL_EVENT_HANDLER, "EventHandler");
+  this->registerObject(this, EventHandler::_objectList);
   this->setName("EventHandler");
 
Index: branches/new_class_id/src/lib/event/event_handler.h
===================================================================
--- branches/new_class_id/src/lib/event/event_handler.h	(revision 9685)
+++ branches/new_class_id/src/lib/event/event_handler.h	(revision 9686)
@@ -21,5 +21,5 @@
 class EventHandler : public BaseObject
 {
-
+  NewObjectListDeclaration(EventHandler);
 public:
   virtual ~EventHandler();
Index: branches/new_class_id/src/lib/event/event_listener.cc
===================================================================
--- branches/new_class_id/src/lib/event/event_listener.cc	(revision 9685)
+++ branches/new_class_id/src/lib/event/event_listener.cc	(revision 9686)
@@ -19,4 +19,5 @@
 #include "event_handler.h"
 
+NewObjectListDefinition(EventListener);
 /**
  * @brief standard constructor
@@ -24,5 +25,5 @@
 EventListener::EventListener ()
 {
-  this->setClassID(CL_EVENT_LISTENER, "EventListener");
+  this->registerObject(this, EventListener::_objectList);
 }
 
Index: branches/new_class_id/src/lib/event/event_listener.h
===================================================================
--- branches/new_class_id/src/lib/event/event_listener.h	(revision 9685)
+++ branches/new_class_id/src/lib/event/event_listener.h	(revision 9686)
@@ -12,7 +12,8 @@
 
 //! A class for event listener
-class EventListener : virtual public BaseObject {
-
- public:
+class EventListener : virtual public BaseObject
+{
+  NewObjectListDeclaration(EventListener);
+public:
   EventListener();
   virtual ~EventListener();
Index: branches/new_class_id/src/lib/event/key_mapper.cc
===================================================================
--- branches/new_class_id/src/lib/event/key_mapper.cc	(revision 9685)
+++ branches/new_class_id/src/lib/event/key_mapper.cc	(revision 9686)
@@ -32,5 +32,5 @@
 
 
-
+NewObjectListDefinition(KeyMapper);
 
 /* initialize all variables to a reasonable value*/
@@ -116,5 +116,5 @@
 KeyMapper::KeyMapper ()
 {
-   this->setClassID(CL_KEY_MAPPER, "KeyMapper");
+  this->registerObject(this, KeyMapper::_objectList);
 }
 
Index: branches/new_class_id/src/lib/event/key_mapper.h
===================================================================
--- branches/new_class_id/src/lib/event/key_mapper.h	(revision 9685)
+++ branches/new_class_id/src/lib/event/key_mapper.h	(revision 9686)
@@ -16,4 +16,5 @@
 class KeyMapper : public BaseObject
 {
+  NewObjectListDeclaration(KeyMapper);
 public:
   //! A mapping from key-name to key-id
Index: branches/new_class_id/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/cloud_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/cloud_effect.cc	(revision 9686)
@@ -29,5 +29,5 @@
 #include "script_class.h"
 
-#include "parser/tinyxml/tinyxml.h"
+#include "class_id.h"
 
 Vector    CloudEffect::cloudColor;
@@ -48,5 +48,5 @@
 
 
-CREATE_SCRIPTABLE_CLASS(CloudEffect, CL_CLOUD_EFFECT,
+CREATE_SCRIPTABLE_CLASS(CloudEffect, CloudEffect::classID(),
                         addMethod("skyColor", ExecutorLua4<CloudEffect,float,float,float,float>(&CloudEffect::shellSkyColor))
                         ->addMethod("cloudColor", ExecutorLua4<CloudEffect,float,float,float,float>(&CloudEffect::shellCloudColor))
@@ -57,7 +57,8 @@
 
 CREATE_FACTORY(CloudEffect, CL_CLOUD_EFFECT);
+NewObjectListDefinitionID(CloudEffect, CL_CLOUD_EFFECT);
 
 CloudEffect::CloudEffect(const TiXmlElement* root) {
-    this->setClassID(CL_CLOUD_EFFECT, "CloudEffect");
+  this->registerObject(this, CloudEffect::_objectList);
 
     this->init();
Index: branches/new_class_id/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/cloud_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/cloud_effect.h	(revision 9686)
@@ -37,4 +37,5 @@
 
 class CloudEffect : public WeatherEffect {
+  NewObjectListDeclaration(CloudEffect);
 
 public:
Index: branches/new_class_id/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/fog_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/fog_effect.cc	(revision 9686)
@@ -28,7 +28,7 @@
 SHELL_COMMAND(fadeout, FogEffect, fadeOutFog);
 
-
-
-CREATE_SCRIPTABLE_CLASS(FogEffect, CL_FOG_EFFECT,
+#include "class_id.h"
+
+CREATE_SCRIPTABLE_CLASS(FogEffect, FogEffect::classID(),
                         addMethod("fadeIn", ExecutorLua0<FogEffect>(&FogEffect::fadeInFog))
                             ->addMethod("fadeOut", ExecutorLua0<FogEffect>(&FogEffect::fadeOutFog))
@@ -38,4 +38,5 @@
 
 CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
+NewObjectListDefinition(FogEffect);
 
 /**
@@ -43,6 +44,5 @@
  */
 FogEffect::FogEffect(const TiXmlElement* root) {
-    this->setClassID(CL_FOG_EFFECT, "FogEffect");
-
+  this->registerObject(this, FogEffect::_objectList);
     // Initialize values
     this->init();
@@ -85,5 +85,5 @@
   this->fogFadeInActivate = false;
   this->fogFadeOutActivate = false;
-  
+
   this->cloudColor = Vector(0.2f, 0.3f, 0.3f);
   this->skyColor = Vector(0.2f, 0.3f, 0.3f);
@@ -105,5 +105,5 @@
     LoadParam(root, "cloudcolor", this, FogEffect, setCloudColor);
     LoadParam(root, "skycolor", this, FogEffect, setSkyColor);
-    
+
     LOAD_PARAM_START_CYCLE(root, element);
     {
@@ -131,9 +131,9 @@
 
     glEnable(GL_FOG);
-    
+
     // Store cloud- and sky color before the snow
     this->oldCloudColor = CloudEffect::cloudColor;
     this->oldSkyColor   = CloudEffect::skyColor;
-    
+
     // Change the colors
     CloudEffect::changeCloudColor(this->cloudColor, this->fogFadeInDuration);
@@ -241,5 +241,5 @@
     this->fogFadeInActivate = false;
 
-    
+
     // If Fog is off, turn it on first
     if (!this->fogActivate)
Index: branches/new_class_id/src/lib/graphics/effects/fog_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/fog_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/fog_effect.h	(revision 9686)
@@ -15,4 +15,5 @@
 class FogEffect : public WeatherEffect
 {
+  NewObjectListDeclaration(FogEffect);
 public:
   FogEffect(const TiXmlElement* root = NULL);
@@ -75,5 +76,5 @@
       this->fogActivate = true;
   }
-  
+
   inline void setCloudColor(float colorX, float colorY, float colorZ)
   {
@@ -119,6 +120,6 @@
 
   Vector        colorVector;
-  float         localTimer; 
-  
+  float         localTimer;
+
   Vector oldSkyColor;
   Vector oldCloudColor;
Index: branches/new_class_id/src/lib/graphics/effects/lense_flare.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/lense_flare.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/lense_flare.cc	(revision 9686)
@@ -33,10 +33,8 @@
 #include "camera.h"
 
-
-
-
+#include "class_id.h"
 
 CREATE_FACTORY(LenseFlare, CL_LENSE_FLARE);
-
+NewObjectListDefinitionID(LenseFlare, CL_LENSE_FLARE);
 
 /**
@@ -45,5 +43,5 @@
  */
 LenseFlare::LenseFlare(const TiXmlElement* root) {
-    this->setClassID(CL_LENSE_FLARE, "LenseFlare");
+  this->registerObject(this, LenseFlare::_objectList);
 
     /*          length                      image scale */
Index: branches/new_class_id/src/lib/graphics/effects/lense_flare.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/lense_flare.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/lense_flare.h	(revision 9686)
@@ -26,4 +26,5 @@
 class LenseFlare : public GraphicsEffect
 {
+  NewObjectListDeclaration(LenseFlare);
   public:
     LenseFlare(const TiXmlElement* root = NULL);
Index: branches/new_class_id/src/lib/graphics/effects/lightning_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/lightning_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/lightning_effect.cc	(revision 9686)
@@ -23,18 +23,14 @@
 #include "effects/billboard.h"
 
-#include "glincl.h"
-#include "parser/tinyxml/tinyxml.h"
-
 #include "shell_command.h"
 #include "light.h"
 #include "cloud_effect.h"
 #include "script_class.h"
+#include "class_id.h"
 
 SHELL_COMMAND(activate, LightningEffect, activateLightning);
 SHELL_COMMAND(deactivate, LightningEffect, deactivateLightning);
 
-
-
-CREATE_SCRIPTABLE_CLASS(LightningEffect, CL_LIGHTNING_EFFECT,
+CREATE_SCRIPTABLE_CLASS(LightningEffect, LightningEffect::classID(),
                         addMethod("activate", ExecutorLua0<LightningEffect>(&LightningEffect::activate))
                             ->addMethod("deactivate", ExecutorLua0<LightningEffect>(&LightningEffect::deactivate))
@@ -42,8 +38,8 @@
 
 CREATE_FACTORY(LightningEffect, CL_LIGHTNING_EFFECT);
+NewObjectListDefinitionID(LightningEffect, CL_LIGHTNING_EFFECT);
 
 LightningEffect::LightningEffect(const TiXmlElement* root) {
-    this->setClassID(CL_LIGHTNING_EFFECT, "LightningEffect");
-
+  this->registerObject(this, LightningEffect::_objectList);
     this->init();
 
Index: branches/new_class_id/src/lib/graphics/effects/lightning_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/lightning_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/lightning_effect.h	(revision 9686)
@@ -17,97 +17,106 @@
 class Light;
 
-class LightningEffect : public WeatherEffect {
+class LightningEffect : public WeatherEffect
+{
+  NewObjectListDeclaration(LightningEffect);
 public:
-    LightningEffect(const TiXmlElement* root = NULL);
-    virtual ~LightningEffect();
+  LightningEffect(const TiXmlElement* root = NULL);
+  virtual ~LightningEffect();
 
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void init();
+  virtual void init();
 
-    virtual void activate();
-    virtual void deactivate();
+  virtual void activate();
+  virtual void deactivate();
 
-    inline  void activateLightning() {
-        this->activate();
-    }
-    inline  void deactivateLightning() {
-        this->deactivate();
-    }
+  inline  void activateLightning()
+  {
+    this->activate();
+  }
+  inline  void deactivateLightning()
+  {
+    this->deactivate();
+  }
 
-    virtual void tick(float dt);
+  virtual void tick(float dt);
 
-    void coord(float x, float y, float z);
-    void setFlashSize(float width, float height, float seedWidth, float seedHeight);
+  void coord(float x, float y, float z);
+  void setFlashSize(float width, float height, float seedWidth, float seedHeight);
 
-    inline void setLightningOption(const std::string& option) {
-        if (option == "activate")
-            this->lightningActivate = true;
-        if (option == "movelightning")
-            this->lightningMove = true;
-    }
+  inline void setLightningOption(const std::string& option)
+  {
+    if (option == "activate")
+      this->lightningActivate = true;
+    if (option == "movelightning")
+      this->lightningMove = true;
+  }
 
-    inline void setFlashFrequency(float baseFrequency, float seedTime) {
-        this->flashFrequencyBase = baseFrequency;
-        this->flashFrequency = baseFrequency;
-        this->flashFrequencySeed = seedTime;
-    }
+  inline void setFlashFrequency(float baseFrequency, float seedTime)
+  {
+    this->flashFrequencyBase = baseFrequency;
+    this->flashFrequency = baseFrequency;
+    this->flashFrequencySeed = seedTime;
+  }
 
-    inline void setFlashConstTime(float holdTime) {
-        this->flashHoldTime = holdTime;
-    }
+  inline void setFlashConstTime(float holdTime)
+  {
+    this->flashHoldTime = holdTime;
+  }
 
-    inline void setFlashRisingTime(float flashRisingTime) {
-        if(flashRisingTime > this->flashHoldTime)
-            this->flashRisingTime = this->flashHoldTime * 0.5;
-        else
-            this->flashRisingTime = flashRisingTime;
-    }
+  inline void setFlashRisingTime(float flashRisingTime)
+  {
+    if(flashRisingTime > this->flashHoldTime)
+      this->flashRisingTime = this->flashHoldTime * 0.5;
+    else
+      this->flashRisingTime = flashRisingTime;
+  }
 
-    inline void setFlashSeed(float seedX, float seedZ) {
-        this->seedX = seedX;
-        this->seedZ = seedZ;
-    }
+  inline void setFlashSeed(float seedX, float seedZ)
+  {
+    this->seedX = seedX;
+    this->seedZ = seedZ;
+  }
 
 
 private:
 
-    void newCoordinates();
-    void setTexture();
-    void switchTexture();
+  void newCoordinates();
+  void setTexture();
+  void switchTexture();
 
-    Billboard* thunderBolt[4];
-    bool thunderTextureA;
+  Billboard* thunderBolt[4];
+  bool thunderTextureA;
 
-    bool lightningActivate;
-    bool lightningMove;
+  bool lightningActivate;
+  bool lightningMove;
 
-    float flashFrequency;
-    float flashFrequencyBase;
-    float flashHoldTime;
-    float flashRisingTime;
+  float flashFrequency;
+  float flashFrequencyBase;
+  float flashHoldTime;
+  float flashRisingTime;
 
-    float time;
+  float time;
 
-    float width;
-    float height;
-    float seedWidth;
-    float seedHeight;
+  float width;
+  float height;
+  float seedWidth;
+  float seedHeight;
 
-    float seedX;
-    float seedZ;
-    float flashFrequencySeed;
+  float seedX;
+  float seedZ;
+  float flashFrequencySeed;
 
-    float mainPosX;
-    float mainPosY;
-    float mainPosZ;
+  float mainPosX;
+  float mainPosY;
+  float mainPosZ;
 
-    Vector origSkyColor;
-    Vector cameraCoor;
+  Vector origSkyColor;
+  Vector cameraCoor;
 
-    Light* flashLight;
+  Light* flashLight;
 
-    OrxSound::SoundSource    soundSource;
-    OrxSound::SoundBuffer*   thunderBuffer;
+  OrxSound::SoundSource    soundSource;
+  OrxSound::SoundBuffer*   thunderBuffer;
 
 };
Index: branches/new_class_id/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/rain_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/rain_effect.cc	(revision 9686)
@@ -31,5 +31,5 @@
 #include "script_class.h"
 
-#include "parser/tinyxml/tinyxml.h"
+#include "class_id.h"
 
 // Define shell commands
@@ -41,5 +41,5 @@
 
 
-CREATE_SCRIPTABLE_CLASS(RainEffect, CL_RAIN_EFFECT,
+CREATE_SCRIPTABLE_CLASS(RainEffect, RainEffect::classID(),
                         addMethod("startRaining", ExecutorLua0<RainEffect>(&RainEffect::startRaining))
                             ->addMethod("stopRaining", ExecutorLua0<RainEffect>(&RainEffect::stopRaining))
@@ -49,4 +49,5 @@
 
 CREATE_FACTORY(RainEffect, CL_RAIN_EFFECT);
+NewObjectListDefinitionID(RainEffect, CL_RAIN_EFFECT);
 
 /**
@@ -54,6 +55,5 @@
  */
 RainEffect::RainEffect(const TiXmlElement* root) {
-    this->setClassID(CL_RAIN_EFFECT, "RainEffect");
-
+  this->registerObject(this, RainEffect::_objectList);
     this->init();
 
Index: branches/new_class_id/src/lib/graphics/effects/rain_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/rain_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/rain_effect.h	(revision 9686)
@@ -25,4 +25,5 @@
 class RainEffect : public WeatherEffect
 {
+  NewObjectListDeclaration(RainEffect);
 public:
   RainEffect(const TiXmlElement* root = NULL);
@@ -136,5 +137,5 @@
   Vector                      skyColor;
   Vector                      cloudColor;
-  
+
   LightManager*               lightMan;
 
Index: branches/new_class_id/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/snow_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/snow_effect.cc	(revision 9686)
@@ -30,5 +30,5 @@
 #include "cloud_effect.h"
 
-#include "parser/tinyxml/tinyxml.h"
+#include "class_id.h"
 
 SHELL_COMMAND(activate, SnowEffect, activateSnow);
@@ -36,5 +36,5 @@
 
 
-CREATE_SCRIPTABLE_CLASS(SnowEffect, CL_SNOW_EFFECT,
+CREATE_SCRIPTABLE_CLASS(SnowEffect, SnowEffect::classID(),
                             addMethod("activate", ExecutorLua0<SnowEffect>(&SnowEffect::activate))
                             ->addMethod("deactivate", ExecutorLua0<SnowEffect>(&SnowEffect::deactivate))
@@ -42,8 +42,9 @@
 
 CREATE_FACTORY(SnowEffect, CL_SNOW_EFFECT);
+NewObjectListDefinitionID(SnowEffect, CL_SNOW_EFFECT);
 
 SnowEffect::SnowEffect(const TiXmlElement* root)
 {
-        this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
+  this->registerObject(this, SnowEffect::_objectList);
 
         this->init();
Index: branches/new_class_id/src/lib/graphics/effects/snow_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/snow_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/snow_effect.h	(revision 9686)
@@ -21,111 +21,126 @@
 #include "sound_buffer.h"
 
-class SnowEffect : public WeatherEffect {
+class SnowEffect : public WeatherEffect
+{
+  NewObjectListDeclaration(SnowEffect);
 public:
-    SnowEffect(const TiXmlElement* root = NULL);
-    virtual ~SnowEffect();
+  SnowEffect(const TiXmlElement* root = NULL);
+  virtual ~SnowEffect();
 
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void init();
+  virtual void init();
 
-    virtual void activate();
-    virtual void deactivate();
+  virtual void activate();
+  virtual void deactivate();
 
-    inline void activateSnow() {
-        this->activate();
-    }
-    inline void deactivateSnow() {
-        this->deactivate();
-    }
+  inline void activateSnow()
+  {
+    this->activate();
+  }
+  inline void deactivateSnow()
+  {
+    this->deactivate();
+  }
 
-    virtual void draw() const;
-    virtual void tick(float dt);
+  virtual void draw() const;
+  virtual void tick(float dt);
 
 
-    inline void numParticles(int n) {
-        this->particles = n;
-    }
-    inline void materialTexture(const std::string& texture) {
-        this->texture = texture;
-    }
-    inline void lifeSpan(float lifeSpan, float randomLifeSpan) {
-        this->snowLife = lifeSpan;
-        this->randomLife = randomLifeSpan;
-    }
-    inline void radius(float radius, float randomRadius) {
-        this->snowRadius = radius;
-        this->randomRadius = randomRadius;
-    }
-    inline void mass(float mass, float randomMass) {
-        this->snowMass = mass;
-        this->randomMass = randomMass;
-    }
-    inline void emissionRate(float emissionRate) {
-        this->rate = emissionRate;
-    }
-    inline void emissionVelocity(float velocity, float randomVelocity) {
-        this->velocity = velocity;
-        this->randomVelocity = randomVelocity;
-    }
-    inline void size(float sizeX, float sizeY) {
-        this->snowSize = Vector2D(sizeX, sizeY);
-    }
-    inline void coord(float x, float y, float z) {
-        this->snowCoord = Vector(x, y, z);
-    }
-    inline void wind(int force) {
-        this->snowWindForce = force;
-    }
-    inline void setCloudColor(float colorX, float colorY, float colorZ)
-    {
-      this->cloudColor = Vector(colorX, colorY, colorZ);
-    }
-    inline void setSkyColor(float colorX, float colorY, float colorZ)
-    {
-      this->skyColor = Vector(colorX, colorY, colorZ);
-    }
-    inline void setFadeTime(float time)
-    {
-      this->fadeTime = time;
-    }
+  inline void numParticles(int n)
+  {
+    this->particles = n;
+  }
+  inline void materialTexture(const std::string& texture)
+  {
+    this->texture = texture;
+  }
+  inline void lifeSpan(float lifeSpan, float randomLifeSpan)
+  {
+    this->snowLife = lifeSpan;
+    this->randomLife = randomLifeSpan;
+  }
+  inline void radius(float radius, float randomRadius)
+  {
+    this->snowRadius = radius;
+    this->randomRadius = randomRadius;
+  }
+  inline void mass(float mass, float randomMass)
+  {
+    this->snowMass = mass;
+    this->randomMass = randomMass;
+  }
+  inline void emissionRate(float emissionRate)
+  {
+    this->rate = emissionRate;
+  }
+  inline void emissionVelocity(float velocity, float randomVelocity)
+  {
+    this->velocity = velocity;
+    this->randomVelocity = randomVelocity;
+  }
+  inline void size(float sizeX, float sizeY)
+  {
+    this->snowSize = Vector2D(sizeX, sizeY);
+  }
+  inline void coord(float x, float y, float z)
+  {
+    this->snowCoord = Vector(x, y, z);
+  }
+  inline void wind(int force)
+  {
+    this->snowWindForce = force;
+  }
+  inline void setCloudColor(float colorX, float colorY, float colorZ)
+  {
+    this->cloudColor = Vector(colorX, colorY, colorZ);
+  }
+  inline void setSkyColor(float colorX, float colorY, float colorZ)
+  {
+    this->skyColor = Vector(colorX, colorY, colorZ);
+  }
+  inline void setFadeTime(float time)
+  {
+    this->fadeTime = time;
+  }
 
-    inline void setSnowOption(const std::string& option) {
-        /*if (option == "fade") this->snowFade = true;*/
-        if (option == "movesnow")
-            this->snowMove = true;
-        if (option == "activate")
-            this->snowActivate = true;
-    }
+  inline void setSnowOption(const std::string& option)
+  {
+    /*if (option == "fade") this->snowFade = true;*/
+    if (option == "movesnow")
+      this->snowMove = true;
+    if (option == "activate")
+      this->snowActivate = true;
+  }
 
 
 private:
-    int               particles;
-    std::string       texture;
-    float             snowLife, randomLife;
-    float             snowRadius, randomRadius;
-    float             snowMass, randomMass;
-    float             rate;
-    float             velocity, randomVelocity;
-    float             angle, randomAngle;
-    float             alpha;
-    float             fadeTime;
-    Vector            snowCoord;
-    Vector2D          snowSize;
-    int               snowWindForce;
+  int               particles;
+  std::string       texture;
+  float             snowLife, randomLife;
+  float             snowRadius, randomRadius;
+  float             snowMass, randomMass;
+  float             rate;
+  float             velocity, randomVelocity;
+  float             angle, randomAngle;
+  float             alpha;
+  float             fadeTime;
+  Vector            snowCoord;
+  Vector2D          snowSize;
+  int               snowWindForce;
 
-    bool              snowMove;
-    bool              snowActivate;
+  bool              snowMove;
+  bool              snowActivate;
 
-    PlaneEmitter*     emitter;
+  PlaneEmitter*     emitter;
 
-    static SpriteParticles*   snowParticles;
-    OrxSound::SoundSource     soundSource;
-    OrxSound::SoundBuffer*    windBuffer;
+  static SpriteParticles*   snowParticles;
+  OrxSound::SoundSource     soundSource;
+  OrxSound::SoundBuffer*    windBuffer;
 
-    Vector            oldSkyColor;
-    Vector            oldCloudColor;
-    Vector            skyColor;
-    Vector            cloudColor;
+  Vector            oldSkyColor;
+  Vector            oldCloudColor;
+  Vector            skyColor;
+  Vector            cloudColor;
 };
 
Index: branches/new_class_id/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/volfog_effect.cc	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/volfog_effect.cc	(revision 9686)
@@ -47,10 +47,11 @@
 
 
-
+#include "class_id.h"
 
 CREATE_FACTORY(VolFogEffect, CL_VOLFOG_EFFECT);
+NewObjectListDefinitionID(VolFogEffect, CL_VOLFOG_EFFECT);
 
 VolFogEffect::VolFogEffect(const TiXmlElement* root) {
-    this->setClassID(CL_VOLFOG_EFFECT, "VolFogEffect");
+  this->registerObject(this, VolFogEffect::_objectList);
 
     if (root != NULL)
Index: branches/new_class_id/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- branches/new_class_id/src/lib/graphics/effects/volfog_effect.h	(revision 9685)
+++ branches/new_class_id/src/lib/graphics/effects/volfog_effect.h	(revision 9686)
@@ -11,21 +11,23 @@
 #include "glincl.h"
 
-class VolFogEffect : public WeatherEffect {
+class VolFogEffect : public WeatherEffect
+{
+  NewObjectListDeclaration(VolFogEffect);
 public:
-    VolFogEffect(const TiXmlElement* root = NULL);
-    virtual ~VolFogEffect();
+  VolFogEffect(const TiXmlElement* root = NULL);
+  virtual ~VolFogEffect();
 
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void init();
+  virtual void init();
 
-    virtual void activate();
-    virtual void deactivate();
+  virtual void activate();
+  virtual void deactivate();
 
-    virtual void draw() const;
-    virtual void tick(float dt);
+  virtual void draw() const;
+  virtual void tick(float dt);
 
 private:
-    GLfloat fogColor[4];
+  GLfloat fogColor[4];
 
 };
Index: branches/new_class_id/src/lib/lang/base_object.cc
===================================================================
--- branches/new_class_id/src/lib/lang/base_object.cc	(revision 9685)
+++ branches/new_class_id/src/lib/lang/base_object.cc	(revision 9686)
@@ -95,4 +95,19 @@
 }
 
+
+/**
+ * @brief Seeks in the Inheritance if it matches objectList.
+ * @param objectList The ObjectList this should be a member of (by Pointer-comparison).
+ * @return True if found, false if not.
+ */
+bool BaseObject::isA(const NewClassID& classID) const
+{
+  ClassList::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    if (*(*it)._objectList == classID)
+      return true;
+  return false;
+}
+
 /**
  * @brief Seeks in the Inheritance if it matches objectList.
Index: branches/new_class_id/src/lib/lang/base_object.h
===================================================================
--- branches/new_class_id/src/lib/lang/base_object.h	(revision 9685)
+++ branches/new_class_id/src/lib/lang/base_object.h	(revision 9686)
@@ -52,4 +52,5 @@
 
   bool isA(const NewObjectListBase& objectList) const;
+  bool isA(const NewClassID& classID) const;
   bool isA(int classID) const;
   bool isA(const std::string& className) const;
Index: branches/new_class_id/src/lib/lang/new_object_list.h
===================================================================
--- branches/new_class_id/src/lib/lang/new_object_list.h	(revision 9685)
+++ branches/new_class_id/src/lib/lang/new_object_list.h	(revision 9686)
@@ -15,7 +15,15 @@
 
 
+
+/**
+ * @brief Use this macro to easily declare a Class to store its own ObjectListDeclaration
+ * @param ClassName the Name of the Class.
+ * @note: Using this inside of a Class means, that you loose the member: _objectList, while defining
+ * two new functions objectList() and classID().
+ */
 #define NewObjectListDeclaration(ClassName) \
   public: \
-   static const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
+   static inline const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
+   static inline const NewClassID classID() { return ClassName::_objectList.identity(); }; \
   private: \
    static NewObjectList<ClassName> _objectList
@@ -40,7 +48,9 @@
 
 public:
+  inline const NewClassID& identity() const { return _identity; };
   inline int id() const { return _identity.id(); };
   inline const std::string& name() const { return _identity.name(); };
   bool operator==(int id) const { return _identity == id; };
+  bool operator==(const NewClassID& id) const { return _identity == id; };
   bool operator==(const std::string& name) const { return _identity == name; };
 
Index: branches/new_class_id/src/lib/particles/box_emitter.cc
===================================================================
--- branches/new_class_id/src/lib/particles/box_emitter.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/box_emitter.cc	(revision 9686)
@@ -23,11 +23,9 @@
 #include "util/loading/factory.h"
 #include "debug.h"
-#include "stdlibincl.h"
 
-
-
+#include "class_id.h"
 
 CREATE_FACTORY(BoxEmitter, CL_BOX_EMITTER);
-
+NewObjectListDefinitionID(BoxEmitter, CL_BOX_EMITTER);
 /**
  *  standard constructor
@@ -68,5 +66,5 @@
 void BoxEmitter::init()
 {
-  this->setClassID(CL_BOX_EMITTER, "BoxEmitter");
+  this->registerObject(this, BoxEmitter::_objectList);
   this->setSize(1.0f,1.0f,1.0f);
 }
@@ -103,7 +101,7 @@
 
     Vector box = this->getAbsCoor() +
-        xDir * ((float)rand()/RAND_MAX -.5) +
-        yDir * ((float)rand()/RAND_MAX -.5) +
-        zDir * ((float)rand()/RAND_MAX -.5);
+                 xDir * ((float)rand()/RAND_MAX -.5) +
+                 yDir * ((float)rand()/RAND_MAX -.5) +
+                 zDir * ((float)rand()/RAND_MAX -.5);
 
     // ROTATIONAL CALCULATION (this must not be done for all types of particles.)
Index: branches/new_class_id/src/lib/particles/box_emitter.h
===================================================================
--- branches/new_class_id/src/lib/particles/box_emitter.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/box_emitter.h	(revision 9686)
@@ -19,4 +19,5 @@
 class BoxEmitter : public ParticleEmitter
 {
+  NewObjectListDeclaration(BoxEmitter);
   friend class ParticleSystem;
 public:
Index: branches/new_class_id/src/lib/particles/dot_emitter.cc
===================================================================
--- branches/new_class_id/src/lib/particles/dot_emitter.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/dot_emitter.cc	(revision 9686)
@@ -26,6 +26,7 @@
 
 
-
+#include "class_id.h"
 CREATE_FACTORY(DotEmitter, CL_DOT_EMITTER);
+NewObjectListDefinitionID(DotEmitter, CL_DOT_EMITTER);
 
 /**
@@ -66,5 +67,5 @@
 void DotEmitter::init()
 {
-  this->setClassID(CL_DOT_EMITTER, "DotEmitter");
+  this->registerObject(this, DotEmitter::_objectList);
 }
 
Index: branches/new_class_id/src/lib/particles/dot_emitter.h
===================================================================
--- branches/new_class_id/src/lib/particles/dot_emitter.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/dot_emitter.h	(revision 9686)
@@ -12,4 +12,6 @@
 class DotEmitter : public ParticleEmitter
 {
+  NewObjectListDeclaration(DotEmitter);
+
   friend class ParticleSystem;
 public:
Index: branches/new_class_id/src/lib/particles/dot_particles.cc
===================================================================
--- branches/new_class_id/src/lib/particles/dot_particles.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/dot_particles.cc	(revision 9686)
@@ -29,4 +29,5 @@
 
 CREATE_FACTORY(DotParticles, CL_DOT_PARTICLES);
+NewObjectListDefinitionID(DotParticles, CL_DOT_PARTICLES);
 
 SHELL_COMMAND(texture, DotParticles, setMaterialTexture)
@@ -68,5 +69,5 @@
 void DotParticles::init()
 {
-  this->setClassID(CL_DOT_PARTICLES, "DotParticles");
+  this->registerObject(this, DotParticles::_objectList);
 
   this->material.setDiffuseMap("maps/radial-trans-noise.png");
Index: branches/new_class_id/src/lib/particles/dot_particles.h
===================================================================
--- branches/new_class_id/src/lib/particles/dot_particles.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/dot_particles.h	(revision 9686)
@@ -13,4 +13,5 @@
 class DotParticles : public ParticleSystem
 {
+  NewObjectListDeclaration(DotParticles);
 
 public:
Index: branches/new_class_id/src/lib/particles/model_particles.cc
===================================================================
--- branches/new_class_id/src/lib/particles/model_particles.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/model_particles.cc	(revision 9686)
@@ -29,4 +29,5 @@
 
 CREATE_FACTORY(ModelParticles, CL_MODEL_PARTICLES);
+NewObjectListDefinitionID(ModelParticles, CL_MODEL_PARTICLES);
 
 SHELL_COMMAND(texture, ModelParticles, setMaterialTexture)
@@ -68,5 +69,5 @@
 void ModelParticles::init()
 {
-  this->setClassID(CL_MODEL_PARTICLES, "ModelParticles");
+  this->registerObject(this, ModelParticles::_objectList);
 
   this->material.setDiffuseMap("maps/radial-trans-noise.png");
Index: branches/new_class_id/src/lib/particles/model_particles.h
===================================================================
--- branches/new_class_id/src/lib/particles/model_particles.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/model_particles.h	(revision 9686)
@@ -13,4 +13,6 @@
 class ModelParticles : public ParticleSystem
 {
+  NewObjectListDeclaration(ModelParticles);
+
 public:
   ModelParticles(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT);
Index: branches/new_class_id/src/lib/particles/particle_emitter.cc
===================================================================
--- branches/new_class_id/src/lib/particles/particle_emitter.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/particle_emitter.cc	(revision 9686)
@@ -22,7 +22,6 @@
 #include "util/loading/load_param.h"
 #include "debug.h"
-#include "stdlibincl.h"
-
-
+
+NewObjectListDefinition(ParticleEmitter);
 
 /**
@@ -31,5 +30,5 @@
 ParticleEmitter::ParticleEmitter(float emissionRate, float velocity, float angle)
 {
-  this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
+  this->registerObject(this, ParticleEmitter::_objectList);
 
   this->system = NULL;
Index: branches/new_class_id/src/lib/particles/particle_emitter.h
===================================================================
--- branches/new_class_id/src/lib/particles/particle_emitter.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/particle_emitter.h	(revision 9686)
@@ -23,4 +23,5 @@
 class ParticleEmitter : public PNode
 {
+  NewObjectListDeclaration(ParticleEmitter);
   friend class ParticleSystem;
 public:
Index: branches/new_class_id/src/lib/particles/particle_system.cc
===================================================================
--- branches/new_class_id/src/lib/particles/particle_system.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/particle_system.cc	(revision 9686)
@@ -32,4 +32,5 @@
 #include <algorithm>
 
+NewObjectListDefinition(ParticleSystem);
 
 /**
@@ -40,5 +41,5 @@
 ParticleSystem::ParticleSystem (unsigned int maxCount)
 {
-  this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
+  this->registerObject(this, ParticleSystem::_objectList);
 
   this->setMaxCount(PARTICLE_DEFAULT_MAX_COUNT);
@@ -134,5 +135,5 @@
     if (emitter != NULL)
     {
-      if (emitter->isA(CL_PARTICLE_EMITTER))
+      if (emitter->isA(ParticleEmitter::classID()))
         this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
       else
Index: branches/new_class_id/src/lib/particles/particle_system.h
===================================================================
--- branches/new_class_id/src/lib/particles/particle_system.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/particle_system.h	(revision 9686)
@@ -56,4 +56,5 @@
 //! A class to handle ParticleSystems
 class ParticleSystem : public WorldEntity, public PhysicsInterface {
+  NewObjectListDeclaration(ParticleSystem);
 
  public:
Index: branches/new_class_id/src/lib/particles/plane_emitter.cc
===================================================================
--- branches/new_class_id/src/lib/particles/plane_emitter.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/plane_emitter.cc	(revision 9686)
@@ -23,10 +23,9 @@
 #include "util/loading/factory.h"
 #include "debug.h"
-#include "stdlibincl.h"
 
-
-
+#include "class_id.h"
 
 CREATE_FACTORY(PlaneEmitter, CL_PLANE_EMITTER);
+NewObjectListDefinitionID(PlaneEmitter, CL_PLANE_EMITTER);
 
 /**
@@ -68,5 +67,5 @@
 void PlaneEmitter::init()
 {
-  this->setClassID(CL_PLANE_EMITTER, "PlaneEmitter");
+  this->registerObject(this, PlaneEmitter::_objectList);
   this->setSize(1.0f, 1.0f);
 }
Index: branches/new_class_id/src/lib/particles/plane_emitter.h
===================================================================
--- branches/new_class_id/src/lib/particles/plane_emitter.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/plane_emitter.h	(revision 9686)
@@ -21,10 +21,12 @@
 class PlaneEmitter : public ParticleEmitter
 {
+  NewObjectListDeclaration(PlaneEmitter);
+
   friend class ParticleSystem;
 public:
   PlaneEmitter(const Vector2D& size = PLANE_EMITTER_DEFAULT_SIZE,
-             float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE,
-             float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY,
-             float angle = PARTICLE_EMITTER_DEFAULT_SPREAD);
+               float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE,
+               float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY,
+               float angle = PARTICLE_EMITTER_DEFAULT_SPREAD);
   PlaneEmitter(const TiXmlElement* root);
   virtual ~PlaneEmitter();
Index: branches/new_class_id/src/lib/particles/spark_particles.cc
===================================================================
--- branches/new_class_id/src/lib/particles/spark_particles.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/spark_particles.cc	(revision 9686)
@@ -32,4 +32,5 @@
 
 CREATE_FACTORY(SparkParticles, CL_SPARK_PARTICLES);
+NewObjectListDefinitionID(SparkParticles, CL_SPARK_PARTICLES);
 
 /**
@@ -67,5 +68,5 @@
 void SparkParticles::init()
 {
-  this->setClassID(CL_SPARK_PARTICLES, "SparkParticles");
+  this->registerObject(this, SparkParticles::_objectList);
 }
 
Index: branches/new_class_id/src/lib/particles/spark_particles.h
===================================================================
--- branches/new_class_id/src/lib/particles/spark_particles.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/spark_particles.h	(revision 9686)
@@ -13,4 +13,5 @@
 class SparkParticles : public ParticleSystem
 {
+  NewObjectListDeclaration(SparkParticles);
 
 public:
Index: branches/new_class_id/src/lib/particles/sprite_particles.cc
===================================================================
--- branches/new_class_id/src/lib/particles/sprite_particles.cc	(revision 9685)
+++ branches/new_class_id/src/lib/particles/sprite_particles.cc	(revision 9686)
@@ -29,4 +29,5 @@
 
 CREATE_FACTORY(SpriteParticles, CL_SPRITE_PARTICLES);
+NewObjectListDefinitionID(SpriteParticles, CL_SPRITE_PARTICLES);
 
 SHELL_COMMAND(texture, SpriteParticles, setMaterialTexture)
@@ -68,5 +69,5 @@
 void SpriteParticles::init()
 {
-  this->setClassID(CL_SPRITE_PARTICLES, "SpriteParticles");
+  this->registerObject(this, SpriteParticles::_objectList);
 
   this->material.setDiffuseMap("maps/radial-trans-noise.png");
Index: branches/new_class_id/src/lib/particles/sprite_particles.h
===================================================================
--- branches/new_class_id/src/lib/particles/sprite_particles.h	(revision 9685)
+++ branches/new_class_id/src/lib/particles/sprite_particles.h	(revision 9686)
@@ -13,4 +13,5 @@
 class SpriteParticles : public ParticleSystem
 {
+  NewObjectListDeclaration(SpriteParticles);
 
 public:
Index: branches/new_class_id/src/lib/physics/fields/field.cc
===================================================================
--- branches/new_class_id/src/lib/physics/fields/field.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/field.cc	(revision 9686)
@@ -23,7 +23,8 @@
 #include "util/loading/load_param.h"
 
+NewObjectListDefinition(Field);
 
 /**
- *  standard constructor
+ * @brief standard constructor
 */
 Field::Field ()
@@ -33,7 +34,6 @@
 
 /**
- *  standard deconstructor
-
-*/
+ * @brief standard deconstructor
+ */
 Field::~Field ()
 {
@@ -42,9 +42,9 @@
 
 /**
-  \brief initializes a Field
-*/
+  * @brief initializes a Field
+ */
 void Field::init()
 {
-  this->setClassID(CL_FIELD, "Field");
+  this->registerObject(this, Field::_objectList);
   this->setMagnitude(1);
   this->setAttenuation(0);
@@ -54,5 +54,5 @@
 
 /**
-* @param root The XML-element to load settings from
+ * @param root The XML-element to load settings from
  */
 void Field::loadParams(const TiXmlElement* root)
Index: branches/new_class_id/src/lib/physics/fields/field.h
===================================================================
--- branches/new_class_id/src/lib/physics/fields/field.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/field.h	(revision 9686)
@@ -16,9 +16,9 @@
 /*!
  * @file field.h
-  *  abstract definition of a Physical Field
-
-    This is a totally abstract class, that only enables different Physical Fields to
-    exist on a common Level.
-*/
+ * abstract definition of a Physical Field
+ *
+ * This is a totally abstract class, that only enables different Physical Fields to
+ * exist on a common Level.
+ */
 
 #ifndef _FIELD_H
@@ -34,4 +34,5 @@
 class Field : public PNode
 {
+  NewObjectListDeclaration(Field);
  public:
   Field();
Index: branches/new_class_id/src/lib/physics/fields/gravity.cc
===================================================================
--- branches/new_class_id/src/lib/physics/fields/gravity.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/gravity.cc	(revision 9686)
@@ -21,5 +21,6 @@
 #include "util/loading/factory.h"
 
-
+#include "class_id.h"
+NewObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY);
 
 CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY);
@@ -27,5 +28,5 @@
 Gravity::Gravity(const TiXmlElement* root)
 {
-  this->setClassID(CL_FIELD_GRAVITY, "Gravity");
+  this->registerObject(this, Gravity::_objectList);
 
   if (root != NULL)
Index: branches/new_class_id/src/lib/physics/fields/gravity.h
===================================================================
--- branches/new_class_id/src/lib/physics/fields/gravity.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/gravity.h	(revision 9686)
@@ -16,4 +16,5 @@
 //! A class for ...
 class Gravity : public Field {
+  NewObjectListDeclaration(Gravity);
 
  public:
Index: branches/new_class_id/src/lib/physics/fields/point_gravity.cc
===================================================================
--- branches/new_class_id/src/lib/physics/fields/point_gravity.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/point_gravity.cc	(revision 9686)
@@ -20,4 +20,7 @@
 
 
+#include "class_id.h"
+NewObjectListDefinitionID(PointGravity, CL_FIELD_POINT_GRAVITY);
+
 
 /**
@@ -27,5 +30,5 @@
 PointGravity::PointGravity ()
 {
-   this->setClassID(CL_FIELD_POINT_GRAVITY, "PointGravity");
+  this->registerObject(this, PointGravity::_objectList);
 }
 
Index: branches/new_class_id/src/lib/physics/fields/point_gravity.h
===================================================================
--- branches/new_class_id/src/lib/physics/fields/point_gravity.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/point_gravity.h	(revision 9686)
@@ -1,3 +1,3 @@
-/*! 
+/*!
  * @file point_gravity.h
   *  Definition of ...
@@ -16,4 +16,5 @@
 //! A class for ...
 class PointGravity : public Field {
+  NewObjectListDeclaration(PointGravity);
 
  public:
Index: branches/new_class_id/src/lib/physics/fields/twirl.cc
===================================================================
--- branches/new_class_id/src/lib/physics/fields/twirl.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/twirl.cc	(revision 9686)
@@ -20,4 +20,7 @@
 
 
+#include "class_id.h"
+NewObjectListDefinitionID(Twirl, CL_FIELD_TWIRL);
+
 
 /**
@@ -27,5 +30,5 @@
 Twirl::Twirl ()
 {
-   this->setClassID(CL_FIELD_TWIRL, "Twirl");
+  this->registerObject(this, Twirl::_objectList);
 }
 
Index: branches/new_class_id/src/lib/physics/fields/twirl.h
===================================================================
--- branches/new_class_id/src/lib/physics/fields/twirl.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/fields/twirl.h	(revision 9686)
@@ -1,3 +1,3 @@
-/*! 
+/*!
  * @file twirl.h
   *  Definition of ...
@@ -16,4 +16,5 @@
 //! A class for ...
 class Twirl : public Field {
+  NewObjectListDeclaration(Twirl);
 
  public:
Index: branches/new_class_id/src/lib/physics/physics_connection.cc
===================================================================
--- branches/new_class_id/src/lib/physics/physics_connection.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_connection.cc	(revision 9686)
@@ -27,8 +27,8 @@
 #include "util/loading/load_param.h"
 
-
+#include "class_id.h"
 
 CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION);
-
+NewObjectListDefinition(PhysicsConnection);
 /**
  *  creates a PhysicsConnection
@@ -36,5 +36,5 @@
 PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field)
 {
-  this->setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");
+  this->registerObject(this, PhysicsConnection::_objectList);
   this->type = PCON_PhysIField;
 
@@ -47,5 +47,5 @@
 PhysicsConnection::PhysicsConnection(const TiXmlElement* root)
 {
-  this->setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");
+  this->registerObject(this, PhysicsConnection::_objectList);
   this->type = PCON_PhysIField;
 
Index: branches/new_class_id/src/lib/physics/physics_connection.h
===================================================================
--- branches/new_class_id/src/lib/physics/physics_connection.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_connection.h	(revision 9686)
@@ -27,5 +27,5 @@
 class PhysicsConnection : public BaseObject
 {
-
+  NewObjectListDeclaration(PhysicsConnection);
  public:
   PhysicsConnection(PhysicsInterface* subject, Field* field);
Index: branches/new_class_id/src/lib/physics/physics_engine.cc
===================================================================
--- branches/new_class_id/src/lib/physics/physics_engine.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_engine.cc	(revision 9686)
@@ -18,5 +18,4 @@
 #include "physics_engine.h"
 
-#include "class_list.h"
 #include "parser/tinyxml/tinyxml.h"
 #include "util/loading/factory.h"
@@ -25,11 +24,11 @@
 
 
-
-/**
- *  standard constructor
-*/
+NewObjectListDefinition(PhysicsEngine);
+/**
+ * @brief standard constructor
+ */
 PhysicsEngine::PhysicsEngine()
 {
-  this->setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine");
+  this->registerObject(this, PhysicsEngine::_objectList);
   this->setName("PhysicsEngine");
   this->interfaces = NULL;
@@ -130,6 +129,5 @@
 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const
 {
-  BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE);
-  return (interface != NULL)?  dynamic_cast<PhysicsInterface*>(interface) : NULL;
+  return PhysicsInterface::objectList().getObject(physicsInterfaceName);
 }
 
@@ -223,10 +221,10 @@
 
   /* actually tick all the PhysicsInterfaces. Move the objects around */
-  if (this->interfaces != NULL || (this->interfaces = ClassList::getList(CL_PHYSICS_INTERFACE)) != NULL)
-  {
-    std::list<BaseObject*>::const_iterator tickPhys;
-    for (tickPhys = this->interfaces->begin(); tickPhys != this->interfaces->end(); tickPhys++)
-      dynamic_cast<PhysicsInterface*>(*tickPhys)->tickPhys(dt);
-  }
+
+  NewObjectList<PhysicsInterface>::const_iterator it;
+  for (it = PhysicsInterface::objectList().begin();
+       it != PhysicsInterface::objectList().end();
+       ++it)
+      (*it)->tickPhys(dt);
 }
 
Index: branches/new_class_id/src/lib/physics/physics_engine.h
===================================================================
--- branches/new_class_id/src/lib/physics/physics_engine.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_engine.h	(revision 9686)
@@ -20,7 +20,8 @@
 
 //! A class, that brings things into motion through Physics.
-class PhysicsEngine : public BaseObject {
-
- public:
+class PhysicsEngine : public BaseObject
+{
+  NewObjectListDeclaration(PhysicsEngine);
+public:
   virtual ~PhysicsEngine();
   /** @returns a Pointer to the only object of this Class */
@@ -46,8 +47,8 @@
   void                   debug() const;
 
- private:
+private:
   PhysicsEngine();
 
- private:
+private:
   static PhysicsEngine*         singletonRef;         //!< the singleton reference of the PhysicsEngine
 
Index: branches/new_class_id/src/lib/physics/physics_interface.cc
===================================================================
--- branches/new_class_id/src/lib/physics/physics_interface.cc	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_interface.cc	(revision 9686)
@@ -31,11 +31,11 @@
 
 
-
+NewObjectListDefinition(PhysicsInterface);
 /**
- *  standard constructor
+ * @brief standard constructor
  */
 PhysicsInterface::PhysicsInterface ()
 {
-  this->setClassID(CL_PHYSICS_INTERFACE, "PhysicsInterface");
+  this->registerObject(this, PhysicsInterface::_objectList);
 
   this->mass = 1;
Index: branches/new_class_id/src/lib/physics/physics_interface.h
===================================================================
--- branches/new_class_id/src/lib/physics/physics_interface.h	(revision 9685)
+++ branches/new_class_id/src/lib/physics/physics_interface.h	(revision 9686)
@@ -29,4 +29,5 @@
 class PhysicsInterface : virtual public BaseObject
 {
+  NewObjectListDeclaration(PhysicsInterface);
  public:
   PhysicsInterface();
Index: branches/new_class_id/src/lib/script_engine/script_class.h
===================================================================
--- branches/new_class_id/src/lib/script_engine/script_class.h	(revision 9685)
+++ branches/new_class_id/src/lib/script_engine/script_class.h	(revision 9686)
@@ -30,5 +30,5 @@
 
   bool operator==(const std::string& name) { return (this->getName() == name); }
-  bool operator==(ClassID classID) { return (this->_classID == classID); }
+  bool operator==(NewClassID classID) { return (this->_classID == classID); }
 
   virtual void registerClass(Script* script) = 0;
@@ -39,8 +39,8 @@
 
 protected:
-  ScriptClass(const std::string& name, ClassID classID, ScriptMethod* scriptMethods);
+  ScriptClass(const std::string& name, NewClassID classID, ScriptMethod* scriptMethods);
 
 private:
-  ClassID             _classID;
+  const NewClassID&   _classID;
   ScriptMethod*       _scriptMethods;
 };
@@ -53,5 +53,5 @@
 {
 public:
-  tScriptClass(const std::string& name, ClassID classID, ScriptMethod* scriptMethods)
+  tScriptClass(const std::string& name, NewClassID classID, ScriptMethod* scriptMethods)
       : ScriptClass(name, classID, scriptMethods)
   { }
Index: branches/new_class_id/src/lib/sound/ogg_player.cc
===================================================================
--- branches/new_class_id/src/lib/sound/ogg_player.cc	(revision 9685)
+++ branches/new_class_id/src/lib/sound/ogg_player.cc	(revision 9686)
@@ -49,4 +49,5 @@
 namespace OrxSound
 {
+  NewObjectListDefinition(OggPlayer);
   /**
    * initializes an Ogg-player from a file
@@ -55,5 +56,5 @@
   OggPlayer::OggPlayer(const std::string& fileName)
   {
-    this->setClassID(CL_SOUND_OGG_PLAYER, "OggPlayer");
+    this->registerObject(this, OggPlayer::_objectList);
 
     this->state = OggPlayer::None;
Index: branches/new_class_id/src/lib/sound/ogg_player.h
===================================================================
--- branches/new_class_id/src/lib/sound/ogg_player.h	(revision 9685)
+++ branches/new_class_id/src/lib/sound/ogg_player.h	(revision 9686)
@@ -25,4 +25,6 @@
   class OggPlayer : public BaseObject
   {
+    NewObjectListDeclaration(OggPlayer);
+
   public:
     /**
Index: branches/new_class_id/src/lib/sound/sound_buffer.cc
===================================================================
--- branches/new_class_id/src/lib/sound/sound_buffer.cc	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_buffer.cc	(revision 9686)
@@ -35,4 +35,5 @@
 namespace OrxSound
 {
+  NewObjectListDefinition(SoundBuffer);
   //////////////////
   /* SOUND-BUFFER */
@@ -44,5 +45,5 @@
   SoundBuffer::SoundBuffer(const std::string& fileName)
   {
-    this->setClassID(CL_SOUND_BUFFER, "SoundBuffer");
+    this->registerObject(this, SoundBuffer::_objectList);
     this->setName(fileName);
 
Index: branches/new_class_id/src/lib/sound/sound_buffer.h
===================================================================
--- branches/new_class_id/src/lib/sound/sound_buffer.h	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_buffer.h	(revision 9686)
@@ -18,4 +18,5 @@
   class SoundBuffer : public BaseObject
   {
+    NewObjectListDeclaration(SoundBuffer);
   public:
     SoundBuffer(const std::string& fileName);
Index: branches/new_class_id/src/lib/sound/sound_engine.cc
===================================================================
--- branches/new_class_id/src/lib/sound/sound_engine.cc	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_engine.cc	(revision 9686)
@@ -20,6 +20,4 @@
 
 #include "sound_engine.h"
-
-#include "class_list.h"
 
 #include "p_node.h"
@@ -31,5 +29,5 @@
 namespace OrxSound
 {
-
+  NewObjectListDefinition(SoundEngine);
   //////////////////
   /* SOUND-ENGINE */
@@ -40,10 +38,8 @@
   SoundEngine::SoundEngine ()
   {
-    this->setClassID(CL_SOUND_ENGINE, "SoundEngine");
+    this->registerObject(this, SoundEngine::_objectList);
     this->setName("SoundEngine");
 
     this->listener = NULL;
-    this->bufferList = NULL;
-    this->sourceList = NULL;
 
     this->device = NULL;
@@ -69,9 +65,6 @@
   {
     // deleting all the SoundSources
-    if(this->sourceList != NULL)
-    {
-      while (this->sourceList->size() > 0)
-        delete static_cast<SoundSource*>(this->sourceList->front());
-    }
+    while (!SoundSource::objectList().empty())
+      delete (SoundSource::objectList().front());
 
     while(!this->ALSources.empty())
@@ -89,9 +82,6 @@
 
     // deleting all the SoundBuffers
-    if (this->bufferList != NULL)
-    {
-      while(this->bufferList->size() > 0)
-        ResourceManager::getInstance()->unload(static_cast<SoundBuffer*>(this->bufferList->front()));
-    }
+    while(!SoundBuffer::objectList().empty())
+      ResourceManager::getInstance()->unload(SoundBuffer::objectList().front());
 
     // removing openAL from AudioResource
@@ -212,39 +202,36 @@
 
     // updating all the Sources positions
-    if (likely(this->sourceList != NULL || (this->sourceList = ClassList::getList(CL_SOUND_SOURCE)) != NULL))
-    {
-      std::list<BaseObject*>::const_iterator sourceIT;
-      SoundSource* source;
-      for (sourceIT = this->sourceList->begin(); sourceIT != this->sourceList->end(); sourceIT++)
+    NewObjectList<SoundSource>::const_iterator sourceIT;
+    for (sourceIT = SoundSource::objectList().begin();
+         sourceIT != SoundSource::objectList().end();
+         sourceIT++)
+    {
+      if ((*sourceIT)->isPlaying())
       {
-        source = static_cast<SoundSource*>(*sourceIT);
-        if (source->isPlaying())
+        int play = 0x000;
+        alGetSourcei((*sourceIT)->getID(), AL_SOURCE_STATE, &play);
+        if (DEBUG_LEVEL > 2)
+          SoundEngine::checkError("SoundEngine::update() Play", __LINE__);
+        if(play == AL_PLAYING)
         {
-          int play = 0x000;
-          alGetSourcei(source->getID(), AL_SOURCE_STATE, &play);
-          if (DEBUG_LEVEL > 2)
-            SoundEngine::checkError("SoundEngine::update() Play", __LINE__);
-          if(play == AL_PLAYING)
+	  if (likely((*sourceIT)->getNode() != NULL))
           {
-            if (likely(source->getNode() != NULL))
-            {
-              alSource3f(source->getID(), AL_POSITION,
-                         source->getNode()->getAbsCoor().x,
-                         source->getNode()->getAbsCoor().y,
-                         source->getNode()->getAbsCoor().z);
-              if (DEBUG_LEVEL > 2)
-                SoundEngine::checkError("SoundEngine::update() Set Source Position", __LINE__);
-              alSource3f(source->getID(), AL_VELOCITY,
-                         source->getNode()->getVelocity().x,
-                         source->getNode()->getVelocity().y,
-                         source->getNode()->getVelocity().z);
-              if (DEBUG_LEVEL > 2)
-                SoundEngine::checkError("SoundEngine::update() Set Source Velocity", __LINE__);
-            }
+            alSource3f((*sourceIT)->getID(), AL_POSITION,
+                       (*sourceIT)->getNode()->getAbsCoor().x,
+                       (*sourceIT)->getNode()->getAbsCoor().y,
+                       (*sourceIT)->getNode()->getAbsCoor().z);
+            if (DEBUG_LEVEL > 2)
+              SoundEngine::checkError("SoundEngine::update() Set Source Position", __LINE__);
+            alSource3f((*sourceIT)->getID(), AL_VELOCITY,
+                       (*sourceIT)->getNode()->getVelocity().x,
+                       (*sourceIT)->getNode()->getVelocity().y,
+                       (*sourceIT)->getNode()->getVelocity().z);
+            if (DEBUG_LEVEL > 2)
+              SoundEngine::checkError("SoundEngine::update() Set Source Velocity", __LINE__);
           }
-          else
-          {
-            source->stop();
-          }
+        }
+        else
+        {
+          (*sourceIT)->stop();
         }
       }
@@ -393,15 +380,15 @@
       default:
       case AL_NO_ERROR:
-        return ("AL_NO_ERROR");
+      return ("AL_NO_ERROR");
       case AL_INVALID_NAME:
-        return ("AL_INVALID_NAME");
+      return ("AL_INVALID_NAME");
       case AL_INVALID_ENUM:
-        return ("AL_INVALID_ENUM");
+      return ("AL_INVALID_ENUM");
       case AL_INVALID_VALUE:
-        return ("AL_INVALID_VALUE");
+      return ("AL_INVALID_VALUE");
       case AL_INVALID_OPERATION:
-        return ("AL_INVALID_OPERATION");
+      return ("AL_INVALID_OPERATION");
       case AL_OUT_OF_MEMORY:
-        return ("AL_OUT_OF_MEMORY");
+      return ("AL_OUT_OF_MEMORY");
     };
   }
@@ -414,15 +401,15 @@
       default:
       case ALC_NO_ERROR:
-        return ("AL_NO_ERROR");
+      return ("AL_NO_ERROR");
       case ALC_INVALID_DEVICE:
-        return ("ALC_INVALID_DEVICE");
+      return ("ALC_INVALID_DEVICE");
       case ALC_INVALID_CONTEXT:
-        return("ALC_INVALID_CONTEXT");
+      return("ALC_INVALID_CONTEXT");
       case ALC_INVALID_ENUM:
-        return("ALC_INVALID_ENUM");
+      return("ALC_INVALID_ENUM");
       case ALC_INVALID_VALUE:
-        return ("ALC_INVALID_VALUE");
+      return ("ALC_INVALID_VALUE");
       case ALC_OUT_OF_MEMORY:
-        return("ALC_OUT_OF_MEMORY");
+      return("ALC_OUT_OF_MEMORY");
     };
   }
Index: branches/new_class_id/src/lib/sound/sound_engine.h
===================================================================
--- branches/new_class_id/src/lib/sound/sound_engine.h	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_engine.h	(revision 9686)
@@ -27,5 +27,6 @@
   class SoundEngine : public BaseObject
   {
-  public:
+    NewObjectListDeclaration(SoundEngine);
+    public:
     virtual ~SoundEngine();
     /** @returns a Pointer to the only object of this Class */
@@ -75,7 +76,4 @@
     const PNode*                   listener;                 //!< The listener of the Scene
 
-    const std::list<BaseObject*>*  bufferList;               //!< A list of buffers
-    const std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
-
     unsigned int                   maxSourceCount;           //!< How many Sources is the Maximum
     std::stack<ALuint>             ALSources;                //!< A list of real openAL-Sources, the engine allocates, and stores for reuse.
Index: branches/new_class_id/src/lib/sound/sound_source.cc
===================================================================
--- branches/new_class_id/src/lib/sound/sound_source.cc	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_source.cc	(revision 9686)
@@ -25,4 +25,5 @@
 namespace OrxSound
 {
+  NewObjectListDefinition(SoundSource);
   /**
   * @brief creates a SoundSource at position sourceNode with the SoundBuffer buffer
@@ -30,6 +31,5 @@
   SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
   {
-    this->setClassID(CL_SOUND_SOURCE, "SoundSource");
-
+    this->registerObject(this, SoundSource::_objectList);
     // adding the Source to the SourcesList of the SoundEngine
     this->buffer = buffer;
@@ -51,5 +51,5 @@
   SoundSource::SoundSource(const SoundSource& source)
   {
-    this->setClassID(CL_SOUND_SOURCE, "SoundSource");
+    this->registerObject(this, SoundSource::_objectList);
 
     // adding the Source to the SourcesList of the SoundEngine
Index: branches/new_class_id/src/lib/sound/sound_source.h
===================================================================
--- branches/new_class_id/src/lib/sound/sound_source.h	(revision 9685)
+++ branches/new_class_id/src/lib/sound/sound_source.h	(revision 9686)
@@ -18,4 +18,5 @@
   class SoundSource : public BaseObject
   {
+    NewObjectListDeclaration(SoundSource);
   public:
     SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
Index: branches/new_class_id/src/lib/util/loading/factory.cc
===================================================================
--- branches/new_class_id/src/lib/util/loading/factory.cc	(revision 9685)
+++ branches/new_class_id/src/lib/util/loading/factory.cc	(revision 9686)
@@ -29,17 +29,17 @@
  */
 Factory::Factory (const std::string& factoryName, int classID)
-    : classID(classID), className(factoryName)
+    : _classID(classID), _className(factoryName)
 {
   this->registerObject(this, Factory::_objectList);
   this->setName(factoryName);
 
-  if( Factory::factoryList == NULL)
-    Factory::factoryList = new std::list<Factory*>;
+  if( Factory::_factoryList == NULL)
+    Factory::_factoryList = new std::list<Factory*>;
 
-  Factory::factoryList->push_back(this);
+  Factory::_factoryList->push_back(this);
 }
 
 /** @brief a reference to the First Factory */
-std::list<Factory*>* Factory::factoryList = NULL;
+std::list<Factory*>* Factory::_factoryList = NULL;
 
 /**
@@ -58,13 +58,13 @@
 void Factory::deleteFactories()
 {
-  if (Factory::factoryList != NULL)
+  if (Factory::_factoryList != NULL)
   {
-    while(!Factory::factoryList->empty())
+    while(!Factory::_factoryList->empty())
     {
-      delete Factory::factoryList->front();
-      Factory::factoryList->pop_front();
+      delete Factory::_factoryList->front();
+      Factory::_factoryList->pop_front();
     }
-    delete Factory::factoryList;
-    Factory::factoryList = NULL;
+    delete Factory::_factoryList;
+    Factory::_factoryList = NULL;
   }
 }
@@ -76,5 +76,5 @@
 bool Factory::operator==(int classID) const
 {
-  return (this->classID == classID);
+  return (this->_classID == classID);
 }
 
@@ -86,5 +86,5 @@
 bool Factory::operator==(const char* className) const
 {
-  return (className != NULL && this->className == className);
+  return (className != NULL && this->_className == className);
 }
 
@@ -96,5 +96,5 @@
 bool Factory::operator==(const std::string& className) const
 {
-  return (this->className == className);
+  return (this->_className == className);
 }
 
@@ -107,8 +107,8 @@
 BaseObject* Factory::fabricate(const TiXmlElement* root)
 {
-  assert (root != NULL && Factory::factoryList != NULL);
+  assert (root != NULL && Factory::_factoryList != NULL);
 
   std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
+  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
     if (*(*factory) == root->Value())
     {
@@ -129,9 +129,9 @@
 BaseObject* Factory::fabricate(const std::string& className)
 {
-  if (Factory::factoryList == NULL)
+  if (Factory::_factoryList == NULL)
     return NULL;
 
   std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
+  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
     if (*(*factory) == className)
     {
@@ -151,9 +151,9 @@
 BaseObject* Factory::fabricate(int classID)
 {
-  if (Factory::factoryList == NULL)
+  if (Factory::_factoryList == NULL)
     return NULL;
 
   std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
+  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
     if (*(*factory) == classID)
     {
Index: branches/new_class_id/src/lib/util/loading/factory.h
===================================================================
--- branches/new_class_id/src/lib/util/loading/factory.h	(revision 9685)
+++ branches/new_class_id/src/lib/util/loading/factory.h	(revision 9686)
@@ -60,7 +60,7 @@
 
 protected:
-  const int                     classID;              //!< The Class-Identifyer of the Factory.
-  const std::string             className;            //!< The name of the Class.
-  static std::list<Factory*>*   factoryList;          //!< List of Registered Factories
+  const int                     _classID;              //!< The Class-Identifyer of the Factory.
+  const std::string             _className;            //!< The name of the Class.
+  static std::list<Factory*>*   _factoryList;          //!< List of Registered Factories
 };
 
