Index: /trunk/src/defs/functor_list.h
===================================================================
--- /trunk/src/defs/functor_list.h	(revision 5134)
+++ /trunk/src/defs/functor_list.h	(revision 5135)
@@ -16,49 +16,133 @@
 */
 
+/**
+   useable FunctionParameters are:
+   l_INT:       int
+   l_LONG:      long
+   l_SHORT:     short
+   l_FLOAT:     float
+   l_STRING:    const char*
+   l_XML_ELEM:  TiXmlElement*
+ */
 
-  //! makes functions with one string loadable
+#ifndef __FUNCTOR_PARAMETERS__
+#define __FUNCTOR_PARAMETERS__
+
+typedef enum ParameterType
+{
+  ParameterNull,
+  ParameterBool,
+  ParameterChar,
+  ParameterString,
+  ParameterInt,
+  ParameterUInt,
+  ParameterFloat,
+  ParameterLong,
+  /* ... */
+};
+
+
+#define l_BOOL_TYPE        bool                 //!< The type of an BOOL
+#define l_BOOL_FUNC        isBool               //!< The function to call to parse BOOL
+#define l_BOOL_NAME        "bool"               //!< The name of an BOOL
+#define l_BOOL_PARAM       ParameterBool        //!< the type of the parameter BOOL
+#define l_BOOL_DEFAULT     false                //!< a default Value for an BOOL
+
+
+#define l_INT_TYPE         int                  //!< The type of an INT
+#define l_INT_FUNC         isInt                //!< The function to call to parse INT
+#define l_INT_NAME         "int"                //!< The name of an INT
+#define l_INT_PARAM        ParameterInt         //!< the type of the parameter INT
+#define l_INT_DEFAULT      0                    //!< a default Value for an INT
+
+#define l_UINT_TYPE        unsigned int         //!< The type of an UINT
+#define l_UINT_FUNC        isInt                //!< The function to call to parse UINT
+#define l_UINT_NAME        "unsigned int"       //!< The name of an UINT
+#define l_UINT_PARAM        ParameterUInt       //!< the type of the parameter UINT
+#define l_UINT_DEFAULT     0                    //!< a default Value for an UINT
+
+#define l_LONG_TYPE        long                 //!< The type of a LONG
+#define l_LONG_FUNC        isInt                //!< The function to parse a LONG
+#define l_LONG_NAME        "long"               //!< The name of a LONG
+#define l_LONG_PARAM       ParameterLong        //!< the type of the parameter LONG
+#define l_LONG_DEFAULT     0                    //!< a default Value for a LONG
+
+// #define l_SHORT_TYPE       short                //!< The type of a SHORT
+// #define l_SHORT_FUNC       atoi                 //!< The function to parse a SHORT
+// #define l_SHORT_NAME       "short"              //!< The name of a SHORT
+//#define l_SHORT_PARAM       ParameterShort       //!< the type of the parameter SHORT
+// #define l_SHORT_DEFAULT    0                    //!< a default Value for a SHORT
+
+#define l_FLOAT_TYPE       float                //!< The type of a FLOAT
+#define l_FLOAT_FUNC       isFloat              //!< The function to parse a FLOAT
+#define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
+#define l_FLOAT_PARAM      ParameterFloat       //!< the type of the parameter FLOAT
+#define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
+
+//#define l_VECTOR_TYPE      const Vector&        //!< The type of a VECTOR
+//#define l_VECTOR_FUNC      isVector             //!< The function to parse a VECTOR
+//#define l_VECTOR_NAME      "Vector[x/y/z]"      //!< The name of a VECTOR
+//#define l_VECTOR_DEFAULT   Vector(0,0,0)        //!< Default value for a VECTOR
+
+#define l_STRING_TYPE      const char*          //!< The type of a STRING
+#define l_STRING_FUNC      isString             //!< The function to parse a STRING
+#define l_STRING_NAME      "string"             //!< The name of a STRING
+#define l_STRING_PARAM     ParameterString      //!< the type of the parameter STRING
+#define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
+
+#define l_XML_ELEM_TYPE    const TiXmlElement*  //!< The type of an XML_ELEM
+#define l_XML_ELEM_FUNC                         //!< The function to parse an XML_ELEM
+#define l_XML_ELEM_NAME    "XML"                //!< The name of an XML_ELEM
+//#define l_XML_ELEM_PARAM   Parameter        //!< the type of the parameter XML_ELEM
+#define l_XML_ELEM_DEFAULT NULL                 //!< The dafault Value for an XML_ELEM
+
+#endif /* __FUNCTOR_PARAMETERS__ */
+
+
+#ifdef FUNCTOR_LIST
+  //! makes functions with one string
   FUNCTOR_LIST(1)(l_STRING);
