Index: orxonox/branches/levelLoader/src/util/loading/factory.cc
===================================================================
--- orxonox/branches/levelLoader/src/util/loading/factory.cc	(revision 4253)
+++ orxonox/branches/levelLoader/src/util/loading/factory.cc	(revision 4254)
@@ -93,5 +93,6 @@
   const TiXmlNode* node;
 	
-  assert( root != NULL);
+  if (root == NULL)
+    return NULL;
   assert( name != NULL);
 	
Index: orxonox/branches/levelLoader/src/util/loading/factory.h
===================================================================
--- orxonox/branches/levelLoader/src/util/loading/factory.h	(revision 4253)
+++ orxonox/branches/levelLoader/src/util/loading/factory.h	(revision 4254)
@@ -33,9 +33,5 @@
     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); \
-        CREATE_LOAD_DOC(CLASS_NAME)
-
-
-		
+#define CREATE_FACTORY(CLASS_NAME) tFactory<CLASS_NAME>* global_##CLASS_NAME##Factory = new tFactory<CLASS_NAME>(#CLASS_NAME)		
 //! The Factory is
 class Factory {
Index: orxonox/branches/levelLoader/src/util/loading/load_param.cc
===================================================================
--- orxonox/branches/levelLoader/src/util/loading/load_param.cc	(revision 4253)
+++ orxonox/branches/levelLoader/src/util/loading/load_param.cc	(revision 4254)
@@ -16,13 +16,133 @@
 #include "load_param.h"
 
+#include "list.h"
+#include "base_object.h"
 
-BaseLoadParam::BaseLoadParam(BaseObject* object, const char* type1, const char* type2,
-		const char* type3, const char* type4, const char* type5)
+#include <stdarg.h>
+
+
+BaseLoadParam::BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...)
 {
-  
+  if (LoadClassDescription::parametersDescription)
+    {
+      // locating the class
+      this->classDesc = LoadClassDescription::addClass(object->getClassName());
+      this->paramDesc = this->classDesc->addParam(paramName);
+
+      this->paramDesc->types = new char*[paramCount];
+      this->paramDesc->paramCount = paramCount;
+
+      va_list types;
+      va_start (types, paramCount);
+      for(int i = 0; i < paramCount; i++)
+	{
+	  const char* tmpTypeName = va_arg (types, const char*);
+	  this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
+	  strcpy(this->paramDesc->types[i], tmpTypeName);
+	}
+      va_end(types);  
+
+      int argCount = 0;
+    }
 }
+
+
+void BaseLoadParam::describe(const char* descriptionText)
+{
+  if (this->paramDesc)
+    {
+      
+    }
+
+}
+
+
+LoadParamDescription::LoadParamDescription(const char* paramName)
+{
+  this->types = NULL;
+  this->paramName = new char[strlen(paramName)+1];
+  strcpy(this->paramName, paramName);
+}
+
+LoadParamDescription::~LoadParamDescription(void)
+{
+  for(int i = 0; i < this->paramCount; i++)
+    {
+      delete this->types[i];
+    }
+  delete []this->types;
+  delete []this->paramName;
+}
+
+
+tList<LoadClassDescription>* LoadClassDescription::classList = new tList<LoadClassDescription>;
 
 /**
    \brief if the description of Parameters should be executed
 */
