Index: trunk/src/world_entities/weapons/aim.cc
===================================================================
--- trunk/src/world_entities/weapons/aim.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/aim.cc	(revision 9869)
@@ -29,4 +29,5 @@
 
 
+ObjectListDefinition(Aim);
 
 /**
@@ -50,6 +51,6 @@
 Aim::~Aim ()
 {
-/*  if (this->text != NULL)
-    delete this->text;*/
+  /*  if (this->text != NULL)
+      delete this->text;*/
 }
 
@@ -59,5 +60,5 @@
 void Aim::init()
 {
-  this->setClassID(CL_CROSSHAIR, "Aim");
+  this->registerObject(this, Aim::_objectList);
   this->setName("Aim");
 
@@ -79,10 +80,10 @@
 
 
-/*  this->text = new Text();
-  this->text->setLayer(this->getLayer());
-  this->text->setParent2D(this);
-  this->text->setRelCoor2D(10, -50);
-  this->text->setParentMode2D(E2D_PARENT_MOVEMENT);
-  this->text->setText("Testing");*/
+  /*  this->text = new Text();
+    this->text->setLayer(this->getLayer());
+    this->text->setParent2D(this);
+    this->text->setRelCoor2D(10, -50);
+    this->text->setParentMode2D(E2D_PARENT_MOVEMENT);
+    this->text->setText("Testing");*/
 }
 
@@ -92,11 +93,11 @@
 
   LoadParam(root, "texture", this, Aim, setTexture)
-      .describe("the texture-file to load onto the Aim");
+  .describe("the texture-file to load onto the Aim");
 
   LoadParam(root, "size", this, Aim, setSize)
-      .describe("the size of the Aim in Pixels");
+  .describe("the size of the Aim in Pixels");
 
   LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed)
-      .describe("the Speed with which the Aim should rotate");
+  .describe("the Speed with which the Aim should rotate");
 
   LoadParam(root, "target-group", this, Aim, setTargetGroupS);
@@ -107,6 +108,6 @@
   ObjectManager::EntityList::iterator entity;
   //printf("%d\n", this->targetGroup);
