Index: /code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/ClassFactory.h	(revision 457)
@@ -10,5 +10,4 @@
 
 #include "Identifier.h"
-#include "Debug.h"
 
 namespace orxonox
@@ -22,5 +21,5 @@
     {
         public:
-            static bool create();
+            static bool create(const std::string& name);
             BaseObject* fabricate();
 
@@ -34,19 +33,12 @@
 
     /**
-        @brief Adds the ClassFactory to the Identifier of the same type and creates a new object to retrieve the parents.
+        @brief Adds the ClassFactory to the Identifier of the same type and the Identifier to the Factory.
         @return Always true (this is needed because the compiler only allows assignments before main())
     */
     template <class T>
-    bool ClassFactory<T>::create()
+    bool ClassFactory<T>::create(const std::string& name)
     {
-        // Add the ClassFactory to the Classidentifier of type T
         ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>);
-
-        // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
-        ClassIdentifier<T>::getIdentifier()->startCreatingHierarchy();
-        COUT(4) << "*** Create Factory -> Create Class\n";
-        BaseObject* temp = ClassIdentifier<T>::getIdentifier()->fabricate();
-        delete temp;
-        ClassIdentifier<T>::getIdentifier()->stopCreatingHierarchy();
+        Factory::add(name, ClassIdentifier<T>::getIdentifier());
 
         return true;
Index: /code/branches/objecthierarchy/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/ConfigValueContainer.cc	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/ConfigValueContainer.cc	(revision 457)
@@ -421,5 +421,4 @@
         if (!ConfigValueContainer::readConfigFile_s)
             ConfigValueContainer::readConfigFile(CONFIGFILEPATH);
-
 
         // The string of the section we're searching
Index: /code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h	(revision 457)
@@ -81,5 +81,5 @@
 */
 #define CreateFactory(ClassName) \
-    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
+    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create(#ClassName)
 
 /**
Index: /code/branches/objecthierarchy/src/orxonox/core/Factory.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/Factory.cc	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/Factory.cc	(revision 457)
@@ -6,4 +6,6 @@
 #include "Factory.h"
 #include "Identifier.h"
+#include "Debug.h"
+#include "../objects/BaseObject.h"
 
 namespace orxonox
@@ -60,3 +62,25 @@
         pointer_s->identifierNetworkIDMap_[newID] = identifier;
     }
+
+    /**
+        @brief Creates the class-hierarchy by creating and destroying one object of each type.
+    */
+    void Factory::createClassHierarchy()
+    {
+        if (!pointer_s)
+            pointer_s = new Factory;
+
+        COUT(4) << "*** Factory -> Create class-hierarchy\n";
+        std::map<std::string, Identifier*>::iterator it;
+        it = pointer_s->identifierStringMap_.begin();
+        (*pointer_s->identifierStringMap_.begin()).second->startCreatingHierarchy();
+        for (it = pointer_s->identifierStringMap_.begin(); it != pointer_s->identifierStringMap_.end(); ++it)
+        {
+            // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
+            BaseObject* temp = (*it).second->fabricate();
+            delete temp;
+        }
+        (*pointer_s->identifierStringMap_.begin()).second->stopCreatingHierarchy();
+        COUT(4) << "*** Factory -> Finished class-hierarchy creation\n";
+    }
 }
Index: /code/branches/objecthierarchy/src/orxonox/core/Factory.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/Factory.h	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/Factory.h	(revision 457)
@@ -36,4 +36,5 @@
             static void add(const std::string& name, Identifier* identifier);
             static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
+            static void createClassHierarchy();
 
         private:
Index: /code/branches/objecthierarchy/src/orxonox/core/Identifier.h
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/core/Identifier.h	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/core/Identifier.h	(revision 457)
@@ -64,6 +64,5 @@
         friend class SubclassIdentifier; // Forward declaration
 
-        template <class T>
-        friend class ClassFactory; // Forward declaration
+        friend class Factory; // Forward declaration
 
         public:
@@ -216,5 +215,5 @@
             COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n";
             pointer_s->name_ = name;
-            Factory::add(name, pointer_s); // Add the Identifier to the Factory
+//            Factory::add(name, pointer_s); // Add the Identifier to the Factory
 
             if (bRootClass)
Index: /code/branches/objecthierarchy/src/orxonox/orxonox.cc
===================================================================
--- /code/branches/objecthierarchy/src/orxonox/orxonox.cc	(revision 456)
+++ /code/branches/objecthierarchy/src/orxonox/orxonox.cc	(revision 457)
@@ -119,5 +119,5 @@
         setupCEGUI();
         createFrameListener();
-
+        Factory::createClassHierarchy();
 
         #define testandcout(code) \