-  //! makes functions with two strings loadable
+  //! makes functions with two strings
   FUNCTOR_LIST(2)(l_STRING, l_STRING);
-  //! makes functions with three strings loadable
+  //! makes functions with three strings
   FUNCTOR_LIST(3)(l_STRING, l_STRING, l_STRING);
-  //! makes functions with four strings loadable
+  //! makes functions with four strings
   FUNCTOR_LIST(4)(l_STRING, l_STRING, l_STRING, l_STRING);
 
-  //! makes functions with one bool loadeable
+  //! makes functions with one bool
   FUNCTOR_LIST(1)(l_BOOL);
 
-  //! makes functions with one int loadable
+  //! makes functions with one int
   FUNCTOR_LIST(1)(l_INT);
-  //! makes functions with two ints loadable
+  //! makes functions with two ints
   FUNCTOR_LIST(2)(l_INT, l_INT);
-  //! makes functions with three ints loadable
+  //! makes functions with three ints
   FUNCTOR_LIST(3)(l_INT, l_INT, l_INT);
-  //! makes functions with four ints loadable
+  //! makes functions with four ints
   FUNCTOR_LIST(4)(l_INT, l_INT, l_INT, l_INT);
 
 
-  //! makes functions with one unsigned int loadable
+  //! makes functions with one unsigned int
   FUNCTOR_LIST(1)(l_UINT);
-  //! makes functions with two unsigned ints loadable
+  //! makes functions with two unsigned ints
   FUNCTOR_LIST(2)(l_UINT, l_UINT);
-  //! makes functions with three unsigned ints loadable
+  //! makes functions with three unsigned ints
   FUNCTOR_LIST(3)(l_UINT, l_UINT, l_UINT);
-  //! makes functions with four unsigned ints loadable
+  //! makes functions with four unsigned ints
   FUNCTOR_LIST(4)(l_UINT, l_UINT, l_UINT, l_UINT);
 
-  //! makes functions with one float loadable
+  //! makes functions with one float
   FUNCTOR_LIST(1)(l_FLOAT);
-  //! makes functions with two floats loadable
+  //! makes functions with two floats
   FUNCTOR_LIST(2)(l_FLOAT, l_FLOAT);
-  //! makes functions with three floats loadable
+  //! makes functions with three floats
   FUNCTOR_LIST(3)(l_FLOAT, l_FLOAT, l_FLOAT);
-  //! makes functions with four floats loadable
+  //! makes functions with four floats
   FUNCTOR_LIST(4)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
-  //! makes functions with four floats loadable
+  //! makes functions with four floats
   FUNCTOR_LIST(5)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
 
   //! mixed values:
   FUNCTOR_LIST(2)(l_STRING, l_FLOAT);
+#endif /* FUNCTOR_LIST */
 
-
Index: /trunk/src/util/loading/load_param.h
===================================================================
--- /trunk/src/util/loading/load_param.h	(revision 5134)
+++ /trunk/src/util/loading/load_param.h	(revision 5135)
@@ -57,62 +57,4 @@
 #define LOAD_PARAM_END_CYCLE        element = element->NextSiblingElement(); \
                                   }
