Index: trunk/src/util/Makefile.am
===================================================================
--- trunk/src/util/Makefile.am	(revision 9656)
+++ trunk/src/util/Makefile.am	(revision 9869)
@@ -4,5 +4,5 @@
 noinst_LIBRARIES = libORXutils.a
 
-libORXutils_a_SOURCES = fast_factory.cc \
+libORXutils_a_SOURCES = \
 			object_manager.cc \
 			state.cc \
@@ -31,5 +31,5 @@
 			track/track_node.cc
 
-noinst_HEADERS =        fast_factory.h \
+noinst_HEADERS =        \
 			object_manager.h \
 			state.h \
Index: trunk/src/util/animation/animation.cc
===================================================================
--- trunk/src/util/animation/animation.cc	(revision 9656)
+++ trunk/src/util/animation/animation.cc	(revision 9869)
@@ -20,4 +20,5 @@
 #include "animation_player.h"
 
+ObjectListDefinition(Animation);
 /**
  *  creates a new Animation
@@ -27,5 +28,5 @@
 Animation::Animation()
 {
-  this->setClassID(CL_ANIMATION, "Animation");
+  this->registerObject(this, Animation::_objectList);
 
   // initialize a beginning KeyFrame, that will be deleted afterwards
Index: trunk/src/util/animation/animation.h
===================================================================
--- trunk/src/util/animation/animation.h	(revision 9656)
+++ trunk/src/util/animation/animation.h	(revision 9869)
@@ -73,5 +73,6 @@
 class Animation : public BaseObject
 {
- public:
+  ObjectListDeclaration(Animation);
+public:
   virtual ~Animation();
 
@@ -95,10 +96,10 @@
   inline bool ifDelete() { return bDelete; };
 
- protected:
+protected:
   Animation();
 
   void handleInfinity();
 
- protected:
+protected:
   // variables
   float                 localTime;              //!< The Time passed since the beginning of the currentKeyFrame.
@@ -119,9 +120,9 @@
 class aTest
 {
- public:
+public:
   inline aTest() { last = 0.0;}
   /** a little debug information to show the results of this class @param f new value */
   inline void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
- private:
+private:
   float     diff;           //!< difference from the last value
   float     last;           //!< the last calculated value
Index: trunk/src/util/animation/animation_player.cc
===================================================================
--- trunk/src/util/animation/animation_player.cc	(revision 9656)
+++ trunk/src/util/animation/animation_player.cc	(revision 9869)
@@ -22,5 +22,5 @@
 
 
-
+ObjectListDefinition(AnimationPlayer);
 /**
  *  standard constructor
@@ -28,5 +28,5 @@
 AnimationPlayer::AnimationPlayer ()
 {
-  this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer");
+  this->registerObject(this, AnimationPlayer::_objectList);
   this->setName("AnimationPlayer");
 
Index: trunk/src/util/animation/animation_player.h
===================================================================
--- trunk/src/util/animation/animation_player.h	(revision 9656)
+++ trunk/src/util/animation/animation_player.h	(revision 9869)
@@ -28,7 +28,9 @@
    eveything else will be done by the AnimationPlayer itself.\n
 */