-bool LoadClassDescription::parametersDescription = false;
+bool LoadClassDescription::parametersDescription = true;
+
+LoadClassDescription::LoadClassDescription(const char* className)
+{
+  this->className = new char[strlen(className)+1];
+  strcpy(this->className, className);
+
+  classList->add(this);
+
+  this->paramList = new tList<LoadParamDescription>;
+}
+
+LoadClassDescription::~LoadClassDescription(void)
+{
+  delete []this->className;
+
+  tIterator<LoadParamDescription>* iterator = this->paramList->getIterator();
+  LoadParamDescription* enumParamDesc = iterator->nextElement();
+  while (enumParamDesc)
+    {
+      delete enumParamDesc;
+      enumParamDesc = iterator->nextElement();
+    }
+  delete iterator;
+
+}
+
+
+LoadClassDescription* LoadClassDescription::addClass(const char* className)
+{
+  tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator();
+  LoadClassDescription* enumClassDesc = iterator->nextElement();
+  while (enumClassDesc)
+    {
+      if (!strcmp(enumClassDesc->className, className))
+	{
+	  delete iterator;
+	  return enumClassDesc;
+	}
+      enumClassDesc = iterator->nextElement();
+    }
+  delete iterator;
+
+  return new LoadClassDescription(className);
+}
+
+
+LoadParamDescription* LoadClassDescription::addParam(const char* paramName)
+{
+  tIterator<LoadParamDescription>* iterator = this->paramList->getIterator();
+  LoadParamDescription* enumParamDesc = iterator->nextElement();
+  while (enumParamDesc)
+    {
+      if (!strcmp(enumParamDesc->paramName, paramName))
+	{
+	  delete iterator;
+	  this->paramList->add(enumParamDesc);
+	  return enumParamDesc;
+	}
+      enumParamDesc = iterator->nextElement();
+    }
+  delete iterator;
+
+  this->paramList->add(new LoadParamDescription(paramName));
+  return paramList->lastElement();
+}
Index: orxonox/branches/levelLoader/src/util/loading/load_param.h
===================================================================
--- orxonox/branches/levelLoader/src/util/loading/load_param.h	(revision 4253)
+++ orxonox/branches/levelLoader/src/util/loading/load_param.h	(revision 4254)
@@ -65,5 +65,5 @@
 #define LoadParam1(type1) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \
-  : BaseLoadParam(pt2Object, type1##_NAME) \
+  : BaseLoadParam(pt2Object, paramName, 1, type1##_NAME) \
     { \
       const char* loadString = grabParameter(root, paramName); \
@@ -78,5 +78,5 @@
 #define LoadParam2(type1, type2) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \
-  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME) \
+  : BaseLoadParam(pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \
     { \
       const char* loadString = grabParameter(root, paramName); \
@@ -98,5 +98,5 @@
 #define LoadParam3(type1, type2, type3) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\
-  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME) \
+  : BaseLoadParam(pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \
     { \
       const char* loadString = grabParameter(root, paramName); \
@@ -118,5 +118,5 @@
 #define LoadParam4(type1, type2, type3, type4) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \
-  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
+  : BaseLoadParam(pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
     { \
       const char* loadString = grabParameter(root, paramName); \
@@ -138,5 +138,5 @@
 #define LoadParam5(type1, type2, type3, type4, type5) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE)) \
-  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
+  : BaseLoadParam(pt2Object, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
     { \
       const char* loadString = grabParameter(root, paramName); \
@@ -155,34 +155,32 @@
 
 
-
-#define CREATE_LOAD_DOC(CLASS_NAME) \
-  void documentLoadClass##CLASS_NAME(void) \
-    { \
-      if(LoadClassDescription::parametersDescription) \
-	{ \
-	  CLASS_NAME docuClass; \
-          docuClass.loadParams(NULL); \
-	} \
-    } 
-//  documentLoadClass();
-
-
 class LoadParamDescription
 {
+  friend class BaseLoadParam;
+  friend class LoadClassDescription;
+ public:
+  LoadParamDescription(const char* paramName);
+  ~LoadParamDescription(void);
  private:
+  char* paramName;
   int paramCount;
   char** types;
-  const char* className;
-
 };
 
 class LoadClassDescription
 {
+  friend class BaseLoadParam;
  public:
-
+  LoadClassDescription(const char* className);
+  ~LoadClassDescription(void);
+
+  static LoadClassDescription* addClass(const char* className);
+  LoadParamDescription* addParam(const char* paramName);
 
   static bool parametersDescription;
   
+  static tList<LoadClassDescription>* classList;
  private:
+  char* className;
   tList<LoadParamDescription>* paramList;
 };
@@ -192,9 +190,10 @@
 {
  protected:
-  BaseLoadParam(BaseObject* object, const char* type1 = NULL, const char* type2 = NULL,
-		const char* type3 = NULL, const char* type4 = NULL, const char* type5 = NULL);
+  BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...);
+  void describe(const char* descriptionText);
 
  protected:
-  LoadParamDescription* description;
+  LoadClassDescription* classDesc;
+  LoadParamDescription* paramDesc;
 };
 
