Index: trunk/src/orxonox.cc
===================================================================
--- trunk/src/orxonox.cc	(revision 7711)
+++ trunk/src/orxonox.cc	(revision 7714)
@@ -302,5 +302,6 @@
     NetworkManager::getInstance()->establishConnection(this->serverName, port);
   }
-  else if( this->port > 0) {    // we are a server
+  else if( this->port > 0)
+  {    // we are a server
     State::setOnline(true);
     NetworkManager::getInstance()->createServer(port);
@@ -335,6 +336,6 @@
     PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
               "!!!  Please Change in File %s Section %s Entry %s to a suitable value !!!\n",
-    ResourceManager::getInstance()->getDataDir().c_str(),
-    this->configFileName.c_str(),
+              ResourceManager::getInstance()->getDataDir().c_str(),
+              this->configFileName.c_str(),
               CONFIG_SECTION_GENERAL,
               CONFIG_NAME_DATADIR );
@@ -413,5 +414,125 @@
 bool showGui = false;
 
-
+/// HACK HACK TEST
+
+
+template<typename type> MT_Type ExecutorParamType() { return MT_EXT1; };
+template<> MT_Type ExecutorParamType<bool>() { return MT_EXT1; };
+template<> MT_Type ExecutorParamType<int>() { return MT_INT; };
+template<> MT_Type ExecutorParamType<unsigned int>() { return MT_UINT; };
+template<> MT_Type ExecutorParamType<float>() { return MT_FLOAT; };
+template<> MT_Type ExecutorParamType<char>() { return MT_CHAR; };
+template<> MT_Type ExecutorParamType<const std::string&>() { return MT_STRING; };
+
+template<typename type> type fromString(const std::string& input, type defaultValue) {return defaultValue; };
+template<> bool fromString<bool>(const std::string& input, bool defaultValue) { return isBool(input, defaultValue); };
+template<> int fromString<int>(const std::string& input, int defaultValue) { return isInt(input, defaultValue); };
+template<> unsigned int fromString<unsigned int>(const std::string& input, unsigned int defaultValue) { return isInt(input, defaultValue); };
+template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); };
+template<> char fromString<char>(const std::string& input, char defaultValue) { return isInt(input, defaultValue); };
+template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return isString(input, defaultValue); };
+
+template<typename type> type getDefault(const MultiType* const defaultValues, unsigned int i) { return (type)0; };
+template<> bool getDefault<bool>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getBool(); };
+template<> int getDefault<int>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getInt(); };
+template<> unsigned int getDefault<unsigned int>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getInt(); };
+template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); };
+template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getChar(); };
+template<> std::string getDefault<std::string>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getString(); };
+
+
+template<class T> class Executor0Params : public Executor
+{
+  private:
+    void (T::*functionPointer)();
+
+  public:
+    Executor0Params (void (T::*functionPointer)())
+  : Executor()
+    {
+      this->functorType = Executor_Objective;
+      this->functionPointer = functionPointer;
+    }
+    virtual void operator()(BaseObject* object, const SubString& sub = SubString()) const
+    {
+      (dynamic_cast<T*>(object)->*functionPointer)();
+    };
+
+    Executor* clone() const {};
+};
+
+
+template<class T, typename type0> class Executor1Params : public Executor
+{
+private:
+  void (T::*functionPointer)(type0);
+
+public:
+  Executor1Params (void (T::*functionPointer)(type0))
+      : Executor(ExecutorParamType<type0>())
+  {
+    this->functorType = Executor_Objective;
+    this->functionPointer = functionPointer;
+  }
+  virtual void operator()(BaseObject* object, const SubString& sub = SubString()) const
+  {
+
+    /* // THE VERY COOL DEBUG
+    printf("SUB[0] : %s\n", sub[0].c_str());
+    printf("getDefault<type0>(this->defaultValue, 0):::: %d\n", getDefault<type0>(this->defaultValue, 0));
+    printf("VALUE: %d\n", fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)));
+    */
+    (dynamic_cast<T*>(object)->*functionPointer)( fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) );
+  };
+
+  virtual Executor* clone() const {};
+};
+
+/// DOUBLE PENETRATION
+template<class T, typename type0, typename type1> class Executor2Params : public Executor
+{
+private:
+  void (T::*functionPointer)(type0, type1);
+
+public:
+  Executor2Params (void (T::*functionPointer)(type0, type1))
+      : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
+  {
+    this->functorType = Executor_Objective;
+    this->functionPointer = functionPointer;
+  }
+  virtual void operator()(BaseObject* object, const SubString& sub = SubString()) const
+  {
+    (dynamic_cast<T*>(object)->*functionPointer)(
+      fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)),
+      fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)));
+  };
+
+  virtual Executor* clone() const {};
+};
+
+class TestClass : public BaseObject
+{
+public:
+  TestClass() {};
+
+  void printTest() { printf ("TEST\n"); };
+  void printTestInt(int i) { printf ("%d\n", i); };
+  void printTestBool(bool b) { printf("%d\n", (int)b); };
+  void printTwoVals(bool b, int i) { printf ("%d %d\n", b, i); };
+};
+
+void TEST()
+{
+  TestClass test;
+  SubString testStrings("1, 2, 3", ",", SubString::WhiteSpaces, false);
+  (Executor0Params<TestClass>(&TestClass::printTest))(&test, testStrings);
+  (Executor1Params<TestClass,int>(&TestClass::printTestInt))(&test, testStrings);
+  (Executor1Params<TestClass,bool>(&TestClass::printTestBool))(&test, testStrings);
+  (Executor2Params<TestClass,bool, int>(&TestClass::printTwoVals))(&test, testStrings);
+
+}
+
+//// HACK HACK
 
 /**********************************
@@ -426,4 +547,5 @@
 int main(int argc, char** argv)
 {
+  TEST();
   CmdLinePrefsReader prefs;
 
@@ -444,5 +566,6 @@
   }
   else if ( Preferences::getInstance()->getString("misc", "bt-to-file", "1") == "1" )
-  {      SignalHandler::getInstance()->doCatch( argv[0], GDB_RUN_WRITE_TO_FILE );
+  {
+    SignalHandler::getInstance()->doCatch( argv[0], GDB_RUN_WRITE_TO_FILE );
 
   }
@@ -506,5 +629,5 @@
   // checking for existence of the configuration-files, or if the lock file is still used
   if (showGui || (!File("./orxonox.conf").isFile() &&
-      !File(DEFAULT_CONFIG_FILE).isFile())
+                  !File(DEFAULT_CONFIG_FILE).isFile())
 #if DEBUG < 3 // developers do not need to see the GUI, when orxonox fails
       || ResourceManager::isFile(DEFAULT_LOCK_FILE)