-class AnimationPlayer : public BaseObject {
+class AnimationPlayer : public BaseObject
+{
+  ObjectListDeclaration(AnimationPlayer);
 
- public:
+public:
   /** @returns a Pointer to the only object of this Class */
   inline static AnimationPlayer* getInstance() { if (!singletonRef) singletonRef = new AnimationPlayer();  return singletonRef; };
@@ -50,5 +52,5 @@
   void debug();
 
- private:
+private:
   /* singleton */
   AnimationPlayer();
Index: trunk/src/util/fast_factory.cc
===================================================================
--- trunk/src/util/fast_factory.cc	(revision 9656)
+++ 	(revision )
@@ -1,283 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-### File Specific:
-   main-programmer: Benjamin Grauer
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
-
-#include "fast_factory.h"
-
-#include "compiler.h"
-#include "debug.h"
-#include <string.h>
-
-
-
-/**
- * Initializes a FastFactory
- * @param classID the ClassID this Class belongs to (the top-most)
- * @param fastFactoryName the Name of the ObjectClass-handled here
- * @return a new FastFactory
- */
-FastFactory::FastFactory (ClassID classID, const std::string& fastFactoryName)
-{
-  this->setClassID(CL_FAST_FACTORY, "FastFactory");
-  this->setName(fastFactoryName);
-
-  this->storedClassID = classID;
-  this->next = NULL;
-
-  this->deadList = NULL;
-  this->unusedContainers = NULL;
-
-  this->storedDeadObjects = 0;
-
-  FastFactory::registerFastFactory(this);
-}
-
-/** a reference to the First FastFactory */
-FastFactory* FastFactory::first = NULL;
-
-/**
- *  destructor
- * deletes all the Instances of the FastFactory.
- */
-FastFactory::~FastFactory ()
-{
-  if (this == first)
-    this->first = NULL;
-  this->flush();
-
-  if (this->next)
-    delete this->next;
-}
-
-/**
- * deletes all FastFactories
- */
-void FastFactory::deleteAll()
-{
-  if (FastFactory::first)
-    delete FastFactory::first;
-}
-
-/**
- * registers a Factory to the List of known factories.
- * @param fastFactory The factory to add
- *
- * needed, to step through all the FastFactories.
- */
-void FastFactory::registerFastFactory(FastFactory* fastFactory)
-{
-  PRINTF(4)("Registered FastFactory for '%s'\n", fastFactory->getCName());
-
-  if( FastFactory::first == NULL)
-    FastFactory::first = fastFactory;
-  else
-  {
-    FastFactory* tmpFac = FastFactory::first;
-    while( tmpFac->next != NULL)
-      tmpFac = tmpFac->next;
-    tmpFac->setNext(fastFactory);
-  }
-}
-
-/**
- * searches for a FastFactory
- * @param classID the ClassID of the FastFactory to search for
- * @returns true if found, false otherwise.
- */
-FastFactory* FastFactory::searchFastFactory(ClassID classID)
-{
-  if (FastFactory::first == NULL)
-    return NULL;
-  else
-  {
-    FastFactory* tmpFac = FastFactory::first;
-    while (tmpFac != NULL)
-    {
-      if (tmpFac->storedClassID == classID)
-        return tmpFac;
-      tmpFac = tmpFac->next;
-    }
-  }
-  return NULL;
-}
-
-/**
- * searches for a FastFactory
- * @param classID the ClassID of the FastFactory to search for
- * @returns true if found, false otherwise.
- */
-FastFactory* FastFactory::searchFastFactory(const std::string& fastFactoryName)
-{
-  if (FastFactory::first == NULL)
-    return NULL;
-  else
-  {
-    FastFactory* tmpFac = FastFactory::first;
-    while (tmpFac != NULL)
-    {
-      if (fastFactoryName == tmpFac->getCName())
-        return tmpFac;
-      tmpFac = tmpFac->next;
-    }
-  }
-  return NULL;
-}
-
-/**
- * Removes all the stored Containers, and sets the Lists back to emptienes.
- * @param hardFLUSH if true the containing Objects will also be deleted !! THIS IS DANGEROUS !!
- */
-void FastFactory::flushAll(bool hardFLUSH)
-{
-  FastFactory* tmpFac = FastFactory::first;
-  while (tmpFac != NULL)
-  {
-    PRINTF(4)("DELETEING ALL OF %s\n",tmpFac->getCName());
-    tmpFac->flush(hardFLUSH);
-    tmpFac = tmpFac->next;
-  }
-}
-
-/**
- * ereases all the remaining containers, without deleting the stored Objects inside of them.
- * @param hardFLUSH if the the containing Objects will also be deleted !! THIS IS DANGEROUS !!
- */
-void FastFactory::flush(bool hardFLUSH)
-{
-  FastObjectMember* tmpMember = this->deadList, *delMember = NULL;
-  while (tmpMember != NULL)
-  {
-    delMember = tmpMember;
-    tmpMember = tmpMember->next;
-    if (hardFLUSH)
-    {
-      delete delMember->objectPointer;
-    }
-    delete delMember;
-  }
-  this->deadList = NULL;
-
-  tmpMember = this->unusedContainers;
-  while (tmpMember != NULL)
-  {
-    delMember = tmpMember;
-    tmpMember = tmpMember->next;
-    delete delMember;
-  }
-  this->unusedContainers = NULL;
-}
-
-/**
- * generates count new Object of the Corresponding class. (precaching)
- * @param count How many instances of the class should be generated.
- */
-void FastFactory::prepare(unsigned int count)
-{
-/*  if (this->storedDeadObjects + this->storedLivingObjects >= count)
-  {
-  PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassCName());
-}*/
-  for (unsigned int i = this->storedDeadObjects; i < count; i++)
-  {
-    this->fabricate();
-  }
-}
-
-/**
- * gives back live to one Object.
- * @return the Object to resurrect.
- */
-BaseObject* FastFactory::resurrect()
-{
-  PRINTF(4)("Resurecting Object of type %s\n", this->getCName());
-  if (unlikely(this->deadList == NULL))
-  {
-    PRINTF(3)("The deadList of Class %s is empty, this may be either because it has not been filled yet, or the cache is to small.\n" \
-        "  Developer: try increasing the count with FastFactory::prepare(contHigher than actual)\n" \
-        "    Fabricating a new %s\n", this->getCName(), this->getCName());
-    this->fabricate();
-    return this->resurrect();
-  }
-  else
-  {
-    FastObjectMember* tmpC = this->deadList;
-    this->deadList = this->deadList->next;
-
-    tmpC->next = this->unusedContainers;
-    this->unusedContainers = tmpC;
-
-    return tmpC->objectPointer;
-  }
-}
-
-/**
- * gives back live to one Object.
- * @param classID the class From which to resurrect an Object.
- * @return the Object to resurrect, NULL if classID is not found.
- */
-BaseObject* FastFactory::resurrect(ClassID classID)
-{
-  FastFactory* tmpFac = FastFactory::getFirst();
-
-  while (tmpFac != NULL)
-  {
-    if (classID == tmpFac->storedClassID)
-      return tmpFac->resurrect();
-    tmpFac = tmpFac->next;
-  }
-  return NULL;
-}
-
-/**
- * kills Object object, meaning, that it will be stored in the deadList of the FastFactory, and waiting for resurrection
- * @param object the Object to kill.
- *
- * synony that would be really grate would be abolish, but this is more like exterminate than pause-mode.
- */
-void FastFactory::kill(BaseObject* object)
-{
-  FastObjectMember* tmpC;
-  if (unlikely(this->unusedContainers == NULL))
-  {
-    tmpC = new FastObjectMember;
-  }
-  else
-  {
-    tmpC = this->unusedContainers;
-    this->unusedContainers = this->unusedContainers->next;
-  }
-
-  tmpC->next = this->deadList;
-  tmpC->objectPointer = object;
-  this->deadList = tmpC;
-}
-
-
-void FastFactory::kill(BaseObject* object, bool searchForFastFactory)
-{
-  if (likely(searchForFastFactory == true))
-  {
-    FastFactory* tmpFac = FastFactory::first;
-    while (tmpFac != NULL)
-    {
-      if (object->isA(tmpFac->storedClassID))
-      {
-        tmpFac->kill(object);
-        return;
-      }
-      tmpFac = tmpFac->next;
-    }
-  }
-}
Index: trunk/src/util/fast_factory.h
===================================================================
--- trunk/src/util/fast_factory.h	(revision 9656)
+++ 	(revision )
@@ -1,175 +1,0 @@
-/*!
- * @file fast_factory.h
- * The ObjectManager (FastFactory) is designed, to automatically generate and remove
- * (without to much overhead) many instances of different classes.
- *
- * It is especially usefull for objects, that come only for a short time into existence,
- * and get killed after a small amount of time (like shots).
- *
- * The Creation of an Object is usually done in the Weapon Class, where one subscribes
- * a Projectile with:
- * this->bulletFactory = tFastFactory<TestBullet>::getFastFactory(CL_TEST_BULLET, "TestBullet");
- * (this might change over time).
- * Then you can at loading time initialize an amount of the class with something like:
- * this->bulletFactory->prepare(100); // creates 100 entities of TestBullet (dead ones)
- * afterwards one can just retrieve an Object form the Class with
- * this->bulletFactory->resurrect();  // this returns a BaseObject an Object of the class.
- *
- * The big difference to the FastFactory-class is, that this one is used more for the purpose
- * of fast game-interaction than for loading. althought one can also load FastFactorized classes
- * it is not the main topic.
- */
-
-#ifndef _FAST_FACTORY_H
-#define _FAST_FACTORY_H
-
-#include "base_object.h"
-/**
- * Creates a FastFactory to a Createable FastFactory.
- */
-#define CREATE_FAST_FACTORY(CLASS_NAME, CLASS_ID) \
-  FastFactory* global_##CLASS_NAME##_FastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_ID, #CLASS_NAME)
-/**
- * Creates a FastFactory for a Class' static function named ClassName::fastFactory.
- * @param CLASS_NAME the name of the Class to create the fast-factory for.
- * @param CLASS_ID the ID of the class to create the fast-factory for @see "class_id.h"
- *
- * notice, that the Class to be called, must implement:
- * static FastFactory*         fastFactory;
- */
-#define CREATE_FAST_FACTORY_STATIC(CLASS_NAME, CLASS_ID) \
-  FastFactory* CLASS_NAME::fastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_ID, #CLASS_NAME)
-
-//! A struct, that holds Lists of Objects of a certain type.
-typedef struct FastObjectMember
-  {
-    BaseObject*          objectPointer;      //!< Pointer to the Object Stored in this Class (if it is the DeadList, else it is bork)
-
-    FastObjectMember*    next;               //!< the next stored FastObjectMember. (or NULL if this is the last one stored in either the deadList or the unusedContainers)
-  };
-
-//! The FastFactory is a fast loadable object creator, and Dynamic List of dead object handler.
-/**
- * The ObjectManager (FastFactory) is designed, to automatically generate and remove
- * (without to much overhead) many instances of different classes.
- *
- * FastFactory is needed to glue all the tFastFactories together.
- * It is also the general class that implements the necessary functions
- * to generate, resurrect kill and stuff...
- */
-class FastFactory : public BaseObject
-  {
-
-  public:
-    virtual ~FastFactory ();
-    static void deleteAll();
-
-    // functions to push and pop elements of this class
-    BaseObject* resurrect();
-    static BaseObject* resurrect(ClassID classID);
-    void kill(BaseObject* object);
-    static void kill(BaseObject* object, bool searchForFastFactory);
-
-    void prepare(unsigned int count);
-
-    static void flushAll(bool hardFLUSH = false);
-    void flush(bool hardFLUSH = false);
-
-    /** @returns the first FastFactory */
-    inline static FastFactory* getFirst() { return FastFactory::first; };
-
-    static FastFactory* searchFastFactory(ClassID classID);
-    static FastFactory* searchFastFactory(const std::string& fastFactoryName);
-
-    ClassID getStoredID() const { return this->storedClassID; };
-
-  protected:
-    FastFactory (ClassID classID, const std::string& fastFactoryName = "");
-
-    /** sets the Next factory in the list @param nextFactory the next factory */
-    inline void setNext( FastFactory* nextFastFactory) { this->next = nextFastFactory; };
-    /** @returns the next FastFactory */
-    FastFactory* getNext() const { return this->next; };
-
-    /** generates a new Object of the Class T */
-    virtual void fabricate() = 0;
-
-  private:
-    static void registerFastFactory(FastFactory* fastFactory);
-
-  protected:
-    ClassID               storedClassID;        //!< The classID of the specified class.
-    unsigned int          storedDeadObjects;    //!< How many dead objects are stored in this class
-
-    FastObjectMember*     deadList;             //!< A List of all stored dead Objects of this class.
-    FastObjectMember*     unusedContainers;     //!< This is a List of unused containers, that will be reused by kill.
-
-  private:
-    static FastFactory*   first;                //!< A pointer to the first FastFactory.
-
-    FastFactory*          next;                 //!< pointer to the next FastFactory.
-  };
-
-
-
-/**
- *  a FastFactory that is able to load any kind of Object from a ClassID
- * (this is a Functor)
- */
-template<class T>
-class tFastFactory : public FastFactory
-  {
-  public:
-    static tFastFactory<T>* getFastFactory(ClassID classID, const std::string& fastFactoryName = NULL);
-
-  private:
-    tFastFactory(ClassID classID, const std::string& fastFactoryName);
-
-    virtual void fabricate();
-  };
-
-/**
- * construnts a FastFactory with
- * @param fastFactoryName the name of the FastFactory
- * @param fastFactory the ID of the class
- * @todo (can this be written in another form??)
- */
-template<class T>
-tFastFactory<T>::tFastFactory(ClassID classID, const std::string& fastFactoryName)
-    : FastFactory(classID, fastFactoryName)
-{}
-
-/**
- * creates (if not existent) a Factory of Class T, and assigns some values to it
- * @param classID the ClassID to assign to this class
- * @param fastFactoryName the name to assign
- * @returns The FastFactory if existent a new Factory if not.
- */
-template<class T>
-    tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const std::string& fastFactoryName)
-{
-  tFastFactory<T>* tmpFac = NULL;
-  if (FastFactory::getFirst() != NULL)
-    tmpFac = static_cast<tFastFactory<T>*>(FastFactory::getFirst()->searchFastFactory(classID));
-
-  if (tmpFac != NULL)
-    return tmpFac;
-  else
-    return new tFastFactory<T>(classID, fastFactoryName);
-}
-
-/**
- * fabricates an Object of Class T, that corresponds to classID.
- */
-template<class T>
-void tFastFactory<T>::fabricate()
-{
-  FastObjectMember* tmpFirstDead = new FastObjectMember;
-  tmpFirstDead->objectPointer = new T();
-  tmpFirstDead->next = this->deadList;
-  ++this->storedDeadObjects;
-
-  this->deadList = tmpFirstDead;
-}
-
-#endif /* _FAST_FACTORY_H */
Index: trunk/src/util/game_rules.cc
===================================================================
--- trunk/src/util/game_rules.cc	(revision 9656)
+++ trunk/src/util/game_rules.cc	(revision 9869)
@@ -17,5 +17,5 @@
 #include "game_rules.h"
 
-#include "util/loading/load_param.h"
+#include "util/loading/load_param_xml.h"
 #include "util/loading/factory.h"
 
@@ -28,5 +28,5 @@
 
 
-
+ObjectListDefinition(GameRules);
 
 /**
@@ -35,5 +35,5 @@
 GameRules::GameRules(const TiXmlElement* root)
 {
-  this->setClassID(CL_GAME_RULES, "GameRules");
+  this->registerObject(this, GameRules::_objectList);
 }
 
Index: trunk/src/util/game_rules.h
===================================================================
--- trunk/src/util/game_rules.h	(revision 9656)
+++ trunk/src/util/game_rules.h	(revision 9869)
@@ -23,4 +23,5 @@
 class GameRules : virtual public BaseObject
 {
+  ObjectListDeclaration(GameRules);
 
   public:
Index: trunk/src/util/hud.cc
===================================================================
--- trunk/src/util/hud.cc	(revision 9656)
+++ trunk/src/util/hud.cc	(revision 9869)
@@ -34,4 +34,5 @@
 #include "playable.h"
 
+ObjectListDefinition(Hud);
 /**
  * standard constructor
@@ -40,5 +41,5 @@
 Hud::Hud ()
 {
-  this->setClassID(CL_HUD, "Hud");
+  this->registerObject(this, Hud::_objectList);
 
   //this->setSize2D(
@@ -184,8 +185,8 @@
   if (State::getPlayer() && State::getPlayer()->getPlayable() && State::getObjectManager())
   {
-    printf("UPDATING RADAR\n");
+    PRINTF(4)("UPDATING RADAR\n");
     this->_radar->setCenterNode(State::getPlayer()->getPlayable());
-    this->_radar->addEntityList(&State::getObjectManager()->getObjectList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
-    this->_radar->addEntityList(&State::getObjectManager()->getObjectList(OM_GROUP_02), Color(1.0, .2, .2));
+    this->_radar->addEntityList(&State::getObjectManager()->getEntityList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
+    this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_02), Color(1.0, .2, .2));
     this->_radar->setAbsCoor2D(0.8 * this->resX, 0.01 * this->resY);
     this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY);
Index: trunk/src/util/hud.h
===================================================================
--- trunk/src/util/hud.h	(revision 9656)
+++ trunk/src/util/hud.h	(revision 9869)
@@ -23,4 +23,5 @@
 class Hud : public Element2D, public EventListener
 {
+  ObjectListDeclaration(Hud);
 
 public:
Index: trunk/src/util/kill_target.cc
===================================================================
--- trunk/src/util/kill_target.cc	(revision 9656)
+++ trunk/src/util/kill_target.cc	(revision 9869)
@@ -22,6 +22,7 @@
 
 
-
-CREATE_FACTORY(KillTarget, CL_KILL_TARGET);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(KillTarget, CL_KILL_TARGET);
+CREATE_FACTORY(KillTarget);
 
 
@@ -32,5 +33,5 @@
 KillTarget::KillTarget (const TiXmlElement* root)
         : MissionGoal(root) {
-    this->setClassID(CL_KILL_TARGET, "KillTarget");
+  this->registerObject(this, KillTarget::_objectList);
 
     if( root != NULL)
Index: trunk/src/util/kill_target.h
===================================================================
--- trunk/src/util/kill_target.h	(revision 9656)
+++ trunk/src/util/kill_target.h	(revision 9869)
@@ -17,4 +17,5 @@
 class KillTarget : public MissionGoal
 {
+  ObjectListDeclaration(KillTarget);
 
   public:
Index: trunk/src/util/mission_goal.cc
===================================================================
--- trunk/src/util/mission_goal.cc	(revision 9656)
+++ trunk/src/util/mission_goal.cc	(revision 9869)
@@ -24,5 +24,5 @@
 
 
-
+ObjectListDefinition(MissionGoal);
 /**
  * standard constructor
@@ -31,5 +31,5 @@
 MissionGoal::MissionGoal (const TiXmlElement* root)
 {
-   this->setClassID(CL_MISSION_GOAL, "MissionGoal");
+  this->registerObject(this, MissionGoal::_objectList);
 
    this->missionState = MS_PASSIVE;
Index: trunk/src/util/mission_goal.h
===================================================================
--- trunk/src/util/mission_goal.h	(revision 9656)
+++ trunk/src/util/mission_goal.h	(revision 9869)
@@ -26,4 +26,5 @@
 //! A class representing a mission goal
 class MissionGoal : public BaseObject {
+  ObjectListDeclaration(MissionGoal);
 
  public:
Index: trunk/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- trunk/src/util/multiplayer_team_deathmatch.cc	(revision 9656)
+++ trunk/src/util/multiplayer_team_deathmatch.cc	(revision 9869)
@@ -24,5 +24,4 @@
 #include "render2D/image_plane.h"
 #include "state.h"
-#include "class_list.h"
 
 #include "player.h"
@@ -33,5 +32,4 @@
 #include "shared_network_data.h"
 #include "terrain.h"
-#include "class_list.h"
 #include "space_ships/space_ship.h"
 
@@ -50,16 +48,15 @@
 
 
-
-
-CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
-
-
+#include "class_id_DEPRECATED.h"
+
+ObjectListDefinitionID(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
+CREATE_FACTORY(MultiplayerTeamDeathmatch);
 /**
  * constructor
  */
 MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root)