-
-
-
-/**
-   useable FunctionParameters are:
-   l_INT:       int
-   l_LONG:      long
-   l_SHORT:     short
-   l_FLOAT:     float
-   l_STRING:    const char*
-   l_XML_ELEM:  TiXmlElement*
-*/
-
-#define l_BOOL_TYPE        bool                 //!< The type of an BOOL
-#define l_BOOL_FUNC        isBool               //!< The function to call to parse BOOL
-#define l_BOOL_NAME        "bool"               //!< The name of an BOOL
-#define l_BOOL_DEFAULT     false                //!< a default Value for an BOOL
-
-
-#define l_INT_TYPE         int                  //!< The type of an INT
-#define l_INT_FUNC         isInt                //!< The function to call to parse INT
-#define l_INT_NAME         "int"                //!< The name of an INT
-#define l_INT_DEFAULT      0                    //!< a default Value for an INT
-
-#define l_UINT_TYPE        unsigned int         //!< The type of an UINT
-#define l_UINT_FUNC        isInt                //!< The function to call to parse UINT
-#define l_UINT_NAME        "unsigned int"       //!< The name of an UINT
-#define l_UINT_DEFAULT     0                    //!< a default Value for an UINT
-
-#define l_LONG_TYPE        long                 //!< The type of a LONG
-#define l_LONG_FUNC        isInt                //!< The function to parse a LONG
-#define l_LONG_NAME        "long"               //!< The name of a LONG
-#define l_LONG_DEFAULT     0                    //!< a default Value for a LONG
-
-// #define l_SHORT_TYPE       short                //!< The type of a SHORT
-// #define l_SHORT_FUNC       atoi                 //!< The function to parse a SHORT
-// #define l_SHORT_NAME       "short"              //!< The name of a SHORT
-// #define l_SHORT_DEFAULT    0                    //!< a default Value for a SHORT
-
-#define l_FLOAT_TYPE       float                //!< The type of a FLOAT
-#define l_FLOAT_FUNC       isFloat              //!< The function to parse a FLOAT
-#define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
-#define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
-
-//#define l_VECTOR_TYPE      const Vector&        //!< The type of a VECTOR
-//#define l_VECTOR_FUNC      isVector             //!< The function to parse a VECTOR
-//#define l_VECTOR_NAME      "Vector[x/y/z]"      //!< The name of a VECTOR
-//#define l_VECTOR_DEFAULT   Vector(0,0,0)        //!< Default value for a VECTOR
-
-#define l_STRING_TYPE      const char*          //!< The type of a STRING
-#define l_STRING_FUNC      isString             //!< The function to parse a STRING
-#define l_STRING_NAME      "string"             //!< The name of a STRING
-#define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
-
-#define l_XML_ELEM_TYPE    const TiXmlElement*  //!< The type of an XML_ELEM
-#define l_XML_ELEM_FUNC                         //!< The function to parse an XML_ELEM
-#define l_XML_ELEM_NAME    "XML"                //!< The name of an XML_ELEM
-#define l_XML_ELEM_DEFAULT NULL                 //!< The dafault Value for an XML_ELEM
 
 
Index: /trunk/src/util/shell.cc
===================================================================
--- /trunk/src/util/shell.cc	(revision 5134)
+++ /trunk/src/util/shell.cc	(revision 5135)
@@ -78,5 +78,5 @@
   //void ShellCommand<T>::registerCommand(const char* commandName, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, ...)
 
-  ShellCommand<Shell>::registerCommand("clear", CL_NULL, this, &Shell::clear, 0, 1);
+  ShellCommand<Shell>::registerCommand("clear", CL_NULL, this, &Shell::clear);
 }
 
@@ -457,8 +457,9 @@
   this->inputHistory->add(newCommand);
 
-  if (!strcmp(this->inputLine, "clear"))
-  {
-    this->clear();
-  }
+  ShellCommandBase::execute(this->inputLine);
+//  if (!strcmp(this->inputLine, "clear"))
+//  {
+//    this->clear();
+//  }
 
   this->flushInputLine();
Index: /trunk/src/util/shell_command.cc
===================================================================
--- /trunk/src/util/shell_command.cc	(revision 5134)
+++ /trunk/src/util/shell_command.cc	(revision 5135)
@@ -28,8 +28,10 @@
 using namespace std;
 
-ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID, void* functionPointer, unsigned int paramCount, va_list parameters)
+ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID, unsigned int paramCount, ...)
 {
+  va_list parameters;
+  va_start(parameters, paramCount);
+
   this->classID = classID;
-  this->functionPointer = functionPointer;
   this->commandName = new char[strlen(commandName)+1];
   strcpy(this->commandName, commandName);
@@ -37,5 +39,5 @@
   // handling parameters, and storing them:
   this->paramCount = paramCount;
-  this->parameters = new ShellParameterType[paramCount];
+  this->parameters = new ParameterType[paramCount];
 
   for (unsigned int i = 0; i < paramCount; i++)
@@ -55,6 +57,10 @@
 tList<ShellCommandBase>* ShellCommandBase::commandList = NULL;
 
-bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, va_list parameters)
+bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, ...)
 {
+
+  va_list parameters;
+  va_start(parameters, paramCount);
+
   if (ShellCommandBase::commandList == NULL)
   {
@@ -80,2 +86,27 @@
 
 
+bool ShellCommandBase::execute(const char* executionString)
+{
+  if (ShellCommandBase::commandList == NULL)
+    return false;
+
+  const char* commandEnd = strchr(executionString, ' ');
+  if (commandEnd == NULL)
+    commandEnd = executionString + strlen(executionString);
+
+  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
+  ShellCommandBase* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    if (!strncmp(executionString, elem->commandName, commandEnd - executionString))
+    {
+      elem->executeCommand(commandEnd);
+      delete iterator;
+      return true;
+    }
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  return true;
+}
+
Index: /trunk/src/util/shell_command.h
===================================================================
--- /trunk/src/util/shell_command.h	(revision 5134)
+++ /trunk/src/util/shell_command.h	(revision 5135)
@@ -13,14 +13,5 @@
 #define MAX_SHELL_COMMAND_SIZE
 
-typedef enum ShellParameterType
-{
-  ShellParameterNull,
-  ShellParameterChar,
-  ShellParameterString,
-  ShellParameterInt,
-  ShellParameterUInt,
-  ShellParameterFloat,
-  /* ... */
-};
+#include "functor_list.h"
 
 
@@ -29,4 +20,33 @@
 template<class T> class tIterator;
 
+
+///////////////////////
+// MACRO DEFINITIONS //
+///////////////////////
+
+
+#define ShellCommand2(type1, type2) \
+ public: \
+  static void registerCommand(const char* commandName, ClassID classID, T* object, void (T::*function)(type1##_TYPE, type2##_TYPE) \
+                              type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT) \
+  { \
+     if (isRegistered(commandName, classID, 2, type1##_PARAM, type2##_PARAM) == true) \
+       return; \
+     else \
+       ShellCommand<T>* newCommand = new ShellCommand<T>(commandName, classID, object, function); \
+  } \
+ private: \
+  void (T::*functionPointer_##type1_##type2)(type1##_TYPE, type2##_TYPE); \
+  ShellCommand(const char* commandName, ClassID classID, T* object, void (T::*function)(type1##_TYPE, type2##_TYPE) \
+                              type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT) \
+  { \
+    this->functionPointer_##type1_##type2 = function; \
+  }
+
+
+////////////////
+// BASE CLASS //
+////////////////
+//! a baseClass for all possible ShellCommands
 class ShellCommandBase : public BaseObject
 {
@@ -34,11 +54,11 @@
     static bool execute (const char* executionString);
 
-//    virtual void execute (...);
+    virtual void executeCommand (const char* parameters) = NULL;
 
   protected:
-    ShellCommandBase(const char* commandName, ClassID classID, void* functionPointer, unsigned int paramCount, va_list parameters);
+    ShellCommandBase(const char* commandName, ClassID classID, unsigned int paramCount, ...);
     ~ShellCommandBase();
 
-    static bool isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, va_list parameters);
+    static bool isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, ...);
 
 
@@ -46,5 +66,5 @@
     void*                            functionPointer;     //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
     unsigned int                     paramCount;          //!< the count of parameters
-    ShellParameterType*              parameters;          //!< Parameters
+    ParameterType*                   parameters;          //!< Parameters
 
   private:
@@ -56,14 +76,42 @@
 };
 
+
+
+
 //! keeps information about a ShellCommand
 template<class T> class ShellCommand : public ShellCommandBase
 {
   public:
-    static void registerCommand(const char* commandName, ClassID classID, T* object, void (T::*functionPointer)(), unsigned int paramCount, ...);
-
     static void unregisterCommand(const char* commandNaame, ClassID classID);
 
+    static void registerCommand(const char* commandName, ClassID classID, T* object, void (T::*functionPointer)())
+    {
+      if (isRegistered(commandName, classID, 0)== true)
+        return;
+      else
+        ShellCommand<T>* newCommand = new ShellCommand<T>(commandName, classID, object, functionPointer);
+    }
   private:
-    ShellCommand(const char* command, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, va_list parameters);
+    void (T::*functionPointer_NULL)();
+    ShellCommand(const char* commandName, ClassID classID, T* object, void (T::*functionPointer)())
+      : ShellCommandBase (commandName, classID, 0)
+    {
+      this->functionPointer_NULL = functionPointer;
+      this->objectPointer = object;
+    }
+    virtual void executeCommand (const char* parameters)
+    {
+      if (this->paramCount == 0)
+        (objectPointer->*functionPointer_NULL)();
+    }
+
+
+
+#define FUNCTOR_LIST(x) ShellCommand ## x
+//#include "functor_list.h"
+//ShellCommand2(l_INT, l_INT);
+#undef FUNCTOR_LIST
+
+  private:
 
 
@@ -72,25 +120,5 @@
 };
 
-template<class T>
-    ShellCommand<T>::ShellCommand(const char* commandName, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, va_list parameters)
-  : ShellCommandBase (commandName, classID, functionPointer, paramCount, parameters)
-{
 
-}
-
-template<class T>
-    void ShellCommand<T>::registerCommand(const char* commandName, ClassID classID, T* object, void (T::*functionPointer)(), unsigned int paramCount, ...)
-{
-  va_list parameters;
-  va_start(parameters, paramCount);
-
-  if (isRegistered(commandName, classID, paramCount, parameters) == true)
-    return;
-  else
-  {
-
-//    ShellCommand<T>* newCommand = new ShellCommand<T>(commandName, classID, object, functionPointer, paramCount, parameters);
-  }
-}
 
 #endif /* _SHELL_COMMAND_H */