-  for (entity = State::getObjectManager()->getObjectList(this->targetGroup).begin();
-       entity != State::getObjectManager()->getObjectList(this->targetGroup).end();
+  for (entity = State::getObjectManager()->getEntityList(this->targetGroup).begin();
+       entity != State::getObjectManager()->getEntityList(this->targetGroup).end();
        entity ++)
   {
@@ -117,5 +118,5 @@
       //if (this->getParent() != (*entity))
       {
-        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
+        //        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
         this->anim->replay();
         this->setParentSoft(*entity, 5);
@@ -125,6 +126,6 @@
   }
 
-   //if no target found:
-   this->setParent(PNode::getNullParent());
+  //if no target found:
+  this->setParent(PNode::getNullParent());
 }
 
@@ -165,42 +166,42 @@
   this->shiftDir2D(dt * rotationSpeed);
 
-//   char outputText[100];
-//   sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len());
-//   this->text->setText(outputText);
-
-
-//  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
+  //   char outputText[100];
+  //   sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len());
+  //   this->text->setText(outputText);
+
+
+  //  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
   diffVec = ( this->getAbsCoor() - this->source->getAbsCoor() );
-//only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
-   if(this->getParent() == PNode::getNullParent() ||
+  //only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
+  if(this->getParent() == PNode::getNullParent() ||
       diffVec.len() > range )// ||
-     //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
-    {
-     this->setParentSoft(PNode::getNullParent(),5);
-     this->searchTarget();
-    }
-
-//   float z = 0.0f;
-//   glReadPixels ((int)this->getAbsCoor2D().x,
-//                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
-//                  1,
-//                  1,
-//                  GL_DEPTH_COMPONENT,
-//                  GL_FLOAT,
-//                  &z);
-//
-//
-//   GLdouble objX=.0, objY=.0, objZ=.0;
-//   gluUnProject(this->getAbsCoor2D().x,
-//                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
-//                .99,  // z
-//                GraphicsEngine::modMat,
-//                GraphicsEngine::projMat,
-//                GraphicsEngine::viewPort,
-//                &objX,
-//                &objY,
-//                &objZ );
-//aa
-//   this->setAbsCoor(objX, objY, objZ);
+    //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
+  {
+    this->setParentSoft(PNode::getNullParent(),5);
+    this->searchTarget();
+  }
+
+  //   float z = 0.0f;
+  //   glReadPixels ((int)this->getAbsCoor2D().x,
+  //                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
+  //                  1,
+  //                  1,
+  //                  GL_DEPTH_COMPONENT,
+  //                  GL_FLOAT,
+  //                  &z);
+  //
+  //
+  //   GLdouble objX=.0, objY=.0, objZ=.0;
+  //   gluUnProject(this->getAbsCoor2D().x,
+  //                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
+  //                .99,  // z
+  //                GraphicsEngine::modMat,
+  //                GraphicsEngine::projMat,
+  //                GraphicsEngine::viewPort,
+  //                &objX,
+  //                &objY,
+  //                &objZ );
+  //aa
+  //   this->setAbsCoor(objX, objY, objZ);
 }
 
@@ -211,22 +212,22 @@
 {
 
- if( this->getParent() != PNode::getNullParent() )
+  if( this->getParent() != PNode::getNullParent() )
   {
-  glPushMatrix();
-  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
-
-  glRotatef(this->getAbsDir2D(), 0,0,1);
-  this->material.select();
-  glBegin(GL_TRIANGLE_STRIP);
-  glTexCoord2f(0, 0);
-  glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
-  glTexCoord2f(1, 0);
-  glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
-  glTexCoord2f(0, 1);
-  glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
-  glTexCoord2f(1, 1);
-  glVertex2f(this->getSizeX2D(), this->getSizeY2D());
-  glEnd();
-  glPopMatrix();
+    glPushMatrix();
+    glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
+
+    glRotatef(this->getAbsDir2D(), 0,0,1);
+    this->material.select();
+    glBegin(GL_TRIANGLE_STRIP);
+    glTexCoord2f(0, 0);
+    glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
+    glTexCoord2f(1, 0);
+    glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
+    glTexCoord2f(0, 1);
+    glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
+    glTexCoord2f(1, 1);
+    glVertex2f(this->getSizeX2D(), this->getSizeY2D());
+    glEnd();
+    glPopMatrix();
   }
 
Index: trunk/src/world_entities/weapons/aim.h
===================================================================
--- trunk/src/world_entities/weapons/aim.h	(revision 9656)
+++ trunk/src/world_entities/weapons/aim.h	(revision 9869)
@@ -19,4 +19,5 @@
 template<class T> class tAnimation;
 
+
 //! An Aim for zooming in on Targets.
 /**
@@ -28,4 +29,5 @@
 class Aim : public PNode, public Element2D
 {
+  ObjectListDeclaration(Aim);
 
 public:
Index: trunk/src/world_entities/weapons/aiming_system.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/aiming_system.cc	(revision 9869)
@@ -21,13 +21,12 @@
 
 #include "state.h"
+#include "debug.h"
 
 #include "aabb.h"
 #include "obb_tree.h"
 
-#include <vector>
 
 
-
-
+ObjectListDefinition(AimingSystem);
 
 /**
@@ -55,5 +54,5 @@
 void AimingSystem::init()
 {
-  this->setClassID(CL_AIMING_SYSTEM, "AimingSystem");
+  this->registerObject(this, AimingSystem::_objectList);
   this->setName("AimingSystem");
 
@@ -63,5 +62,5 @@
   // registering default reactions:
   this->unsubscribeReaction(CREngine::CR_OBJECT_DAMAGE);
-  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
+  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, WorldEntity::staticClassID());
 
   this->range = 1000.0f;
Index: trunk/src/world_entities/weapons/aiming_system.h
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.h	(revision 9656)
+++ trunk/src/world_entities/weapons/aiming_system.h	(revision 9869)
@@ -21,4 +21,5 @@
 class AimingSystem : public WorldEntity
 {
+  ObjectListDeclaration(AimingSystem);
 
  public:
Index: trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9869)
@@ -27,6 +27,7 @@
 #include "util/loading/factory.h"
 
-CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET);
-
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(AimingTurret, CL_AIMING_TURRET);
+CREATE_FACTORY(AimingTurret);
 
 
@@ -64,5 +65,5 @@
 void AimingTurret::init()
 {
-  this->setClassID(CL_AIMING_TURRET, "AimingTurret");
+  this->registerObject(this, AimingTurret::_objectList);
 
   Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
@@ -86,5 +87,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
-  this->setProjectileType(CL_GUIDED_MISSILE);
+  this->setProjectileTypeC("GuidedMissile");
 
 
Index: trunk/src/world_entities/weapons/aiming_turret.h
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.h	(revision 9656)
+++ trunk/src/world_entities/weapons/aiming_turret.h	(revision 9869)
@@ -13,4 +13,6 @@
 class AimingTurret : public Weapon
 {
+  ObjectListDeclaration(AimingTurret);
+
 public:
   AimingTurret ();
Index: trunk/src/world_entities/weapons/ammo_container.cc
===================================================================
--- trunk/src/world_entities/weapons/ammo_container.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/ammo_container.cc	(revision 9869)
@@ -23,17 +23,17 @@
 
 
-
+ObjectListDefinition(AmmoContainer);
 /**
  * standard constructor
  * @todo this constructor is not jet implemented - do it
 */
-AmmoContainer::AmmoContainer (ClassID projectileType, float maxEnergy)
+AmmoContainer::AmmoContainer (const ClassID& projectileType, float maxEnergy)
 {
-   this->setClassID(CL_AMMO_CONTAINER, "AmmoContainer");
+  this->registerObject(this, AmmoContainer::_objectList);
 
-   this->projectileType = projectileType;
-   this->maxEnergy = maxEnergy;
+  this->projectileType = projectileType;
+  this->maxEnergy = maxEnergy;
 
-   this->energy = 0.0;
+  this->energy = 0.0;
 }
 
Index: trunk/src/world_entities/weapons/ammo_container.h
===================================================================
--- trunk/src/world_entities/weapons/ammo_container.h	(revision 9656)
+++ trunk/src/world_entities/weapons/ammo_container.h	(revision 9869)
@@ -17,10 +17,11 @@
 //! A class for Storing energy of Projectiles.
 class AmmoContainer : public BaseObject {
+  ObjectListDeclaration(AmmoContainer);
 
  public:
-  AmmoContainer(ClassID projectileType, float maxEnergy = DEFAULT_MAX_ENERGY);
+  AmmoContainer(const ClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);
   virtual ~AmmoContainer();
 
-  bool operator=(ClassID projectileType) const { return (this->projectileType == projectileType); };
+  bool operator=(int projectileType) const { return (this->projectileType == projectileType); };
   ClassID getProjectileType() const { return this->projectileType; };
 
Index: trunk/src/world_entities/weapons/boomerang_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/boomerang_gun.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/boomerang_gun.cc	(revision 9869)
@@ -27,5 +27,7 @@
 #include "util/loading/factory.h"
 
-CREATE_FACTORY(BoomerangGun, CL_BOOMERANG_GUN);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(BoomerangGun, CL_BOOMERANG_GUN);
+CREATE_FACTORY(BoomerangGun);
 
 
@@ -61,5 +63,5 @@
 void BoomerangGun::init()
 {
-  this->setClassID(CL_BOOMERANG_GUN, "BoomerangGun");
+  this->registerObject(this, BoomerangGun::_objectList);
 
 
@@ -85,5 +87,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
-  this->setProjectileType(CL_BOOMERANG_PROJECTILE);
+  this->setProjectileTypeC("BoomerangProjectile");
 
   this->loadModel("models/guns/turret1.obj", 5.0);
Index: trunk/src/world_entities/weapons/boomerang_gun.h
===================================================================
--- trunk/src/world_entities/weapons/boomerang_gun.h	(revision 9656)
+++ trunk/src/world_entities/weapons/boomerang_gun.h	(revision 9869)
@@ -11,4 +11,5 @@
 class BoomerangGun : public Weapon
   {
+    ObjectListDeclaration(BoomerangGun);
   public:
     BoomerangGun ();
Index: trunk/src/world_entities/weapons/cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/cannon.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/cannon.cc	(revision 9869)
@@ -32,10 +32,11 @@
 #include "animation3d.h"
 
-#include "fast_factory.h"
-
-
-
-
-CREATE_FACTORY(Cannon, CL_CANNON);
+#include "loading/fast_factory.h"
+
+
+
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(Cannon, CL_CANNON);
+CREATE_FACTORY(Cannon);
 
 /**
@@ -69,5 +70,5 @@
 void Cannon::init()
 {
-  this->setClassID(CL_CANNON, "Cannon");
+  this->registerObject(this, Cannon::_objectList);
 
 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
@@ -88,5 +89,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY);
-  this->setProjectileType(CL_BOMB);
+  this->setProjectileTypeC("Bomb");
   this->prepareProjectiles(5);
 
Index: trunk/src/world_entities/weapons/cannon.h
===================================================================
--- trunk/src/world_entities/weapons/cannon.h	(revision 9656)
+++ trunk/src/world_entities/weapons/cannon.h	(revision 9869)
@@ -12,4 +12,5 @@
 class Cannon : public Weapon
   {
+    ObjectListDeclaration(Cannon);
   public:
     Cannon ();
Index: trunk/src/world_entities/weapons/crosshair.cc
===================================================================
--- trunk/src/world_entities/weapons/crosshair.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/crosshair.cc	(revision 9869)
@@ -26,5 +26,5 @@
 
 
-
+ObjectListDefinition(Crosshair);
 /**
  * standart constructor
@@ -54,5 +54,5 @@
 void Crosshair::init()
 {
-  this->setClassID(CL_CROSSHAIR, "Crosshair");
+  this->registerObject(this, Crosshair::_objectList);
   this->setName("Crosshair");
 
Index: trunk/src/world_entities/weapons/crosshair.h
===================================================================
--- trunk/src/world_entities/weapons/crosshair.h	(revision 9656)
+++ trunk/src/world_entities/weapons/crosshair.h	(revision 9869)
@@ -22,5 +22,5 @@
 //! A class that enables the
 class Crosshair : public PNode, public Element2D, public EventListener {
-
+  ObjectListDeclaration(Crosshair);
  public:
   Crosshair(const TiXmlElement* root = NULL);
Index: trunk/src/world_entities/weapons/fps_sniper_rifle.cc
===================================================================
--- trunk/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 9869)
@@ -29,5 +29,5 @@
 
 
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 
 #include "fps_sniper_rifle.h"
@@ -39,5 +39,7 @@
 
 
-CREATE_FACTORY(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);
+CREATE_FACTORY(FPSSniperRifle);
 
 /**
@@ -76,5 +78,5 @@
 void FPSSniperRifle::init()
 {
-  this->setClassID(CL_FPS_SNIPER_RIFLE, "FPSSniperRifle");
+  this->registerObject(this, FPSSniperRifle::_objectList);
 
   this->loadModel("models/guns/fps_sniper_rifle.obj", 0.2);
@@ -98,5 +100,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->setProjectileType(CL_LASER);
+  this->setProjectileTypeC("Laser");
   this->prepareProjectiles(20);
 
@@ -181,5 +183,6 @@
 
   this->material->select();
-  static_cast<StaticModel*>(this->getModel())->draw();
+  this->getModel()->draw();
+  //static_cast<StaticModel*>(this->getModel())->draw();
 
   glPopMatrix();
Index: trunk/src/world_entities/weapons/fps_sniper_rifle.h
===================================================================
--- trunk/src/world_entities/weapons/fps_sniper_rifle.h	(revision 9656)
+++ trunk/src/world_entities/weapons/fps_sniper_rifle.h	(revision 9869)
@@ -39,4 +39,6 @@
 class FPSSniperRifle : public Weapon
   {
+    ObjectListDeclaration(FPSSniperRifle);
+
   public:
     FPSSniperRifle (int leftRight);
Index: trunk/src/world_entities/weapons/hyperblaster.cc
===================================================================
--- trunk/src/world_entities/weapons/hyperblaster.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/hyperblaster.cc	(revision 9869)
@@ -31,10 +31,11 @@
 #include "animation3d.h"
 
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 
 
 
-
-CREATE_FACTORY(Hyperblaster, CL_HYPERBLASTER);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(Hyperblaster, CL_HYPERBLASTER);
+CREATE_FACTORY(Hyperblaster);
 
 Hyperblaster::Hyperblaster(const TiXmlElement* root)
@@ -56,5 +57,5 @@
 void Hyperblaster::init()
 {
-  this->setClassID(CL_HYPERBLASTER, "Hyperblaster");
+  this->registerObject(this, Hyperblaster::_objectList);
 
 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
@@ -76,5 +77,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY);
-  this->setProjectileType(CL_HYPERBLAST);
+  this->setProjectileTypeC("Hyperblast");
   this->prepareProjectiles(2);
 
Index: trunk/src/world_entities/weapons/hyperblaster.h
===================================================================
--- trunk/src/world_entities/weapons/hyperblaster.h	(revision 9656)
+++ trunk/src/world_entities/weapons/hyperblaster.h	(revision 9869)
@@ -12,5 +12,6 @@
 class Hyperblaster : public Weapon
   {
-  public:
+    ObjectListDeclaration(Hyperblaster);
+    public:
     Hyperblaster (const TiXmlElement* root = NULL);
     virtual ~Hyperblaster ();
Index: trunk/src/world_entities/weapons/laser_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9869)
@@ -29,8 +29,9 @@
 #include "animation3d.h"
 
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 
-CREATE_FACTORY(LaserCannon, CL_LASER_CANNON);
-
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(LaserCannon, CL_LASER_CANNON);
+CREATE_FACTORY(LaserCannon);
 
 LaserCannon::LaserCannon(const TiXmlElement* root)
@@ -52,5 +53,5 @@
 void LaserCannon::init()
 {
-  this->setClassID(CL_LASER_CANNON, "LaserCannon");
+  this->registerObject(this, LaserCannon::_objectList);
 
 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/laser_cannon.obj", OBJ, RP_CAMPAIGN);
@@ -72,5 +73,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->setProjectileType(CL_RAIL_PROJECTILE);
+  this->setProjectileTypeC("RailProjectile");
   this->prepareProjectiles(100);
   this->setEmissionPoint(Vector(2.8,0,0) * 5.0);
Index: trunk/src/world_entities/weapons/laser_cannon.h
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.h	(revision 9656)
+++ trunk/src/world_entities/weapons/laser_cannon.h	(revision 9869)
@@ -29,5 +29,6 @@
 class LaserCannon : public Weapon
   {
-  public:
+    ObjectListDeclaration(LaserCannon);
+    public:
     LaserCannon (const TiXmlElement* root = NULL);
     virtual ~LaserCannon ();
Index: trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9869)
@@ -26,9 +26,10 @@
 #include "util/loading/factory.h"
 
-CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET);
+CREATE_FACTORY(TargetingTurret);
 
 
 TargetingTurret::TargetingTurret(const TiXmlElement* root)
-  : target(this)
 {
   this->init();
@@ -42,4 +43,6 @@
 TargetingTurret::~TargetingTurret ()
 {
+  if(Aim::objectList().exists(target))
+    delete target;
   // model will be deleted from WorldEntity-destructor
 //  delete this->target;
@@ -48,5 +51,6 @@
 void TargetingTurret::init()
 {
-  this->setClassID(CL_TARGETING_TURRET, "TargetingTurret");
+  this->registerObject(this, TargetingTurret::_objectList);
+  this->target = new Aim(this);
 
   Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
@@ -70,5 +74,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
-  this->setProjectileType(CL_GUIDED_MISSILE);
+  this->setProjectileTypeC("GuidedMissile");
 
 
@@ -76,9 +80,9 @@
   //this->getProjectileFactory()->prepare(100);
 
-  this->target.setVisibility(false);
-  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
-  this->target.setRange(1000);
-  this->target.setAngle(M_PI_4);
-  this->lockedTarget = &this->target;
+  this->target->setVisibility(false);
+  this->target->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
+  this->target->setRange(1000);
+  this->target->setAngle(M_PI_4);
+  this->lockedTarget = this->target;
 
   this->lockedTime = 0;
@@ -97,5 +101,5 @@
   Weapon::loadParams(root);
 
-  LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
+  LoadParam(root, "target-group", target, Aim, setTargetGroupS);
 
 }
@@ -109,5 +113,5 @@
 void TargetingTurret::deactivate()
 {
-  this->target.setVisibility(false);
+  this->target->setVisibility(false);
 }
 
@@ -117,14 +121,14 @@
     return;
 
-  this->target.tick(dt);
+  this->target->tick(dt);
 
   if( lockedTime >= neededLockTime )
    {
-    lockedTarget = this->target.getParent();
+    lockedTarget = this->target->getParent();
     lockedTime = 0;
    }
 
 
-  if(this->target.getParent() == PNode::getNullParent())
+  if(this->target->getParent() == PNode::getNullParent())
    lockedTime = 0;
   else
Index: trunk/src/world_entities/weapons/targeting_turret.h
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.h	(revision 9656)
+++ trunk/src/world_entities/weapons/targeting_turret.h	(revision 9869)
@@ -12,4 +12,5 @@
 class TargetingTurret : public Weapon
 {
+  ObjectListDeclaration(TargetingTurret);
 public:
   TargetingTurret(const TiXmlElement* root = NULL);
@@ -26,5 +27,5 @@
   virtual void draw() const;
 
-  void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
+  void setTargetGroup(OM_LIST targetGroup) { this->target->setTargetGroup(targetGroup); };
   const PNode* getLockedTarget() const { return lockedTarget; };
 
@@ -33,5 +34,5 @@
 
 private:
-  Aim            target;
+  Aim*           target;
   PNode*         lockedTarget;
   float          lockedTime;
Index: trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/test_gun.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/test_gun.cc	(revision 9869)
@@ -31,8 +31,9 @@
 #include "animation3d.h"
 
-#include "fast_factory.h"
-
-CREATE_FACTORY(TestGun, CL_TEST_GUN);
-
+#include "loading/fast_factory.h"
+
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(TestGun, CL_TEST_GUN);
+CREATE_FACTORY(TestGun);
 /**
  *  standard constructor
@@ -109,6 +110,5 @@
 void TestGun::init()
 {
-  this->setClassID(CL_TEST_GUN, "TestGun");
-
+  this->registerObject(this, TestGun::_objectList);
 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
 
@@ -129,5 +129,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  this->setProjectileType(CL_LASER);
+  this->setProjectileTypeC("Laser");
   this->prepareProjectiles(100);
 
Index: trunk/src/world_entities/weapons/test_gun.h
===================================================================
--- trunk/src/world_entities/weapons/test_gun.h	(revision 9656)
+++ trunk/src/world_entities/weapons/test_gun.h	(revision 9869)
@@ -37,4 +37,5 @@
 class TestGun : public Weapon
   {
+    ObjectListDeclaration(TestGun);
   public:
     TestGun (int leftRight);
Index: trunk/src/world_entities/weapons/turret.cc
===================================================================
--- trunk/src/world_entities/weapons/turret.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/turret.cc	(revision 9869)
@@ -27,7 +27,7 @@
 #include "util/loading/factory.h"
 
-CREATE_FACTORY(Turret, CL_TURRET);
-
-
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(Turret, CL_TURRET);
+CREATE_FACTORY(Turret);
 
 /**
@@ -62,5 +62,5 @@
 void Turret::init()
 {
-  this->setClassID(CL_TURRET, "Turret");
+  this->registerObject(this, Turret::_objectList);
 
 
@@ -86,5 +86,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
-  this->setProjectileType(CL_ROCKET);
+  this->setProjectileTypeC("Rocket");
 
   this->loadModel("models/guns/turret1.obj");
Index: trunk/src/world_entities/weapons/turret.h
===================================================================
--- trunk/src/world_entities/weapons/turret.h	(revision 9656)
+++ trunk/src/world_entities/weapons/turret.h	(revision 9869)
@@ -11,4 +11,5 @@
 class Turret : public Weapon
   {
+    ObjectListDeclaration(Turret);
   public:
     Turret ();
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 9869)
@@ -21,9 +21,7 @@
 #include "weapon.h"
 
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 #include "world_entities/projectiles/projectile.h"
 
-#include "util/loading/resource_manager.h"
-#include "class_list.h"
 #include "util/loading/factory.h"
 #include "util/loading/load_param.h"
@@ -33,8 +31,9 @@
 #include "sound_source.h"
 #include "sound_buffer.h"
+#include "resource_sound_buffer.h"
 
 #include "elements/glgui_energywidget.h"
 
-
+ObjectListDefinition(Weapon);
 
 ////////////////////
@@ -58,11 +57,8 @@
 {
   for (int i = 0; i < WS_STATE_COUNT; i++)
-    if (this->animation[i] && ClassList::exists(animation[i], CL_ANIMATION))  //!< @todo this should check animation3D
+    if (this->animation[i] && Animation::objectList().exists(animation[i]))  //!< @todo this should check animation3D
       delete this->animation[i];
-  for (int i = 0; i < WA_ACTION_COUNT; i++)
-    if (this->soundBuffers[i] != NULL && ClassList::exists(this->soundBuffers[i], CL_SOUND_BUFFER))
-      ResourceManager::getInstance()->unload(this->soundBuffers[i]);
-
-  if (ClassList::exists(this->soundSource, CL_SOUND_SOURCE))
+
+  if (OrxSound::SoundSource::objectList().exists(this->soundSource))
     delete this->soundSource;
 }
@@ -73,10 +69,10 @@
  * @returns the newly created Weapon.
  */
-Weapon* Weapon::createWeapon(ClassID weaponID)
+Weapon* Weapon::createWeapon(const ClassID& weaponID)
 {
   BaseObject* createdObject = Factory::fabricate(weaponID);
   if (createdObject != NULL)
   {
-    if (createdObject->isA(CL_WEAPON))
+    if (createdObject->isA(Weapon::staticClassID()))
       return dynamic_cast<Weapon*>(createdObject);
     else
@@ -89,4 +85,21 @@
 }
 
+Weapon* Weapon::createWeapon(const std::string& weaponName)
+{
+  BaseObject* createdObject = Factory::fabricate(weaponName);
+  if (createdObject != NULL)
+  {
+    if (createdObject->isA(Weapon::staticClassID()))
+      return dynamic_cast<Weapon*>(createdObject);
+    else
+    {
+      delete createdObject;
+      return NULL;
+    }
+  }
+  return NULL;
+}
+
+
 /**
  * initializes the Weapon with ALL default values
@@ -96,5 +109,5 @@
 void Weapon::init()
 {
-  this->setClassID(CL_WEAPON, "Weapon");
+  this->registerObject(this, Weapon::_objectList);
   this->currentState     = WS_INACTIVE;            //< Normaly the Weapon is Inactive
   this->requestedAction  = WA_NONE;                //< No action is requested by default
@@ -105,6 +118,4 @@
     this->animation[i] = NULL;                   //< No animation
   }
-  for (int i = 0; i < WA_ACTION_COUNT; i++)
-    this->soundBuffers[i] = NULL;                  //< No Sounds
 
   this->soundSource = new OrxSound::SoundSource(this);       //< Every Weapon has exacty one SoundSource.
@@ -115,5 +126,5 @@
   this->defaultTarget = NULL;                      //< Nothing is Targeted by default.
 
-  this->projectile = CL_NULL;                      //< No Projectile Class is Connected to this weapon
+  this->projectile = NullClass::staticClassID();         //< No Projectile Class is Connected to this weapon
   this->projectileFactory = NULL;                  //< No Factory generating Projectiles is selected.
 
@@ -163,8 +174,6 @@
  * What it does, is telling the Weapon what Projectiles it can Emit.
  */
-void Weapon::setProjectileType(ClassID projectile)
-{
-  if (projectile == CL_NULL)
-    return;
+void Weapon::setProjectileType(const ClassID& projectile)
+{
   this->projectile = projectile;
   this->projectileFactory = FastFactory::searchFastFactory(projectile);
@@ -259,11 +268,9 @@
   if (action >= WA_ACTION_COUNT)
     return;
-  if (this->soundBuffers[action] != NULL)
-    ResourceManager::getInstance()->unload(this->soundBuffers[action]);
 
   else if (!soundFile.empty())
   {
-    this->soundBuffers[action] = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV);
-    if (this->soundBuffers[action] != NULL)
+    this->soundBuffers[action] = OrxSound::ResourceSoundBuffer(soundFile);
+    if (this->soundBuffers[action].loaded())
     {
       PRINTF(4)("Loaded sound %s to action %s.\n", soundFile.c_str(), actionToChar(action));
@@ -275,5 +282,5 @@
   }
   else
-    this->soundBuffers[action] = NULL;
+    this->soundBuffers[action] = OrxSound::SoundBuffer();
 }
 
@@ -409,21 +416,21 @@
   {
     case WA_SHOOT:
-      return this->fireW();
-      break;
+    return this->fireW();
+    break;
     case WA_CHARGE:
-      return this->chargeW();
-      break;
+    return this->chargeW();
+    break;
     case WA_RELOAD:
-      return this->reloadW();
-      break;
+    return this->reloadW();
+    break;
     case WA_DEACTIVATE:
-      return this->deactivateW();
-      break;
+    return this->deactivateW();
+    break;
     case WA_ACTIVATE:
-      return this->activateW();
-      break;
+    return this->activateW();
+    break;
     default:
-      PRINTF(2)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
-      return false;
+    PRINTF(2)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
+    return false;
   }
 }
@@ -438,5 +445,5 @@
   {
     // play Sound
-    if (likely(this->soundBuffers[WA_ACTIVATE] != NULL))
+    if (likely(this->soundBuffers[WA_ACTIVATE].loaded()))
       this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
     this->updateWidgets();
@@ -460,5 +467,5 @@
     PRINTF(4)("Deactivating the Weapon %s\n", this->getCName());
     // play Sound
-    if (this->soundBuffers[WA_DEACTIVATE] != NULL)
+    if (this->soundBuffers[WA_DEACTIVATE].loaded())
       this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]);
     // deactivate
@@ -479,5 +486,5 @@
   {
     // playing Sound
-    if (this->soundBuffers[WA_CHARGE] != NULL)
+    if (this->soundBuffers[WA_CHARGE].loaded())
       this->soundSource->play(this->soundBuffers[WA_CHARGE]);
 
@@ -504,5 +511,5 @@
   {
     // playing Sound
-    if (this->soundBuffers[WA_SHOOT] != NULL)
+    if (this->soundBuffers[WA_SHOOT].loaded())
       this->soundSource->play(this->soundBuffers[WA_SHOOT]);
     this->updateWidgets();
@@ -528,5 +535,5 @@
 {
   PRINTF(4)("Reloading Weapon %s\n", this->getCName());
-  if (this->ammoContainer.get() != NULL &&
+  if (!this->ammoContainer.isNull() &&
       unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
   {
@@ -537,8 +544,8 @@
 
 
-  if (this->soundBuffers[WA_RELOAD] != NULL)
+  if (this->soundBuffers[WA_RELOAD].loaded())
     this->soundSource->play(this->soundBuffers[WA_RELOAD]);
 
-  if (this->ammoContainer.get() != NULL)
+  if (!this->ammoContainer.isNull())
     this->ammoContainer->fillWeapon(this);
   else
@@ -680,24 +687,24 @@
   {
     case WA_SHOOT:
-      return "shoot";
-      break;
+    return "shoot";
+    break;
     case WA_CHARGE:
-      return "charge";
-      break;
+    return "charge";
+    break;
     case WA_RELOAD:
-      return "reload";
-      break;
+    return "reload";
+    break;
     case WA_ACTIVATE:
-      return "activate";
-      break;
+    return "activate";
+    break;
     case WA_DEACTIVATE:
-      return "deactivate";
-      break;
+    return "deactivate";
+    break;
     case WA_SPECIAL1:
-      return "special1";
-      break;
+    return "special1";
+    break;
     default:
-      return "none";
-      break;
+    return "none";
+    break;
   }
 }
@@ -743,27 +750,27 @@
   {
     case WS_SHOOTING:
-      return "shooting";
-      break;
+    return "shooting";
+    break;
     case WS_CHARGING:
-      return "charging";
-      break;
+    return "charging";
+    break;
     case WS_RELOADING:
-      return "reloading";
-      break;
+    return "reloading";
+    break;
     case WS_ACTIVATING:
-      return "activating";
-      break;
+    return "activating";
+    break;
     case WS_DEACTIVATING:
-      return "deactivating";
-      break;
+    return "deactivating";
+    break;
     case WS_IDLE:
-      return "idle";
-      break;
+    return "idle";
+    break;
     case WS_INACTIVE:
-      return "inactive";
-      break;
+    return "inactive";
+    break;
     default:
-      return "none";
-      break;
-  }
-}
+    return "none";
+    break;
+  }
+}
Index: trunk/src/world_entities/weapons/weapon.h
===================================================================
--- trunk/src/world_entities/weapons/weapon.h	(revision 9656)
+++ trunk/src/world_entities/weapons/weapon.h	(revision 9869)
@@ -19,4 +19,6 @@
 #include "ammo_container.h"
 
+#include "sound_buffer.h"
+
 // FORWARD DECLARATION
 class Projectile;
@@ -83,9 +85,12 @@
 class Weapon : public WorldEntity
 {
+  ObjectListDeclaration(Weapon);
+
   public:
     // INITIALISATION //
     Weapon ();
     virtual ~Weapon ();
-    static Weapon* createWeapon(ClassID weaponID);
+    static Weapon* createWeapon(const ClassID& weaponID);
+    static Weapon* createWeapon(const std::string& weaponName);
 
     void init();
@@ -110,5 +115,5 @@
     /** @returns the Capabilities of this Weapon */
     inline long getCapability() const { return this->capability; };
-    void setProjectileType(ClassID projectile);
+    void setProjectileType(const ClassID& projectile);
     void setProjectileTypeC(const std::string& projectile);
     /** @returns The projectile's classID */
@@ -216,12 +221,12 @@
     // PHASES //
     ////////////
-    OrxSound::SoundSource* soundSource;                      //!< A SoundSource to play sound from (this is connected to the PNode of the Weapon)
-
-    WeaponState            currentState;                     //!< The State the weapon is in.
-    WeaponAction           requestedAction;                  //!< An action to try to Engage after the currentState ends.
-    float                  stateDuration;                    //!< how long the state has taken until now.
-    float                  times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState.
-    Animation3D*           animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
-    OrxSound::SoundBuffer* soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction.
+    OrxSound::SoundSource* soundSource;                     //!< A SoundSource to play sound from (this is connected to the PNode of the Weapon)
+
+    WeaponState            currentState;                    //!< The State the weapon is in.
+    WeaponAction           requestedAction;                 //!< An action to try to Engage after the currentState ends.
+    float                  stateDuration;                   //!< how long the state has taken until now.
+    float                  times[WS_STATE_COUNT];           //!< Times to stay in the different States @see WeaponState.
+    Animation3D*           animation[WS_STATE_COUNT];       //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
+    OrxSound::SoundBuffer  soundBuffers[WA_ACTION_COUNT];   //!< SoundBuffers for all actions @see WeaponAction.
 
     PNode                  emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
Index: trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.cc	(revision 9656)
+++ trunk/src/world_entities/weapons/weapon_manager.cc	(revision 9869)
@@ -17,14 +17,13 @@
 */
 
-#define DEBUG_SPECIAL_MODULE 4 //DEBUG_MODULE_WEAPON
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
 
 #include "weapon_manager.h"
 #include "weapon.h"
 #include "crosshair.h"
-#include "class_list.h"
 
 #include "playable.h"
 
-#include "util/loading/load_param.h"
+#include "util/loading/load_param_xml.h"
 #include "util/loading/factory.h"
 
@@ -32,4 +31,5 @@
 
 
+ObjectListDefinition(WeaponManager);
 /**
  * @brief this initializes the weaponManager for a given nnumber of weapon slots
@@ -57,6 +57,6 @@
   // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.)
   // rennerc: crosshair seems not to delete itselve
-  if (ClassList::exists(this->crosshair, CL_CROSSHAIR))
-    delete this->crosshair;
+  //if (Crosshair::objectList().exists(this->crosshair))
+  //  delete this->crosshair;
 }
 
@@ -66,5 +66,5 @@
 void WeaponManager::init()
 {
-  this->setClassID(CL_WEAPON_MANAGER, "WeaponManager");
+  this->registerObject(this, WeaponManager::_objectList);
 
   this->parentNode = NULL;
@@ -298,9 +298,9 @@
   {
     this->parentNode->addChild(weapon);
-    if (this->parentEntity->isA(CL_PLAYABLE))
+    if (this->parentEntity->isA(Playable::staticClassID()))
       dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
     weapon->setDefaultTarget(this->crosshair);
   }
-  PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
+  PRINTF(4)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
   return true;
 }
@@ -311,5 +311,5 @@
  * @param ammo the ammo to increase
  */
-float WeaponManager::increaseAmmunition(ClassID projectileType, float ammo)
+float WeaponManager::increaseAmmunition(const ClassID& projectileType, float ammo)
 {
   return this->getAmmoContainer(projectileType)->increaseEnergy(ammo);
@@ -324,5 +324,5 @@
 {
   assert (weapon != NULL);
-  return this->increaseAmmunition(weapon->getLeafClassID(), ammo);
+  return this->increaseAmmunition(weapon->getClassID(), ammo);
 
 }
@@ -468,5 +468,5 @@
       else
         this->currentSlotConfig[i].position.deactivateNode();
-      if (this->parentEntity != NULL && this->parentEntity->isA(CL_PLAYABLE))
+      if (this->parentEntity != NULL && this->parentEntity->isA(Playable::staticClassID()))
         dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
     }
@@ -523,5 +523,5 @@
 }
 
-CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(ClassID projectileType)
+CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const ClassID& projectileType)
 {
   for (unsigned int i = 0; i < this->ammo.size(); i++)
@@ -537,5 +537,5 @@
 {
   assert (weapon != NULL);
-  return (this->getAmmoContainer(weapon->getLeafClassID()));
+  return (this->getAmmoContainer(weapon->getClassID()));
 }
 
Index: trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.h	(revision 9656)
+++ trunk/src/world_entities/weapons/weapon_manager.h	(revision 9869)
@@ -39,4 +39,5 @@
  */
 class WeaponManager : public BaseObject {
+  ObjectListDeclaration(WeaponManager);
 
   //! an enumerator defining a Slot, where a Weapon can be stored inside.
@@ -89,5 +90,5 @@
     void changeWeaponConfig(int weaponConfig);
 
-    float increaseAmmunition(ClassID projectileType, float ammo);
+    float increaseAmmunition(const ClassID& projectileType, float ammo);
     float inclreaseAmmunition(const Weapon* weapon, float ammo);
 
@@ -106,5 +107,5 @@
  // private:
     int getNextFreeSlot(int configID, long capability = WTYPE_ALL);
-    CountPointer<AmmoContainer>& getAmmoContainer(ClassID projectileType);
+    CountPointer<AmmoContainer>& getAmmoContainer(const ClassID& projectileType);
     CountPointer<AmmoContainer>& getAmmoContainer(const Weapon* weapon);
 