-  : NetworkGameRules(root)
-{
-  this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
+    : NetworkGameRules(root)
+{
+  this->registerObject(this, MultiplayerTeamDeathmatch::_objectList);
 
   this->bLocalPlayerDead = false;
@@ -114,11 +111,11 @@
 
   LoadParam(root, "death-penalty-timeout", this, MultiplayerTeamDeathmatch, setDeathPenaltyTimeout)
-      .describe("sets the time in seconds a player has to wait for respawn");
+  .describe("sets the time in seconds a player has to wait for respawn");
 
   LoadParam(root, "max-kills", this, MultiplayerTeamDeathmatch, setMaxKills)
-      .describe("sets the maximal kills for winning condition");
+  .describe("sets the maximal kills for winning condition");
 
   LoadParam(root, "num-teams", this, MultiplayerTeamDeathmatch, setNumTeams)
-      .describe("sets number of teams");
+  .describe("sets number of teams");
 
 }
@@ -192,8 +189,8 @@
   }
 
-//   if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) )
-//   {
-//     PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM);
-//   }
+  //   if( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) )
+  //   {
+  //     PRINTF(0)("prefered team id: %i, noteam: %i\n", PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId(), TEAM_NOTEAM);
+  //   }
 
   // check if the menu should be removed and the game state should be entered
