Index: branches/world_entities/src/util/loading/factory.cc
===================================================================
--- branches/world_entities/src/util/loading/factory.cc	(revision 5558)
+++ branches/world_entities/src/util/loading/factory.cc	(revision 5622)
@@ -34,5 +34,5 @@
    set everything to zero and define factoryName
 */
-Factory::Factory (const char* factoryName)
+Factory::Factory (const char* factoryName, ClassID classID)
 {
   this->setClassID(CL_FACTORY, "Factory");
@@ -40,4 +40,5 @@
 
   this->next = NULL;
+  this->classID = classID;
 
   Factory::registerFactory(this);
Index: branches/world_entities/src/util/loading/factory.h
===================================================================
--- branches/world_entities/src/util/loading/factory.h	(revision 5558)
+++ branches/world_entities/src/util/loading/factory.h	(revision 5622)
@@ -33,6 +33,6 @@
  * this should be used at the beginning of all the Classes that should be loadable (in the cc-file)
 */
-#define CREATE_FACTORY(CLASS_NAME) \
-    tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME)
+#define CREATE_FACTORY(CLASS_NAME, CLASS_ID) \
+    tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME, CLASS_ID)
 
 //! The Factory is a loadable object handler
@@ -40,8 +40,9 @@
 
  public:
-  Factory (const char* factoryName = NULL);
+  Factory (const char* factoryName = NULL, ClassID classID = CL_NULL);
   virtual ~Factory ();
 
   void fabricate(const char* className, const char* entityName);
+  virtual BaseObject* fabricate(ClassID classID) = NULL;
   virtual BaseObject* fabricate(const TiXmlElement* root) = NULL;
   virtual BaseObject* fabricateDirect() = NULL;
@@ -57,4 +58,8 @@
     Factory* getNext() const { return this->next; };
 
+
+  protected:
+    ClassID           classID;              //!< The CLass-Identifyer of the Factory.
+
   private:
     Factory*          next;                 //!< pointer to the next factory.
@@ -64,15 +69,16 @@
 /**
  *  a factory that is able to load any kind of Object
-   (this is a Functor)
-*/
+ * (this is a Functor)
+ */
 template<class T> class tFactory : public Factory
 {
- public:
-  tFactory(const char* factoryName);
-  virtual ~tFactory();
+  public:
+    tFactory(const char* factoryName, ClassID classID);
+    virtual ~tFactory();
 
   private:
-  virtual BaseObject* fabricate(const TiXmlElement* root);
-  virtual BaseObject* fabricateDirect();
+    virtual BaseObject* fabricate(ClassID classID);
+    virtual BaseObject* fabricate(const TiXmlElement* root);
+    virtual BaseObject* fabricateDirect();
 };
 
@@ -82,16 +88,23 @@
 */
 template<class T>
-tFactory<T>::tFactory(const char* factoryName) : Factory(factoryName)
+    tFactory<T>::tFactory(const char* factoryName, ClassID classID) : Factory(factoryName, classID)
 {
   PRINTF(4)("Class: %s loadable\n", this->getName());
 }
 
-
+/**
+ * destructs the type-Factory
+ */
 template<class T>
-tFactory<T>::~tFactory()
+    tFactory<T>::~tFactory()
 {}
 
+/**
+ * fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
+ * @param root the TiXmlElement T should load parameters from.
+ * @return the newly fabricated T, NULL otherwise.
+ */
 template<class T>
-BaseObject* tFactory<T>::fabricate(const TiXmlElement* root)
+    BaseObject* tFactory<T>::fabricate(const TiXmlElement* root)
 {
   if (root == NULL)
@@ -106,4 +119,24 @@
 }
 
+
+/**
+ * fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
+ * @param classID the ClassID of T that should be created.
+ * @return the newly fabricated T if fabricated NULL otherwise.
+ */
+template<class T>
+    BaseObject* tFactory<T>::fabricate(ClassID classID)
+{
+  if(classID == this->classID)
+    return this->fabricateDirect();
+  else if( getNext() != NULL)
+    return getNext()->fabricate( classID);
+  else
+    return NULL;
+}
+
+/**
+ * directly fabricate an Entity of this factory.
+ */
 template<class T>
     BaseObject* tFactory<T>::fabricateDirect()