@@ -273,5 +270,4 @@
   if( unlikely( this->bLocalPlayerDead))
   {
-
   }
 }
@@ -308,8 +304,8 @@
 {
   if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR )
-    return CL_SPECTATOR;
+    return ObjectListBase::retrieveIdentity("Spectator");
 
   if ( team == 0 || team == 1 )
-    return CL_TURBINE_HOVER;
+    return ObjectListBase::retrieveIdentity("TurbineHover");
 
   assert( false );
@@ -317,8 +313,8 @@
 
 
-std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, ClassID classId )
+std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, const ClassID& classId )
 {
   if (classId == CL_TURBINE_HOVER)
-   return "models/ships/hoverglider_mainbody.obj";
+    return "models/ships/hoverglider_mainbody.obj";
   if ( team == 0 )
     return "models/creatures/doom_guy.md2";
@@ -329,5 +325,5 @@
 }
 
-std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
+std::string MultiplayerTeamDeathmatch::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId )
 {
   if ( classId == CL_FPS_PLAYER )
@@ -342,7 +338,7 @@
 }
 
-float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, ClassID classId )
-{
-  if ( classId == CL_FPS_PLAYER )
+float MultiplayerTeamDeathmatch::getPlayableScale( int userId, int team, const ClassID& classId )
+{
+  if ( classId == ObjectListBase::retrieveIdentity(CL_FPS_PLAYER))
   {
     return 10.0f;
@@ -362,13 +358,9 @@
     teamScore[i] = 0;
 
-
-  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-
-  if ( !list )
-    return;
-
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
+  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
+       it != PlayerStats::objectList().end();
+       ++it)
+  {
+    PlayerStats & stats = *(*it);
 
     if ( stats.getTeamId() >= 0 )
@@ -390,12 +382,9 @@
     playersInTeam[i] = 0;
 
-  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-
-  if ( !list )
-    return 0;
-
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
+  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
+       it != PlayerStats::objectList().end();
+       ++it)
+  {
+    PlayerStats & stats = *(*it);
 
     if ( stats.getTeamId() >= 0 )
@@ -453,13 +442,9 @@
 void MultiplayerTeamDeathmatch::handleTeamChanges( )
 {
-  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-
-  if ( !list )
-    return;
-
-  //first server players with choices
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
+  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
+       it != PlayerStats::objectList().end();
+       ++it)
+  {
+    PlayerStats & stats = *(*it);
 
     if ( stats.getTeamId() != stats.getPreferedTeamId() )
@@ -473,7 +458,9 @@
 
   //now serve player who want join a random team
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
+  for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
+       it != PlayerStats::objectList().end();
+       ++it)
+  {
+    PlayerStats & stats = *(*it);
 
     if ( stats.getTeamId() != stats.getPreferedTeamId() )
@@ -587,5 +574,6 @@
     if ( event.bPressed )
       this->bShowTeamChange = true;
-  } else if ( event.type == SDLK_F1 )
+  }
+  else if ( event.type == SDLK_F1 )
   {
     if ( this->statsBox && !this->bLocalPlayerDead && event.bPressed )
@@ -683,9 +671,9 @@
 void MultiplayerTeamDeathmatch::hideStats( )
 {
-    if ( statsBox )
-    {
-      delete statsBox;
-      statsBox = NULL;
-    }
+  if ( statsBox )
+  {
+    delete statsBox;
+    statsBox = NULL;
+  }
 }
 
@@ -822,13 +810,12 @@
 void MultiplayerTeamDeathmatch::respawnPlayable( Playable * playable, int teamId, float delay )
 {
-  const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );
-
-  assert( list );
 
   std::vector<SpawningPoint*> spList;
 
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
+  for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
+       it != SpawningPoint::objectList().end();
+       ++it)
+  {
+    SpawningPoint * sp = (*it);
 
     if ( sp->getTeamId() == teamId )
@@ -838,7 +825,9 @@
   if ( spList.size() == 0 )
   {
-    for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-    {
-      SpawningPoint * sp = dynamic_cast<SpawningPoint*>(*it);
+    for (ObjectList<SpawningPoint>::const_iterator it = SpawningPoint::objectList().begin();
+	 it != SpawningPoint::objectList().end();
+	 ++it)
+    {
+      SpawningPoint * sp = (*it);
 
       if ( sp->getTeamId() < 0 )
Index: trunk/src/util/multiplayer_team_deathmatch.h
===================================================================
--- trunk/src/util/multiplayer_team_deathmatch.h	(revision 9656)
+++ trunk/src/util/multiplayer_team_deathmatch.h	(revision 9869)
@@ -30,4 +30,5 @@
 class MultiplayerTeamDeathmatch : public NetworkGameRules, public EventListener
 {
+  ObjectListDeclaration(MultiplayerTeamDeathmatch);
 
   public:
@@ -39,7 +40,7 @@
     virtual int getTeamForNewUser();
     virtual ClassID getPlayableClassId( int userId, int team );
-    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
-    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
-    virtual float getPlayableScale( int userId, int team, ClassID classId );
+    virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId );
+    virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId );
+    virtual float getPlayableScale( int userId, int team, const ClassID& classId );
 
     virtual void registerSpawn( WorldEntity * we );
@@ -50,17 +51,17 @@
     inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; }
     inline void setMaxKills(int kills) { this->maxKills = kills; }
-    
+
     inline void setNumTeams( int numTeams ){ this->numTeams = numTeams; }
     inline int getNumTeams(){ return this->numTeams; }
-    
+
     int getRandomTeam();
-    
+
     virtual void process(const Event &event);
-    
+
     void onKill( WorldEntity * victim, WorldEntity * killer );
     void onRespawn( int userId );
-    
+
     virtual void handleChatMessage( int userId, const std::string & message, int messageType );
-    
+
     void respawnPlayable( Playable * playable, int teamId, float delay );
 
@@ -84,7 +85,7 @@
 
     OrxGui::GLGuiBox* box;
-    
+
     OrxGui::GLGuiInputLine* input;
-    
+
     void calculateTeamScore();
     void nextGameState();
@@ -92,5 +93,5 @@
     void teamChange( int userId );
     void assignPlayable();
-    
+
     void onButtonSpectator();
     void onButtonRandom();
@@ -99,11 +100,11 @@
     void onButtonCancel();
     void onButtonExit();
-    
+
     void onInputEnter( const std::string & text );
-    
+
     OrxGui::GLGuiBox* statsBox;
     OrxGui::GLGuiTable* table;
     void tickStatsTable();
-    
+
     void showStats();
     void hideStats();
Index: trunk/src/util/network_game_rules.cc
===================================================================
--- trunk/src/util/network_game_rules.cc	(revision 9656)
+++ trunk/src/util/network_game_rules.cc	(revision 9869)
@@ -22,4 +22,5 @@
 
 
+ObjectListDefinition(NetworkGameRules);
 
 /**
@@ -27,7 +28,7 @@
  */
 NetworkGameRules::NetworkGameRules ( const TiXmlElement* root )
-  : GameRules( root )
+    : GameRules( root )
 {
-  this->setClassID( CL_NETWORK_GAME_RULES, "NetworkGameRules");
+  this->registerObject(this, NetworkGameRules::_objectList);
 }
 
@@ -37,14 +38,13 @@
  */
 NetworkGameRules::~NetworkGameRules ()
-{
-}
+{}
 
 
-std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, ClassID classId )
+std::string NetworkGameRules::getPlayableModelTextureFileName( int userId, int team, const ClassID& classId )
 {
   return "";
 }
 
-std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, ClassID classId )
+std::string NetworkGameRules::getPlayableModelFileName( int uesrId, int team, const ClassID& classId )
 {
   return "models/ships/reap_#.obj";
@@ -53,5 +53,9 @@
 ClassID NetworkGameRules::getPlayableClassId( int userId, int team )
 {
-  return CL_SPACE_SHIP;
+  const ObjectListBase* objList = ObjectListBase::getObjectList("SpaceShip");
+  if (objList != NULL)
+    return objList->identity();
+  else
+    return ClassID();
 }
 
@@ -68,5 +72,5 @@
 
 
-float NetworkGameRules::getPlayableScale( int userId, int team, ClassID classId )
+float NetworkGameRules::getPlayableScale( int userId, int team, const ClassID& classId )
 {
   return 1.0f;
Index: trunk/src/util/network_game_rules.h
===================================================================
--- trunk/src/util/network_game_rules.h	(revision 9656)
+++ trunk/src/util/network_game_rules.h	(revision 9869)
@@ -15,19 +15,20 @@
 class NetworkGameRules : public GameRules
 {
+  ObjectListDeclaration(NetworkGameRules);
 
   public:
     NetworkGameRules( const TiXmlElement* root );
     virtual ~NetworkGameRules();
-    
+
     virtual int getTeamForNewUser();
     virtual ClassID getPlayableClassId( int userId, int team );
-    virtual std::string getPlayableModelFileName( int userId, int team, ClassID classId );
-    virtual std::string getPlayableModelTextureFileName( int userId, int team, ClassID classId );
-    virtual float getPlayableScale( int userId, int team, ClassID classId );
-    
+    virtual std::string getPlayableModelFileName( int userId, int team, const ClassID& classId );
+    virtual std::string getPlayableModelTextureFileName( int userId, int team, const ClassID& classId );
+    virtual float getPlayableScale( int userId, int team, const ClassID& classId );
+
     virtual PlayerStats * getNewPlayerStats( int userId ){ return new PlayerStats( userId ); }
-    
+
     virtual void handleChatMessage( int userId, const std::string & message, int messageType ) = 0;
-    
+
     void shellSay( const std::string & message );
 
Index: trunk/src/util/object_manager.cc
===================================================================
--- trunk/src/util/object_manager.cc	(revision 9656)
+++ trunk/src/util/object_manager.cc	(revision 9869)
@@ -17,5 +17,4 @@
 
 #include "object_manager.h"
-#include "class_list.h"
 
 #include "world_entity.h"
@@ -30,4 +29,5 @@
     ->defaultValues("", 0);
 
+ObjectListDefinition(ObjectManager);
 /**
  * @brief standard constructor
@@ -35,5 +35,5 @@
 ObjectManager::ObjectManager ()
 {
-   this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");
+  this->registerObject(this, ObjectManager::_objectList);
    this->setName("ObjectManager");
 
@@ -63,6 +63,6 @@
 {
   for (unsigned int i = 0; i < OM_SIZE; ++i)
-    while(!this->objectLists[i].empty())
-      delete this->objectLists[i].front();
+    while(!this->entityLists[i].empty())
+      delete this->entityLists[i].front();
 
   // delete reflection list
@@ -83,10 +83,10 @@
 
   if (likely(entity->getOMListNumber() != OM_INIT))
-    this->objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
+    this->entityLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
 
   if (likely(omList != OM_INIT))
   {
-    this->objectLists[omList].push_back(entity);
-    entity->getEntityIterator() = --this->objectLists[omList].end();
+    this->entityLists[omList].push_back(entity);
+    entity->getEntityIterator() = --this->entityLists[omList].end();
     entity->getOMListNumber() = omList;
   }
@@ -111,16 +111,20 @@
  * @returns a new List with a list of WorldEntities of distance Radius from center
  */
-void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID)
-{
-  const std::list<BaseObject*>* objectList = ClassList::getList(classID);
-  if (objectList != NULL)
+  /*
+void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, const ClassID& classID)
+{
+  TODO FIXME
+
+  const std::list<BaseObject*>* entityList = ClassList::getList(classID);
+  if (entityList != NULL)
   {
 
     std::list<BaseObject*>::const_iterator node;
-    for (node = objectList->begin(); node != objectList->end(); node++)
+    for (node = entityList->begin(); node != entityList->end(); node++)
       if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
         entities.push_back(dynamic_cast<WorldEntity*>(*node));
   }
 }
+  */
 
 
@@ -134,9 +138,9 @@
   if (omList != OM_INIT || omList == OM_SIZE)
   {
-    PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->objectLists[omList].size());
+    PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->entityLists[omList].size());
   //  if (level >= 1)
     {
       ObjectManager::EntityList::const_iterator entity;
-      for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
+      for (entity = this->entityLists[omList].begin(); entity != this->entityLists[omList].end(); entity++)
       {
         PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName());
Index: trunk/src/util/object_manager.h
===================================================================
--- trunk/src/util/object_manager.h	(revision 9656)
+++ trunk/src/util/object_manager.h	(revision 9869)
@@ -73,4 +73,5 @@
 class ObjectManager : public BaseObject
 {
+  ObjectListDeclaration(ObjectManager);
 public:
   typedef std::list<WorldEntity*> EntityList;      //!< A type definition to make it easy to use EntityLists.
@@ -86,9 +87,9 @@
 
   /** @returns the List (listnumber) of objects. @param listNumber the List to get. */
-  EntityList& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; }
+  EntityList& getEntityList(OM_LIST listNumber) { return this->entityLists[listNumber]; }
   /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */
-  const EntityList& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; }
+  const EntityList& getEntityList(OM_LIST listNumber) const { return this->entityLists[listNumber]; }
 
-  static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID);
+  template <class T> static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ObjectList<T>& list);
 
   void debug(OM_LIST omList, unsigned int level = 0) const;
@@ -111,5 +112,5 @@
   const std::list<BaseObject>*            pNodeList;                //!< The List of PNodes.
 
-  EntityList                              objectLists[OM_SIZE];     //!< The ObjectLists.
+  EntityList                              entityLists[OM_SIZE];     //!< The ObjectLists.
 
   static const std::string                objectManagerListNames[]; //!< Names of all the lists
Index: trunk/src/util/singleplayer_shootemup.cc
===================================================================
--- trunk/src/util/singleplayer_shootemup.cc	(revision 9656)
+++ trunk/src/util/singleplayer_shootemup.cc	(revision 9869)
@@ -25,8 +25,7 @@
 
 
-
-CREATE_FACTORY(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
-
-
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
+CREATE_FACTORY(SingleplayerShootemup);
 
 /**
@@ -36,5 +35,5 @@
   : GameRules(root)
 {
-  this->setClassID(CL_SINGLEPLAYER_SHOOTEMUP, "SingleplayerShootemup");
+  this->registerObject(this, SingleplayerShootemup::_objectList);
 
   if( root != NULL)
Index: trunk/src/util/singleplayer_shootemup.h
===================================================================
--- trunk/src/util/singleplayer_shootemup.h	(revision 9656)
+++ trunk/src/util/singleplayer_shootemup.h	(revision 9869)
@@ -18,5 +18,5 @@
 class SingleplayerShootemup : public GameRules
 {
-
+  ObjectListDeclaration(SingleplayerShootemup);
   public:
     SingleplayerShootemup(const TiXmlElement* root = NULL);
Index: trunk/src/util/track/pilot_node.cc
===================================================================
--- trunk/src/util/track/pilot_node.cc	(revision 9656)
+++ trunk/src/util/track/pilot_node.cc	(revision 9869)
@@ -24,4 +24,5 @@
 
 
+ObjectListDefinition(PilotNode);
 /**
  *  standard constructor
@@ -29,5 +30,5 @@
 PilotNode::PilotNode ()
 {
-   this->setClassID(CL_PILOT_PARENT, "PilotNode");
+  this->registerObject(this, PilotNode::_objectList);
    this->setName("PilotNode");
 
Index: trunk/src/util/track/pilot_node.h
===================================================================
--- trunk/src/util/track/pilot_node.h	(revision 9656)
+++ trunk/src/util/track/pilot_node.h	(revision 9869)
@@ -15,4 +15,5 @@
 //! The PilotNode is a node that enables the is driven by the Mouse
 class PilotNode : public WorldEntity, public EventListener {
+  ObjectListDeclaration(PilotNode);
 
  public:
Index: trunk/src/util/track/track_node.cc
===================================================================
--- trunk/src/util/track/track_node.cc	(revision 9656)
+++ trunk/src/util/track/track_node.cc	(revision 9869)
@@ -22,5 +22,5 @@
 
 
-
+ObjectListDefinition(TracNode);
 /**
  *  standard constructor
@@ -28,5 +28,5 @@
 TrackNode::TrackNode ()
 {
-  this->setClassID(CL_TRACK_NODE, "TrackNode");
+  this->registerObject(this, TracNode::_objectList);
   this->setName("TrackNode");
 
Index: trunk/src/util/track/track_node.h
===================================================================
--- trunk/src/util/track/track_node.h	(revision 9656)
+++ trunk/src/util/track/track_node.h	(revision 9869)
@@ -1,9 +1,9 @@
-/*! 
+/*!
  * @file track_node.h
   *  Definition of the TrackNode are located here
-    
-    the TrackNode is the node, that follows the Track (and the TrackManager) 
+
+    the TrackNode is the node, that follows the Track (and the TrackManager)
     through the level.
-    Under normal confitions the Plyaer(s) are 
+    Under normal confitions the Plyaer(s) are
 */
 
@@ -18,7 +18,7 @@
 
 //! A node that follows the track.
-class TrackNode : public PNode 
+class TrackNode : public PNode
 {
-
+  ObjectListDeclaratrion(TracNode);
  public:
   TrackNode ();
