Index: code/trunk/bin/levels/sample.oxw
===================================================================
--- code/trunk/bin/levels/sample.oxw	(revision 1051)
+++ code/trunk/bin/levels/sample.oxw	(revision 1052)
@@ -1,2 +1,27 @@
+<Namespace name="test" />
+<Namespace name="blub" />
+<Namespace name="rofl" />
+
+<Namespace name="ns1">
+  <Namespace name="ns11">
+    <Namespace name="ns111">
+    </Namespace>
+    <Namespace name="ns112">
+    </Namespace>
+  </Namespace>
+  <Namespace name="ns12">
+    <Namespace name="ns121">
+    </Namespace>
+    <Namespace name="ns122">
+    </Namespace>
+  </Namespace>
+</Namespace>
+
+<Namespace name="ns1::ns12::ns121">
+  <Namespace name="ns1211">
+  </Namespace>
+</Namespace>
+<Namespace name="ns1::ns12::ns122::ns1221" />
+
 <!--
  <audio>
@@ -40,4 +65,53 @@
 <Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" />
 
+
+<Namespace name="test" />
+<Namespace name="blub">
+</Namespace>
+<Namespace name="rofl">
+  <Namespace name="lol">
+  </Namespace>
+</Namespace>
+
+<Namespace name="ns1">
+  <Namespace name="ns11">
+    <Namespace name="ns111">
+      <Namespace name="ns1111">
+      </Namespace>
+    </Namespace>
+  </Namespace>
+  <Namespace name="ns13">
+  </Namespace>
+</Namespace>
+
+<Namespace name="ns1 ns2">
+  <Namespace name="abc" />
+</Namespace>
+
+<Namespace name="ns1::ns11 ns1::ns12 ns1::ns12::ns121">
+  <Namespace name="muhahaha" />
+</Namespace>
+
+<Namespace name="test">
+  <Namespace name="test" />
+</Namespace>
+
+<Namespace name="ns1::ns13">
+  <Namespace name="..::ns14" />
+  <Namespace name="..::..::ns3" />
+</Namespace>
+
+<Namespace name="AAA::BBB::..::CCC::..::DDD::..::BBB::BBBBBB::..::BBBBBBBBBBBBBBBBBBB::..::..::EEE" />
+
+<Namespace name="..::justatest" />
+
+<Namespace name="@file.oxw::anothertest" />
+
+<Namespace name="justonemoretest::@file.oxw::gagagaga" />
+
+<Namespace name="AAA::BBB, AAA::CCC; AAA::DDD,AAA::EEE">
+  <Namespace name="hax" />
+</Namespace>
+
 <?lua
 for i = 1, 226, 1 
Index: code/trunk/bin/translation_german.lang
===================================================================
--- code/trunk/bin/translation_german.lang	(revision 1051)
+++ 	(revision )
@@ -1,7 +1,0 @@
-ConfigValueDescription::DebugLevel::softDebugLevelConsole_=Der maximale Output-Level, der in der Konsole ausgegeben wird
-ConfigValueDescription::DebugLevel::softDebugLevelLogfile_=Der maximale Output-Level, der im Logfile gespeichert wird
-ConfigValueDescription::DebugLevel::softDebugLevelShell_=Der maximale Output-Level, der in der ingame-Shell angezeigt wird
-ConfigValueDescription::Projectile::lifetime_=Die die das Projektil am Leben bleibt in Sekunden
-ConfigValueDescription::Projectile::speed_=Die Geschwindigkeit des Projektils in Units pro Sekunde
-ConfigValueDescription::SpaceShip::bInvertYAxis_=Falls dies true ist, verhält sich die Maus wie ein Joystick (Maus hoch = Schiff runter)
-ConfigValueDescription::SpaceShip::reloadTime_=Die Nachladezeit der Waffe in Sekunden
Index: code/trunk/src/CMakeLists.txt
===================================================================
--- code/trunk/src/CMakeLists.txt	(revision 1051)
+++ code/trunk/src/CMakeLists.txt	(revision 1052)
@@ -4,5 +4,5 @@
 ADD_SUBDIRECTORY(util)
 ADD_SUBDIRECTORY(orxonox/core)
-ADD_SUBDIRECTORY(audio)
-ADD_SUBDIRECTORY(network)
+#ADD_SUBDIRECTORY(audio)
+#ADD_SUBDIRECTORY(network)
 ADD_SUBDIRECTORY(orxonox)
Index: code/trunk/src/asylum/orxonox/objects/Fighter.cc
===================================================================
--- code/trunk/src/asylum/orxonox/objects/Fighter.cc	(revision 1051)
+++ code/trunk/src/asylum/orxonox/objects/Fighter.cc	(revision 1052)
@@ -38,4 +38,5 @@
 #include "util/String2Number.h"
 #include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
 #include "GraphicsEngine.h"
 #include "core/InputManager.h"
Index: code/trunk/src/asylum/orxonox/objects/Test.h
===================================================================
--- code/trunk/src/asylum/orxonox/objects/Test.h	(revision 1051)
+++ code/trunk/src/asylum/orxonox/objects/Test.h	(revision 1052)
@@ -30,4 +30,5 @@
 
 #include "core/BaseObject.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
Index: code/trunk/src/asylum/orxonox/objects/test2.cc
===================================================================
--- code/trunk/src/asylum/orxonox/objects/test2.cc	(revision 1051)
+++ code/trunk/src/asylum/orxonox/objects/test2.cc	(revision 1052)
@@ -30,4 +30,5 @@
 #include "test3.h"
 #include "core/CoreIncludes.h"
+#include "core/Executor.h"
 
 namespace orxonox
@@ -43,7 +44,7 @@
         this->usefullClass3_ = Class(Test3);
 
-        timer1.setTimer(1, true, this, &Test2::timerFunction1);
-        timer2.setTimer(5, true, this, &Test2::timerFunction2);
-        timer3.setTimer(10, false, this, &Test2::timerFunction3);
+        timer1.setTimer(1, true, this, createExecutor(createFunctor(&Test2::timerFunction1)));
+        timer2.setTimer(5, true, this, createExecutor(createFunctor(&Test2::timerFunction2)));
+        timer3.setTimer(10, false, this, createExecutor(createFunctor(&Test2::timerFunction3)));
     }
 
Index: code/trunk/src/asylum/orxonox/objects/test3.cc
===================================================================
--- code/trunk/src/asylum/orxonox/objects/test3.cc	(revision 1051)
+++ code/trunk/src/asylum/orxonox/objects/test3.cc	(revision 1052)
@@ -30,4 +30,5 @@
 #include "test3.h"
 #include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
 
 namespace orxonox
@@ -56,4 +57,7 @@
         SetConfigValue(value_vector3_, Vector3(13, 26, 39));
         SetConfigValue(value_colourvalue_, ColourValue(1.0, 0.5, 0.25, 0.887));
+        SetConfigValueVector(vector_int_, std::vector<int>(1, 13));
+        SetConfigValueVector(vector_string_, std::vector<std::string>(3, "nothing"));
+        SetConfigValueVector(vector_vector3_, std::vector<Vector3>(1, Vector3(3, 2, 1)));
     }
 
@@ -64,16 +68,31 @@
     void Test3::configOutput()
     {
-        std::cout << "int:         " << this->value_int_ << std::endl;
-        std::cout << "uint:        " << this->value_uint_ << std::endl;
-        std::cout << "char:        " << (int)this->value_char_ << std::endl;
-        std::cout << "uchar:       " << (int)this->value_uchar_ << std::endl;
-        std::cout << "float:       " << this->value_float_ << std::endl;
-        std::cout << "double:      " << this->value_double_ << std::endl;
-        std::cout << "bool:        " << this->value_bool_ << std::endl;
-        std::cout << "string:      " << this->value_string_ << std::endl;
-        std::cout << "constchar:   " << this->value_constchar_ << std::endl;
-        std::cout << "vector2:     " << this->value_vector2_ << std::endl;
-        std::cout << "vector3:     " << this->value_vector3_ << std::endl;
-        std::cout << "colourvalue: " << this->value_colourvalue_ << std::endl;
+        std::cout << "int:             " << this->value_int_ << std::endl;
+        std::cout << "uint:            " << this->value_uint_ << std::endl;
+        std::cout << "char:            " << (int)this->value_char_ << std::endl;
+        std::cout << "uchar:           " << (int)this->value_uchar_ << std::endl;
+        std::cout << "float:           " << this->value_float_ << std::endl;
+        std::cout << "double:          " << this->value_double_ << std::endl;
+        std::cout << "bool:            " << this->value_bool_ << std::endl;
+        std::cout << "string:         >" << this->value_string_ << "<" << std::endl;
+        std::cout << "constchar:      >" << this->value_constchar_ << "<" << std::endl;
+        std::cout << "vector2:         " << this->value_vector2_ << std::endl;
+        std::cout << "vector3:         " << this->value_vector3_ << std::endl;
+        std::cout << "colourvalue:     " << this->value_colourvalue_ << std::endl;
+        std::cout << std::endl;
+        for (unsigned int i = 0; i < this->vector_int_.size(); i++)
+        std::cout << "vector<int>:     " << i << ": " << this->vector_int_[i] << std::endl;
+        for (unsigned int i = 0; i < this->vector_string_.size(); i++)
+        std::cout << "vector<string>:  " << i << ":>" << this->vector_string_[i] << "<" << std::endl;
+        for (unsigned int i = 0; i < this->vector_vector3_.size(); i++)
+        std::cout << "vector<vector3>: " << i << ": " << this->vector_vector3_[i] << std::endl;
+
+        ModifyConfigValue(value_int_, tset, "100");
+        std::cout << std::endl;
+        std::cout << "int:             " << this->value_int_ << std::endl;
+
+        ModifyConfigValue(value_int_, update);
+        std::cout << std::endl;
+        std::cout << "int:             " << this->value_int_ << std::endl;
     }
 
Index: code/trunk/src/asylum/orxonox/objects/test3.h
===================================================================
--- code/trunk/src/asylum/orxonox/objects/test3.h	(revision 1051)
+++ code/trunk/src/asylum/orxonox/objects/test3.h	(revision 1052)
@@ -1,4 +1,6 @@
 #ifndef _Test3_H__
 #define _Test3_H__
+
+#include <vector>
 
 #include "core/BaseObject.h"
@@ -36,4 +38,8 @@
             Vector3             value_vector3_;
             ColourValue         value_colourvalue_;
+
+            std::vector<int>         vector_int_;
+            std::vector<std::string> vector_string_;
+            std::vector<Vector3>     vector_vector3_;
     };
 }
Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 1051)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 1052)
Index: code/trunk/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1051)
+++ code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1052)
@@ -42,10 +42,9 @@
 
 #include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
 
 
 namespace orxonox {
-
-  using namespace Ogre;
 
   /**
@@ -96,9 +95,9 @@
     this->renderWindow_ = 0;
     // delete the ogre log and the logManager (since we have created it).
-    if (LogManager::getSingletonPtr() != 0)
-    {
-      LogManager::getSingleton().getDefaultLog()->removeListener(this);
-      LogManager::getSingleton().destroyLog(LogManager::getSingleton().getDefaultLog());
-      delete LogManager::getSingletonPtr();
+    if (Ogre::LogManager::getSingletonPtr() != 0)
+    {
+      Ogre::LogManager::getSingleton().getDefaultLog()->removeListener(this);
+      Ogre::LogManager::getSingleton().destroyLog(Ogre::LogManager::getSingleton().getDefaultLog());
+      delete Ogre::LogManager::getSingletonPtr();
     }
     COUT(4) << "*** GraphicsEngine: Destroying objects done" << std::endl;
@@ -121,8 +120,8 @@
     //TODO: Check if file exists (maybe not here)
 /*#ifndef OGRE_STATIC_LIB
-    root_ = new Root(configPath_ + "plugins.cfg", configPath_ + "ogre.cfg",
+    root_ = new Ogre::Root(configPath_ + "plugins.cfg", configPath_ + "ogre.cfg",
                      configPath_ + "Ogre.log");
 #else
-    root_ = new Root(NULL, configPath_ + "ogre.cfg", configPath_ + "Ogre.log");
+    root_ = new Ogre::Root(NULL, configPath_ + "ogre.cfg", configPath_ + "Ogre.log");
 #endif*/
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(_DEBUG)
@@ -153,5 +152,5 @@
     // Root will detect that we've already created a Log
     COUT(4) << "*** GraphicsEngine: Creating Ogre Root..." << std::endl;
-    root_ = new Root(plugin_filename);
+    root_ = new Ogre::Root(plugin_filename);
     COUT(4) << "*** GraphicsEngine: Creating Ogre Root done" << std::endl;
   }
@@ -160,9 +159,9 @@
    * @return scene manager
    */
-  SceneManager* GraphicsEngine::getSceneManager()
+  Ogre::SceneManager* GraphicsEngine::getSceneManager()
   {
     if(!scene_)
     {
-      scene_ = root_->createSceneManager(ST_GENERIC, "Default SceneManager");
+      scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
       COUT(3) << "Info: Created SceneMan: " << scene_ << std::endl;
     }
@@ -184,7 +183,7 @@
   {
     this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
-    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
     //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
-    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
   }
 
@@ -194,9 +193,9 @@
     //TODO: Work with ressource groups (should be generated by a special loader)
     // Load resource paths from data file using configfile ressource type
-    ConfigFile cf;
+    Ogre::ConfigFile cf;
     cf.load(dataPath + "resources.cfg");
 
     // Go through all sections & settings in the file
-    ConfigFile::SectionIterator seci = cf.getSectionIterator();
+    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
 
     std::string secName, typeName, archName;
@@ -204,6 +203,6 @@
     {
       secName = seci.peekNextKey();
-      ConfigFile::SettingsMultiMap *settings = seci.getNext();
-      ConfigFile::SettingsMultiMap::iterator i;
+      Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+      Ogre::ConfigFile::SettingsMultiMap::iterator i;
       for (i = settings->begin(); i != settings->end(); ++i)
       {
@@ -211,5 +210,5 @@
         archName = i->second; // name (and location) of archive
 
-        ResourceGroupManager::getSingleton().addResourceLocation(
+        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                                            std::string(dataPath + archName),
                                            typeName, secName);
@@ -269,16 +268,16 @@
   */
   void GraphicsEngine::messageLogged(const std::string& message,
-    LogMessageLevel lml, bool maskDebug, const std::string &logName)
+    Ogre::LogMessageLevel lml, bool maskDebug, const std::string &logName)
   {
     int orxonoxLevel;
     switch (lml)
     {
-      case LML_TRIVIAL:
+      case Ogre::LML_TRIVIAL:
         orxonoxLevel = this->ogreLogLevelTrivial_;
         break;
-      case LML_NORMAL:
+      case Ogre::LML_NORMAL:
         orxonoxLevel = this->ogreLogLevelNormal_;
         break;
-      case LML_CRITICAL:
+      case Ogre::LML_CRITICAL:
         orxonoxLevel = this->ogreLogLevelCritical_;
         break;
Index: code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- code/trunk/src/orxonox/Orxonox.cc	(revision 1051)
+++ code/trunk/src/orxonox/Orxonox.cc	(revision 1052)
@@ -55,8 +55,10 @@
 
 // core
+#include "core/ConsoleCommand.h"
 #include "core/Debug.h"
 #include "core/Factory.h"
 #include "core/Loader.h"
 #include "core/Tickable.h"
+#include "core/InputBuffer.h"
 #include "core/InputManager.h"
 
@@ -80,4 +82,41 @@
 namespace orxonox
 {
+  ConsoleCommand(Orxonox, exit, AccessLevel::None, true);
+  ConsoleCommand(Orxonox, slomo, AccessLevel::Offline, true).setDefaultValue(0, 1.0);
+  ConsoleCommand(Orxonox, setTimeFactor, AccessLevel::Offline, false).setDefaultValue(0, 1.0);
+
+  class Testconsole : public InputBufferListener
+  {
+    public:
+      Testconsole(InputBuffer* ib) : ib_(ib) {}
+      void listen() const
+      {
+        std::cout << "> " << this->ib_->get() << std::endl;
+      }
+      void execute() const
+      {
+        std::cout << ">> " << this->ib_->get() << std::endl;
+        if (!CommandExecutor::execute(this->ib_->get()))
+          std::cout << "Error" << std::endl;
+        this->ib_->clear();
+      }
+      void hintandcomplete() const
+      {
+        std::cout << CommandExecutor::hint(this->ib_->get()) << std::endl;
+        this->ib_->set(CommandExecutor::complete(this->ib_->get()));
+      }
+      void clear() const
+      {
+        this->ib_->clear();
+      }
+      void removeLast() const
+      {
+        this->ib_->removeLast();
+      }
+
+    private:
+      InputBuffer* ib_;
+  };
+
   /**
     @brief Reference to the only instance of the class.
@@ -198,10 +237,10 @@
   {
     COUT(2) << "initialising server" << std::endl;
-    
+
     ogre_->setConfigPath(path);
     ogre_->setup();
     //root_ = ogre_->getRoot();
     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
-    
+
     server_g = new network::Server();
   }
@@ -210,5 +249,5 @@
   {
     COUT(2) << "initialising client" << std::endl;\
-    
+
     ogre_->setConfigPath(path);
     ogre_->setup();
@@ -219,9 +258,9 @@
     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
   }
-  
+
   void Orxonox::standaloneInit(std::string path)
   {
     COUT(2) << "initialising standalone mode" << std::endl;
-    
+
     ogre_->setConfigPath(path);
     ogre_->setup();
@@ -229,5 +268,5 @@
     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
   }
-  
+
   /**
    * start modules
@@ -246,14 +285,14 @@
     }
   }
-  
+
   void Orxonox::clientStart(){
     ogre_->initialise();
     Factory::createClassHierarchy();
-    
-    
+
+
     auMan_ = new audio::AudioManager();
 
     //bulletMgr_ = new BulletManager();
-    
+
     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     HUD* orxonoxHud;
@@ -262,14 +301,14 @@
     orxonoxHud->setEnergyDistr(20,20,60);
     hudOverlay->show();
-    
+
     client_g->establishConnection();
     client_g->tick(0);
-    
-    
+
+
     //setupInputSystem();
-    
+
     startRenderLoop();
   }
-  
+
   void Orxonox::serverStart(){
     //TODO: start modules
@@ -279,10 +318,10 @@
     createScene();
     setupInputSystem();
-    
+
     server_g->open();
-    
+
     startRenderLoop();
   }
-  
+
   void Orxonox::standaloneStart(){
     //TODO: start modules
@@ -292,5 +331,5 @@
     createScene();
     setupInputSystem();
-    
+
     startRenderLoop();
   }
@@ -351,4 +390,12 @@
   void Orxonox::startRenderLoop()
   {
+    InputBuffer* ib = new InputBuffer();
+    Testconsole* console = new Testconsole(ib);
+    ib->registerListener(console, &Testconsole::listen, true);
+    ib->registerListener(console, &Testconsole::execute, '\r', false);
+    ib->registerListener(console, &Testconsole::hintandcomplete, '\t', true);
+    ib->registerListener(console, &Testconsole::clear, '§', true);
+    ib->registerListener(console, &Testconsole::removeLast, '\b', true);
+
     // first check whether ogre root object has been created
     if (Ogre::Root::getSingletonPtr() == 0)
@@ -395,5 +442,5 @@
       // Iterate through all Tickables and call their tick(dt) function
       for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; )
-        (it++)->tick((float)evt.timeSinceLastFrame);
+        (it++)->tick((float)evt.timeSinceLastFrame * this->timefactor_);
 
       // don't forget to call _fireFrameStarted in ogre to make sure
Index: code/trunk/src/orxonox/Orxonox.h
===================================================================
--- code/trunk/src/orxonox/Orxonox.h	(revision 1051)
+++ code/trunk/src/orxonox/Orxonox.h	(revision 1052)
@@ -41,4 +41,9 @@
       static void destroySingleton();
 
+      static inline void slomo(float factor) { Orxonox::getSingleton()->timefactor_ = factor; }
+      static inline void setTimeFactor(float factor = 1.0) { Orxonox::getSingleton()->timefactor_ = factor; }
+      static inline float getTimeFactor() { return Orxonox::getSingleton()->timefactor_; }
+      static inline void exit() { Orxonox::getSingleton()->abortRequest(); }
+
    private:
       // don't mess with singletons
@@ -75,4 +80,5 @@
       HUD*                  orxonoxHUD_;
       bool                  bAbort_;        //!< aborts the render loop if true
+      float                 timefactor_;    //!< A factor to change the gamespeed
 
       // this is used to identify the mode (server/client/...) we're in
Index: code/trunk/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxStableHeaders.h	(revision 1051)
+++ code/trunk/src/orxonox/OrxonoxStableHeaders.h	(revision 1052)
@@ -97,5 +97,4 @@
 
 #include "util/Math.h"
-#include "util/Convert.h"
 #include "util/Sleep.h"
 #include "util/String2Number.h"
Index: code/trunk/src/orxonox/core/BaseObject.cc
===================================================================
--- code/trunk/src/orxonox/core/BaseObject.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/BaseObject.cc	(revision 1052)
@@ -52,4 +52,5 @@
         this->bVisible_ = true;
         this->level_ = 0;
+        this->namespace_ = 0;
     }
 
@@ -78,7 +79,7 @@
         @return The XML-element
     */
-    void BaseObject::XMLPort(Element& xmlelement, bool loading)
+    void BaseObject::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, loading);
+        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode);
     }
 
Index: code/trunk/src/orxonox/core/BaseObject.h
===================================================================
--- code/trunk/src/orxonox/core/BaseObject.h	(revision 1051)
+++ code/trunk/src/orxonox/core/BaseObject.h	(revision 1052)
@@ -50,5 +50,5 @@
             virtual ~BaseObject();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
             /** @brief Sets the name of the object. @param name The name */
@@ -79,4 +79,7 @@
             const std::string& getLevelfile() const;
 
+            virtual inline void setNamespace(Namespace* ns) { this->namespace_ = ns; }
+            inline Namespace* getNamespace() const { return this->namespace_; }
+
             /** @brief Sets the indentation of the debug output in the Loader. @param indentation The indentation */
             inline void setLoaderIndentation(const std::string& indentation) { this->loaderIndentation_ = indentation; }
@@ -90,4 +93,5 @@
             const Level* level_;                        //!< The level that loaded this object
             std::string loaderIndentation_;             //!< Indentation of the debug output in the Loader
+            Namespace* namespace_;
     };
 }
Index: code/trunk/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/core/CMakeLists.txt	(revision 1051)
+++ code/trunk/src/orxonox/core/CMakeLists.txt	(revision 1052)
@@ -9,8 +9,9 @@
   InputEventListener.cc
   MetaObjectList.cc
+  ConfigFileManager.cc
   ConfigValueContainer.cc
   Error.cc
   SignalHandler.cc
-  DebugLevel.cc
+  CoreSettings.cc
   OutputHandler.cc
   Language.cc
@@ -19,4 +20,8 @@
   Executor.cc
   XMLPort.cc
+  Namespace.cc
+  NamespaceNode.cc
+  CommandExecutor.cc
+  InputBuffer.cc
   Tickable.cc
   Script.cc
Index: code/trunk/src/orxonox/core/ClassTreeMask.cc
===================================================================
--- code/trunk/src/orxonox/core/ClassTreeMask.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/ClassTreeMask.cc	(revision 1052)
@@ -327,5 +327,5 @@
         {
             // No it's not: Search for classes inheriting from the given class and add the rules for them
-            for (std::list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
+            for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
                 if ((*it)->isA(this->root_->getClass()))
                     if (overwrite || (!this->nodeExists(*it))) // If we don't want to overwrite, only add nodes that don't already exist
@@ -422,5 +422,5 @@
     void ClassTreeMask::addSingle(const Identifier* subclass, bool bInclude, bool clean)
     {
-        for (std::list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
+        for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
             this->add(*it, this->isIncluded(*it), false, false);
 
@@ -561,4 +561,37 @@
 
     /**
+        @brief Compares the mask with another mask and returns true if they represent the same logic.
+        @param other The other mask
+        @return True if both masks represent the same logic
+    */
+    bool ClassTreeMask::operator==(const ClassTreeMask& other) const
+    {
+        ClassTreeMask temp1 = other;
+        ClassTreeMask temp2 = (*this);
+
+        temp1.clean();
+        temp2.clean();
+
+        ClassTreeMaskIterator it1 = temp1.root_;
+        ClassTreeMaskIterator it2 = temp2.root_;
+
+        for ( ; it1 && it2; ++it1, ++it2)
+            if (it1->getClass() != it2->getClass())
+                return false;
+
+        return true;
+    }
+
+    /**
+        @brief Compares the mask with another mask and returns true if they represent different logics.
+        @param other The other mask
+        @return True if the masks represent different logics
+    */
+    bool ClassTreeMask::operator!=(const ClassTreeMask& other) const
+    {
+        return (!((*this) == other));
+    }
+
+    /**
         @brief Prefix operator + does nothing.
         @return A reference to the mask itself
Index: code/trunk/src/orxonox/core/ClassTreeMask.h
===================================================================
--- code/trunk/src/orxonox/core/ClassTreeMask.h	(revision 1051)
+++ code/trunk/src/orxonox/core/ClassTreeMask.h	(revision 1052)
@@ -179,4 +179,7 @@
             ClassTreeMask& operator=(const ClassTreeMask& other);
 
+            bool operator==(const ClassTreeMask& other) const;
+            bool operator!=(const ClassTreeMask& other) const;
+
             ClassTreeMask& operator+();
             ClassTreeMask operator-() const;
Index: code/trunk/src/orxonox/core/CommandExecutor.cc
===================================================================
--- code/trunk/src/orxonox/core/CommandExecutor.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/CommandExecutor.cc	(revision 1052)
@@ -0,0 +1,1362 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CommandExecutor.h"
+#include "ConsoleCommand.h"
+#include "util/String.h"
+#include "util/Convert.h"
+#include "Identifier.h"
+#include "Language.h"
+#include "Debug.h"
+#include "Executor.h"
+#include "ConfigValueContainer.h"
+
+#define COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE "set"
+#define COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY "tset"
+#define COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND "bind"
+
+namespace orxonox
+{
+    ConsoleCommandShortcutGeneric(keyword1, createExecutor((FunctorStatic*)0, "set", AccessLevel::User));
+    ConsoleCommandShortcutGeneric(keyword2, createExecutor((FunctorStatic*)0, "tset", AccessLevel::User));
+    ConsoleCommandShortcutGeneric(keyword3, createExecutor((FunctorStatic*)0, "bind", AccessLevel::User));
+
+    ConsoleCommandShortcutExtern(exec, AccessLevel::None);
+    ConsoleCommandShortcutExtern(echo, AccessLevel::None);
+
+    ConsoleCommandShortcutExtern(read, AccessLevel::None);
+    ConsoleCommandShortcutExtern(append, AccessLevel::None);
+    ConsoleCommandShortcutExtern(write, AccessLevel::None);
+
+    void exec(const std::string& filename)
+    {
+        static std::set<std::string> executingFiles;
+
+        std::set<std::string>::const_iterator it = executingFiles.find(filename);
+        if (it != executingFiles.end())
+        {
+            COUT(1) << "Error: Recurring exec command in \"" << filename << "\". Stopped execution." << std::endl;
+            return;
+        }
+
+        // Open the file
+        std::ifstream file;
+        file.open(filename.c_str(), std::fstream::in);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't execute file \"" << filename << "\"." << std::endl;
+            return;
+        }
+
+        executingFiles.insert(filename);
+
+        // Iterate through the file and put the lines into the CommandExecutor
+        char line[1024];
+        while (file.good() && !file.eof())
+        {
+            file.getline(line, 1024);
+            CommandExecutor::execute(line);
+        }
+
+        executingFiles.erase(filename);
+        file.close();
+    }
+
+    std::string echo(const std::string& text)
+    {
+        return text;
+    }
+
+    void write(const std::string& filename, const std::string& text)
+    {
+        std::ofstream file;
+        file.open(filename.c_str(), std::fstream::out);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't write to file \"" << filename << "\"." << std::endl;
+            return;
+        }
+
+        file << text << std::endl;
+        file.close();
+    }
+
+    void append(const std::string& filename, const std::string& text)
+    {
+        std::ofstream file;
+        file.open(filename.c_str(), std::fstream::app);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't append to file \"" << filename << "\"." << std::endl;
+            return;
+        }
+
+        file << text << std::endl;
+        file.close();
+    }
+
+    std::string read(const std::string& filename)
+    {
+        std::ifstream file;
+        file.open(filename.c_str(), std::fstream::in);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't read from file \"" << filename << "\"." << std::endl;
+            return "";
+        }
+
+        std::string output = "";
+        char line[1024];
+        while (file.good() && !file.eof())
+        {
+            file.getline(line, 1024);
+            output += line;
+            output += "\n";
+        }
+
+        file.close();
+
+        return output;
+    }
+
+
+    ///////////////////////
+    // CommandEvaluation //
+    ///////////////////////
+    CommandEvaluation::CommandEvaluation()
+    {
+        this->processedCommand_ = "";
+        this->additionalParameter_ = "";
+
+        this->functionclass_ = 0;
+        this->configvalueclass_ = 0;
+        this->shortcut_ = 0;
+        this->function_ = 0;
+        this->configvalue_ = 0;
+        this->key_ = 0;
+
+        this->errorMessage_ = "";
+        this->state_ = CS_Uninitialized;
+
+        this->bEvaluatedParams_ = false;
+        this->evaluatedExecutor_ = 0;
+    }
+
+    KeybindMode CommandEvaluation::getKeybindMode()
+    {
+        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
+        {
+//            if (this->shortcut_ != 0)
+//                return this->shortcut_->getKeybindMode();
+        }
+        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        {
+//            if (this->function_ != 0)
+//                return this->function_->getKeybindMode();
+        }
+        else if (this->state_ == CS_ConfigValueType || this->state_ == CS_ConfigValueFinished)
+        {
+//            return KeybindMode::onPress;
+        }
+        else if (this->state_ == CS_KeybindCommand || this->state_ == CS_KeybindFinished)
+        {
+//            return KeybindMode::onPress;
+        }
+        else
+        {
+//            return KeybindMode::onPress;
+        }
+    }
+
+    bool CommandEvaluation::isValid() const
+    {
+        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
+        {
+            return this->shortcut_;
+        }
+        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        {
+            return (this->functionclass_ && this->function_);
+        }
+        else if (this->state_ == CS_ConfigValueType || this->state_ == CS_ConfigValueFinished)
+        {
+            return (this->configvalueclass_ && this->configvalue_);
+        }
+        else if (this->state_ == CS_KeybindCommand || this->state_ == CS_KeybindFinished)
+        {
+            return this->key_;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    void CommandEvaluation::evaluateParams()
+    {
+        this->bEvaluatedParams_ = false;
+        this->evaluatedExecutor_ = 0;
+
+        for (unsigned int i = 0; i < MAX_FUNCTOR_ARGUMENTS; i++)
+            this->param_[i] = MT_null;
+
+        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
+        {
+            if (this->shortcut_)
+            {
+                if (this->shortcut_->evaluate(this->processedCommand_ + this->getAdditionalParameter(), this->param_, " "))
+                {
+                    this->bEvaluatedParams_ = true;
+                    this->evaluatedExecutor_ = this->shortcut_;
+                }
+            }
+        }
+        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        {
+            if (this->function_)
+            {
+                if (this->function_->evaluate(this->processedCommand_ + this->getAdditionalParameter(), this->param_, " "))
+                {
+                    this->bEvaluatedParams_ = true;
+                    this->evaluatedExecutor_ = this->function_;
+                }
+            }
+        }
+    }
+
+    void CommandEvaluation::setEvaluatedParameter(unsigned int index, MultiTypeMath param)
+    {
+        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+            this->param_[index] = param;
+    }
+
+    MultiTypeMath CommandEvaluation::getEvaluatedParameter(unsigned int index) const
+    {
+        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+            return this->param_[index];
+
+        return MT_null;
+    }
+
+    MultiTypeMath CommandEvaluation::getReturnvalue() const
+    {
+        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
+        {
+            if (this->shortcut_)
+                return this->shortcut_->getReturnvalue();
+        }
+        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        {
+            if (this->function_)
+                return this->function_->getReturnvalue();
+        }
+
+        return MT_null;
+    }
+
+
+    /////////////////////
+    // CommandExecutor //
+    /////////////////////
+    CommandExecutor& CommandExecutor::getInstance()
+    {
+        static CommandExecutor instance;
+        return instance;
+    }
+
+    CommandEvaluation& CommandExecutor::getEvaluation()
+    {
+        return CommandExecutor::getInstance().evaluation_;
+    }
+
+    Executor& CommandExecutor::addConsoleCommandShortcut(ExecutorStatic* executor)
+    {
+        CommandExecutor::getInstance().consoleCommandShortcuts_[executor->getName()] = executor;
+        CommandExecutor::getInstance().consoleCommandShortcuts_LC_[getLowercase(executor->getName())] = executor;
+        return (*executor);
+    }
+
+    /**
+        @brief Returns the executor of a console command shortcut with given name.
+        @brief name The name of the requested console command shortcut
+        @return The executor of the requested console command shortcut
+    */
+    ExecutorStatic* CommandExecutor::getConsoleCommandShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_.find(name);
+        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the executor of a console command shortcut with given name in lowercase.
+        @brief name The name of the requested console command shortcut in lowercase
+        @return The executor of the requested console command shortcut
+    */
+    ExecutorStatic* CommandExecutor::getLowercaseConsoleCommandShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_LC_.find(name);
+        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    bool CommandExecutor::execute(const std::string& command)
+    {
+        std::string strippedCommand = stripEnclosingQuotes(command);
+
+        SubString tokensIO(strippedCommand, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+        if (tokensIO.size() >= 2)
+        {
+            if (tokensIO[tokensIO.size() - 2] == ">")
+            {
+                bool success = CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join());
+                write(tokensIO[tokensIO.size() - 1], CommandExecutor::getEvaluation().getReturnvalue());
+                return success;
+            }
+            else if (tokensIO[tokensIO.size() - 2] == "<")
+            {
+                std::string input = read(tokensIO[tokensIO.size() - 1]);
+                if (input == "" || input.size() == 0)
+                    return CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join());
+                else
+                    return CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join() + " " + input);
+            }
+        }
+
+
+        SubString tokensPipeline(strippedCommand, "|", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+        if (tokensPipeline.size() > 1)
+        {
+            bool success = true;
+            std::string returnValue = "";
+            for (int i = tokensPipeline.size() - 1; i >= 0; i--)
+            {
+                if (returnValue == "" || returnValue.size() == 0)
+                {
+                    //CommandEvaluation evaluation = CommandExecutor::evaluate(tokens[i]);
+                    if (!CommandExecutor::execute(tokensPipeline[i]))
+                        success = false;
+                }
+                else
+                {
+                    //CommandEvaluation evaluation = CommandExecutor::evaluate(tokens[i] + " " + returnValue);
+                    if (!CommandExecutor::execute(tokensPipeline[i] + " " + returnValue))
+                        success = false;
+                }
+
+                //CommandExecutor::execute(evaluation);
+                //returnValue = evaluation.getReturnvalue();
+                returnValue = CommandExecutor::getEvaluation().getReturnvalue().toString();
+            }
+            return success;
+        }
+
+        if ((CommandExecutor::getEvaluation().processedCommand_ != strippedCommand) || (CommandExecutor::getEvaluation().state_ == CS_Uninitialized))
+            CommandExecutor::parse(strippedCommand);
+
+        return CommandExecutor::execute(CommandExecutor::getEvaluation());
+    }
+
+
+    bool CommandExecutor::execute(const CommandEvaluation& evaluation)
+    {
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+
+        if (evaluation.bEvaluatedParams_ && evaluation.evaluatedExecutor_)
+        {
+            (*evaluation.evaluatedExecutor_)(evaluation.param_[0], evaluation.param_[1], evaluation.param_[2], evaluation.param_[3], evaluation.param_[4]);
+        }
+
+        switch (evaluation.state_)
+        {
+            case CS_Uninitialized:
+                break;
+            case CS_Empty:
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                // not enough parameters but lets hope there are some additional parameters and go on
+            case CS_Shortcut_Finished:
+                // call the shortcut
+                if (evaluation.shortcut_)
+                {
+                    if (tokens.size() >= 2)
+                        return evaluation.shortcut_->parse(removeSlashes(tokens.subSet(1).join() + evaluation.getAdditionalParameter()));
+                    else
+                        return evaluation.shortcut_->parse(removeSlashes(evaluation.additionalParameter_));
+                }
+                break;
+            case CS_Function:
+                break;
+            case CS_Function_Params:
+                // not enough parameters but lets hope there are some additional parameters and go on
+            case CS_Function_Finished:
+                // call the shortcut
+                if (evaluation.function_)
+                {
+                    if (tokens.size() >= 3)
+                        return evaluation.function_->parse(removeSlashes(tokens.subSet(2).join() + evaluation.getAdditionalParameter()));
+                    else
+                        return evaluation.function_->parse(removeSlashes(evaluation.additionalParameter_));
+                }
+                break;
+            case CS_ConfigValueClass:
+                break;
+            case CS_ConfigValue:
+                break;
+            case CS_ConfigValueType:
+                // not enough parameters but lets hope there are some additional parameters and go on
+            case CS_ConfigValueFinished:
+                // set the config value
+                if (evaluation.configvalue_)
+                {
+                    if ((tokens.size() >= 1) && (tokens[0] == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE))
+                    {
+                        if (tokens.size() >= 4)
+                            return evaluation.configvalue_->set(removeSlashes(tokens.subSet(3).join() + evaluation.getAdditionalParameter()));
+                        else
+                            return evaluation.configvalue_->set(removeSlashes(evaluation.additionalParameter_));
+                    }
+                    else if ((tokens.size() >= 1) && (tokens[0] == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY))
+                    {
+                        if (tokens.size() >= 4)
+                            return evaluation.configvalue_->tset(removeSlashes(tokens.subSet(3).join() + evaluation.getAdditionalParameter()));
+                        else
+                            return evaluation.configvalue_->tset(removeSlashes(evaluation.additionalParameter_));
+                    }
+                }
+                break;
+            case CS_KeybindKey:
+                break;
+            case CS_KeybindCommand:
+                // not enough parameters but lets hope there are some additional parameters and go on
+            case CS_KeybindFinished:
+                // set the keybind
+                // ...todo
+                break;
+            case CS_Error:
+                break;
+        }
+
+        return false;
+    }
+
+    std::string CommandExecutor::complete(const std::string& command)
+    {
+        if ((CommandExecutor::getEvaluation().processedCommand_ != command) || (CommandExecutor::getEvaluation().state_ == CS_Uninitialized))
+            CommandExecutor::parse(command);
+
+        return CommandExecutor::complete(CommandExecutor::getEvaluation());
+    }
+
+    std::string CommandExecutor::complete(const CommandEvaluation& evaluation)
+    {
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+
+        std::list<std::pair<const std::string*, const std::string*> > temp;
+        if (evaluation.state_ == CS_Empty)
+        {
+            temp.insert(temp.end(), evaluation.listOfPossibleShortcuts_.begin(), evaluation.listOfPossibleShortcuts_.end());
+            temp.insert(temp.end(), evaluation.listOfPossibleFunctionClasses_.begin(), evaluation.listOfPossibleFunctionClasses_.end());
+        }
+
+        switch (evaluation.state_)
+        {
+            case CS_Uninitialized:
+                break;
+            case CS_Empty:
+                return (CommandExecutor::getCommonBegin(temp));
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                if (evaluation.shortcut_)
+                    return (evaluation.shortcut_->getName() + " ");
+                break;
+            case CS_Shortcut_Finished:
+                if (evaluation.shortcut_)
+                {
+                    if (evaluation.shortcut_->getParamCount() == 0)
+                        return (evaluation.shortcut_->getName());
+                    else if (tokens.size() >= 2)
+                        return (evaluation.shortcut_->getName() + " " + tokens.subSet(1).join());
+                }
+                break;
+            case CS_Function:
+                if (evaluation.functionclass_)
+                    return (evaluation.functionclass_->getName() + " " + CommandExecutor::getCommonBegin(evaluation.listOfPossibleFunctions_));
+                break;
+            case CS_Function_Params:
+                if (evaluation.functionclass_ && evaluation.function_)
+                    return (evaluation.functionclass_->getName() + " " + evaluation.function_->getName() + " ");
+                break;
+            case CS_Function_Finished:
+                if (evaluation.functionclass_ && evaluation.function_)
+                {
+                    if (evaluation.function_->getParamCount() == 0)
+                        return (evaluation.functionclass_->getName() + " " + evaluation.function_->getName());
+                    else if (tokens.size() >= 3)
+                        return (evaluation.functionclass_->getName() + " " + evaluation.function_->getName() + " " + tokens.subSet(2).join());
+                }
+                break;
+            case CS_ConfigValueClass:
+                if (tokens.size() >= 1)
+                    return (tokens[0] + " " + CommandExecutor::getCommonBegin(evaluation.listOfPossibleConfigValueClasses_));
+                break;
+            case CS_ConfigValue:
+                if ((tokens.size() >= 1) && evaluation.configvalueclass_)
+                    return (tokens[0] + " " + evaluation.configvalueclass_->getName() + " " + CommandExecutor::getCommonBegin(evaluation.listOfPossibleConfigValues_));
+                break;
+            case CS_ConfigValueType:
+                if ((tokens.size() >= 1) && evaluation.configvalueclass_ && evaluation.configvalue_)
+                    return (tokens[0] + " " + evaluation.configvalueclass_->getName() + " " + evaluation.configvalue_->getName() + " ");
+                break;
+            case CS_ConfigValueFinished:
+                if ((tokens.size() >= 1) && evaluation.configvalueclass_ && evaluation.configvalue_ && (tokens.size() >= 4))
+                    return (tokens[0] + " " + evaluation.configvalueclass_->getName() + " " + evaluation.configvalue_->getName() + " " + tokens.subSet(3).join());
+                break;
+            case CS_KeybindKey:
+                if (tokens.size() >= 1)
+                    return (tokens[0] + " " + CommandExecutor::getCommonBegin(evaluation.listOfPossibleKeys_));
+                break;
+            case CS_KeybindCommand:
+                if ((evaluation.processedCommand_.size() >= 1) && (evaluation.processedCommand_[evaluation.processedCommand_.size() - 1] != ' '))
+                    return (evaluation.processedCommand_ + " ");
+                break;
+            case CS_KeybindFinished:
+                break;
+            case CS_Error:
+                break;
+        }
+
+        return evaluation.processedCommand_;
+    }
+
+    std::string CommandExecutor::hint(const std::string& command)
+    {
+        if ((CommandExecutor::getEvaluation().processedCommand_ != command) || (CommandExecutor::getEvaluation().state_ == CS_Uninitialized))
+            CommandExecutor::parse(command);
+
+        return CommandExecutor::hint(CommandExecutor::getEvaluation());
+    }
+
+    std::string CommandExecutor::hint(const CommandEvaluation& evaluation)
+    {
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+
+        switch (evaluation.state_)
+        {
+            case CS_Uninitialized:
+                break;
+            case CS_Empty:
+                return (CommandExecutor::dump(evaluation.listOfPossibleShortcuts_) + "\n" + CommandExecutor::dump(evaluation.listOfPossibleFunctionClasses_));
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                if (evaluation.shortcut_)
+                    return CommandExecutor::dump(evaluation.shortcut_);
+                break;
+            case CS_Shortcut_Finished:
+                if (evaluation.shortcut_)
+                    return CommandExecutor::dump(evaluation.shortcut_);
+                break;
+            case CS_Function:
+                return CommandExecutor::dump(evaluation.listOfPossibleFunctions_);
+                break;
+            case CS_Function_Params:
+                if (evaluation.function_)
+                    return CommandExecutor::dump(evaluation.function_);
+                break;
+            case CS_Function_Finished:
+                if (evaluation.function_)
+                    return CommandExecutor::dump(evaluation.function_);
+                break;
+            case CS_ConfigValueClass:
+                return CommandExecutor::dump(evaluation.listOfPossibleConfigValueClasses_);
+                break;
+            case CS_ConfigValue:
+                return CommandExecutor::dump(evaluation.listOfPossibleConfigValues_);
+                break;
+            case CS_ConfigValueType:
+                if (evaluation.configvalue_)
+                    return CommandExecutor::dump(evaluation.configvalue_);
+                break;
+            case CS_ConfigValueFinished:
+                if (evaluation.configvalue_)
+                    return CommandExecutor::dump(evaluation.configvalue_);
+                break;
+            case CS_KeybindKey:
+                return CommandExecutor::dump(evaluation.listOfPossibleKeys_);
+                break;
+            case CS_KeybindCommand:
+                if (evaluation.key_)
+                    return CommandExecutor::dump(evaluation.key_);
+                break;
+            case CS_KeybindFinished:
+                if (evaluation.key_)
+                    return CommandExecutor::dump(evaluation.key_);
+                break;
+            case CS_Error:
+                return CommandExecutor::getEvaluation().errorMessage_;
+                break;
+        }
+
+        return "";
+    }
+
+    CommandEvaluation CommandExecutor::evaluate(const std::string& command)
+    {
+        CommandExecutor::parse(command, true);
+        CommandExecutor::getEvaluation().evaluateParams();
+        return CommandExecutor::getEvaluation();
+    }
+
+    void CommandExecutor::parse(const std::string& command, bool bInitialize)
+    {
+        CommandExecutor::getEvaluation().tokens_.split((command + COMMAND_EXECUTOR_CURSOR), " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+        CommandExecutor::getEvaluation().processedCommand_ = command;
+
+        if (bInitialize)
+            CommandExecutor::initialize(command);
+
+        switch (CommandExecutor::getEvaluation().state_)
+        {
+            case CS_Uninitialized:
+                // Impossible
+                break;
+            case CS_Empty:
+                if (CommandExecutor::argumentsGiven() == 0)
+                {
+                    // We want a hint for the first token
+                    // Check if there is already a perfect match
+                    CommandExecutor::getEvaluation().functionclass_ = CommandExecutor::getIdentifierOfPossibleFunctionClass(CommandExecutor::getToken(0));
+                    CommandExecutor::getEvaluation().shortcut_ = CommandExecutor::getExecutorOfPossibleShortcut(CommandExecutor::getToken(0));
+
+                    if ((CommandExecutor::getEvaluation().functionclass_) || (CommandExecutor::getEvaluation().shortcut_))
+                    {
+                        // Yes, there is a class or a shortcut with the searched name
+                        // Add a whitespace and continue parsing
+                        CommandExecutor::getEvaluation().state_ = CS_FunctionClass_Or_Shortcut_Or_Keyword;
+                        CommandExecutor::parse(command + " ", false);
+                        return;
+                    }
+
+                    // No perfect match: Create the lists of all possible classes and shortcuts and return
+                    CommandExecutor::createListOfPossibleFunctionClasses(CommandExecutor::getToken(0));
+                    CommandExecutor::createListOfPossibleShortcuts(CommandExecutor::getToken(0));
+
+                    // Check if there's only one possiblility
+                    if ((CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.size() == 1) && (CommandExecutor::getEvaluation().listOfPossibleShortcuts_.size() == 0))
+                    {
+                        // There's only one possible class
+                        CommandExecutor::getEvaluation().state_ = CS_Function;
+                        CommandExecutor::getEvaluation().functionclass_ = CommandExecutor::getIdentifierOfPossibleFunctionClass(*(*CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.begin()).first);
+                        CommandExecutor::parse(*(*CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.begin()).first + " ", false);
+                        return;
+                    }
+                    else if ((CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.size() == 0) && (CommandExecutor::getEvaluation().listOfPossibleShortcuts_.size() == 1))
+                    {
+                        if ((*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first != COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE)
+                         && (*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first != COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)
+                         && (*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first != COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND))
+                        {
+                            // There's only one possible shortcut
+                            CommandExecutor::getEvaluation().state_ = CS_Shortcut_Params;
+                            CommandExecutor::getEvaluation().shortcut_ = CommandExecutor::getExecutorOfPossibleShortcut(*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first);
+                        }
+                        else if ((*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE)
+                              || (*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY))
+                        {
+                            // It's the 'set' or 'tset' keyword
+                            CommandExecutor::getEvaluation().state_ = CS_ConfigValueClass;
+                        }
+                        else if (*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first != COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND)
+                        {
+                            // It's the 'bind' keyword
+                            CommandExecutor::getEvaluation().state_ = CS_KeybindKey;
+                        }
+
+                        CommandExecutor::parse(*(*CommandExecutor::getEvaluation().listOfPossibleShortcuts_.begin()).first + " ", false);
+                        return;
+                    }
+
+                    // It's ambiguous
+                    return;
+                }
+                else
+                {
+                    // There is at least one argument: Check if it's a shortcut, a classname or a special keyword
+                    CommandExecutor::getEvaluation().state_ = CS_FunctionClass_Or_Shortcut_Or_Keyword;
+                    CommandExecutor::parse(command, false);
+                    return;
+                }
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                if (CommandExecutor::argumentsGiven() >= 1)
+                {
+                    if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY))
+                    {
+                        // We want to set a config value
+                        CommandExecutor::getEvaluation().state_ = CS_ConfigValueClass;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                    else if (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND)
+                    {
+                        // We want to set a keybinding
+                        CommandExecutor::getEvaluation().state_ = CS_KeybindKey;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+
+                    if (!CommandExecutor::getEvaluation().functionclass_)
+                        CommandExecutor::getEvaluation().functionclass_ = CommandExecutor::getIdentifierOfPossibleFunctionClass(CommandExecutor::getToken(0));
+                    if (!CommandExecutor::getEvaluation().shortcut_)
+                        CommandExecutor::getEvaluation().shortcut_ = CommandExecutor::getExecutorOfPossibleShortcut(CommandExecutor::getToken(0));
+
+                    if ((!CommandExecutor::getEvaluation().functionclass_) && (!CommandExecutor::getEvaluation().shortcut_))
+                    {
+                        // Argument 1 seems to be wrong
+                        AddLanguageEntry("CommandExecutor::NoSuchCommandOrClassName", "No such command or classname");
+                        CommandExecutor::getEvaluation().errorMessage_ = (CommandExecutor::getToken(0) + ": " + GetLocalisation("CommandExecutor::NoSuchCommandOrClassName"));
+                        CommandExecutor::getEvaluation().state_ = CS_Error;
+                        return;
+                    }
+                    else if (CommandExecutor::getEvaluation().shortcut_)
+                    {
+                        // Argument 1 is a shortcut: Return the needed parameter types
+                        CommandExecutor::getEvaluation().state_ = CS_Shortcut_Params;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                    else
+                    {
+                        // Argument 1 is a classname: Return the possible functions
+                        CommandExecutor::getEvaluation().state_ = CS_Function;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                }
+                else
+                {
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Shortcut_Params:
+                if (CommandExecutor::getEvaluation().shortcut_)
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::enoughParametersGiven(1, CommandExecutor::getEvaluation().shortcut_))
+                    {
+                        CommandExecutor::getEvaluation().state_ = CS_Shortcut_Finished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Function:
+                if (CommandExecutor::getEvaluation().functionclass_)
+                {
+                    // We have a valid classname
+                    // Check if there is a second argument
+                    if (CommandExecutor::argumentsGiven() >= 2)
+                    {
+                        // There is a second argument: Check if it's a valid functionname
+                        CommandExecutor::getEvaluation().function_ = CommandExecutor::getExecutorOfPossibleFunction(CommandExecutor::getToken(1), CommandExecutor::getEvaluation().functionclass_);
+                        if (!CommandExecutor::getEvaluation().function_)
+                        {
+                            // Argument 2 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchFunctionnameIn", "No such functionname in");
+                            CommandExecutor::getEvaluation().errorMessage_ = (CommandExecutor::getToken(1) + ": " + GetLocalisation("CommandExecutor::NoSuchFunctionnameIn") + " " + CommandExecutor::getEvaluation().functionclass_->getName());
+                            CommandExecutor::getEvaluation().state_ = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 2 seems to be a valid functionname: Get the parameters
+                            CommandExecutor::getEvaluation().state_ = CS_Function_Params;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There is no finished second argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::getEvaluation().tokens_.size() >= 2)
+                        {
+                            CommandExecutor::getEvaluation().function_ = CommandExecutor::getExecutorOfPossibleFunction(CommandExecutor::getToken(1), CommandExecutor::getEvaluation().functionclass_);
+                            if (CommandExecutor::getEvaluation().function_)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::getEvaluation().state_ = CS_Function_Params;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible functions and return
+                        CommandExecutor::createListOfPossibleFunctions(CommandExecutor::getToken(1), CommandExecutor::getEvaluation().functionclass_);
+
+                        // Check if there's only one possiblility
+                        if (CommandExecutor::getEvaluation().listOfPossibleFunctions_.size() == 1)
+                        {
+                            // There's only one possible function
+                            CommandExecutor::getEvaluation().state_ = CS_Function_Params;
+                            CommandExecutor::getEvaluation().function_ = CommandExecutor::getExecutorOfPossibleFunction(*(*CommandExecutor::getEvaluation().listOfPossibleFunctions_.begin()).first, CommandExecutor::getEvaluation().functionclass_);
+                            CommandExecutor::parse(CommandExecutor::getToken(0) + " " + *(*CommandExecutor::getEvaluation().listOfPossibleFunctions_.begin()).first + " ", false);
+                            return;
+                        }
+
+                        // It's ambiguous
+                        return;
+                    }
+                }
+                else
+                {
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Function_Params:
+                if (CommandExecutor::getEvaluation().functionclass_ && CommandExecutor::getEvaluation().function_)
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::enoughParametersGiven(2, CommandExecutor::getEvaluation().function_))
+                    {
+                        CommandExecutor::getEvaluation().state_ = CS_Function_Finished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValueClass:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)))
+                {
+                    // We want to set a config value
+                    // Check if there is a second argument
+                    if (CommandExecutor::argumentsGiven() >= 2)
+                    {
+                        // There is a second argument: Check if it's a valid classname
+                        CommandExecutor::getEvaluation().configvalueclass_ = CommandExecutor::getIdentifierOfPossibleConfigValueClass(CommandExecutor::getToken(1));
+                        if (!CommandExecutor::getEvaluation().configvalueclass_)
+                        {
+                            // Argument 2 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchClassWithConfigValues", "No such class with config values");
+                            CommandExecutor::getEvaluation().errorMessage_ = (CommandExecutor::getToken(1) + ": " + GetLocalisation("CommandExecutor::NoSuchClassWithConfigValues"));
+                            CommandExecutor::getEvaluation().state_ = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 2 seems to be a valid classname: Search for possible config values
+                            CommandExecutor::getEvaluation().state_ = CS_ConfigValue;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There's no finished second argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::getEvaluation().tokens_.size() >= 2)
+                        {
+                            CommandExecutor::getEvaluation().configvalueclass_ = CommandExecutor::getIdentifierOfPossibleConfigValueClass(CommandExecutor::getToken(1));
+                            if (CommandExecutor::getEvaluation().configvalueclass_)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::getEvaluation().state_ = CS_ConfigValue;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible classnames and return
+                        CommandExecutor::createListOfPossibleConfigValueClasses(CommandExecutor::getToken(1));
+
+                        // Check if there's only one possiblility
+                        if (CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.size() == 1)
+                        {
+                            // There's only one possible classname
+                            CommandExecutor::getEvaluation().state_ = CS_ConfigValue;
+                            CommandExecutor::getEvaluation().configvalueclass_ = CommandExecutor::getIdentifierOfPossibleConfigValueClass(*(*CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.begin()).first);
+                            CommandExecutor::parse(CommandExecutor::getToken(0) + " " + *(*CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.begin()).first + " ", false);
+                            return;
+                        }
+
+                        // It's ambiguous
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValue:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) && (CommandExecutor::getEvaluation().configvalueclass_))
+                {
+                    // Check if there is a third argument
+                    if (CommandExecutor::argumentsGiven() >= 3)
+                    {
+                        // There is a third argument: Check if it's a valid config value
+                        CommandExecutor::getEvaluation().configvalue_ = CommandExecutor::getContainerOfPossibleConfigValue(CommandExecutor::getToken(2), CommandExecutor::getEvaluation().configvalueclass_);
+                        if (!CommandExecutor::getEvaluation().configvalue_)
+                        {
+                            // Argument 3 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchConfigValueIn", "No such config value in");
+                            CommandExecutor::getEvaluation().errorMessage_ = (CommandExecutor::getToken(2) + ": " + GetLocalisation("CommandExecutor::NoSuchConfigValueIn") + " " + CommandExecutor::getEvaluation().configvalueclass_->getName());
+                            CommandExecutor::getEvaluation().state_ = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 3 seems to be a valid config value: Get the type
+                            CommandExecutor::getEvaluation().state_ = CS_ConfigValueType;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There is no finished third argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::getEvaluation().tokens_.size() >= 3)
+                        {
+                            CommandExecutor::getEvaluation().configvalue_ = CommandExecutor::getContainerOfPossibleConfigValue(CommandExecutor::getToken(2), CommandExecutor::getEvaluation().configvalueclass_);
+                            if (CommandExecutor::getEvaluation().configvalue_)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::getEvaluation().state_ = CS_ConfigValueType;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible config values
+                        CommandExecutor::createListOfPossibleConfigValues(CommandExecutor::getToken(2), CommandExecutor::getEvaluation().configvalueclass_);
+
+                        // Check if there's only one possiblility
+                        if (CommandExecutor::getEvaluation().listOfPossibleConfigValues_.size() == 1)
+                        {
+                            // There's only one possible config value
+                            CommandExecutor::getEvaluation().state_ = CS_ConfigValueType;
+                            CommandExecutor::getEvaluation().configvalue_ = CommandExecutor::getContainerOfPossibleConfigValue(*(*CommandExecutor::getEvaluation().listOfPossibleConfigValues_.begin()).first, CommandExecutor::getEvaluation().configvalueclass_);
+                            CommandExecutor::parse(CommandExecutor::getToken(0) + " " + CommandExecutor::getToken(1) + " " + *(*CommandExecutor::getEvaluation().listOfPossibleConfigValues_.begin()).first + " ", false);
+                            return;
+                        }
+
+                        // It's ambiguous
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValueType:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) && CommandExecutor::getEvaluation().configvalueclass_ && CommandExecutor::getEvaluation().configvalue_)
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if ((CommandExecutor::getEvaluation().tokens_.size() >= 4) && (CommandExecutor::getEvaluation().tokens_[3] != COMMAND_EXECUTOR_CURSOR))
+                    {
+                        CommandExecutor::getEvaluation().state_ = CS_ConfigValueFinished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_KeybindKey:
+                if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND))
+                {
+                    // todo
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_KeybindCommand:
+                if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND) && (false)) // todo
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::getEvaluation().tokens_.size() >= 3)
+                    {
+                        CommandExecutor::getEvaluation().state_ = CS_KeybindFinished;
+                        return;
+                    }
+
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::getEvaluation().state_ = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Shortcut_Finished:
+                // Nothing to do
+                break;
+            case CS_Function_Finished:
+                // Nothing to do
+                break;
+            case CS_ConfigValueFinished:
+                // Nothing to do
+                break;
+            case CS_KeybindFinished:
+                // Nothing to do
+                break;
+            case CS_Error:
+                // This is bad
+                break;
+        }
+    }
+
+    void CommandExecutor::initialize(const std::string& command)
+    {
+        CommandExecutor::getEvaluation().processedCommand_ = command;
+        CommandExecutor::getEvaluation().additionalParameter_ = "";
+
+        CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.clear();
+        CommandExecutor::getEvaluation().listOfPossibleShortcuts_.clear();
+        CommandExecutor::getEvaluation().listOfPossibleFunctions_.clear();
+        CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.clear();
+        CommandExecutor::getEvaluation().listOfPossibleConfigValues_.clear();
+        CommandExecutor::getEvaluation().listOfPossibleKeys_.clear();
+
+        CommandExecutor::getEvaluation().functionclass_ = 0;
+        CommandExecutor::getEvaluation().configvalueclass_ = 0;
+        CommandExecutor::getEvaluation().shortcut_ = 0;
+        CommandExecutor::getEvaluation().function_ = 0;
+        CommandExecutor::getEvaluation().configvalue_ = 0;
+        CommandExecutor::getEvaluation().key_ = 0;
+
+        CommandExecutor::getEvaluation().errorMessage_ = "";
+        CommandExecutor::getEvaluation().state_ = CS_Empty;
+    }
+
+    bool CommandExecutor::argumentsGiven(unsigned int num)
+    {
+        // Because we added a cursor we have +1 arguments
+        // There are num arguments given if there are at least num arguments + one cursor
+        return (CommandExecutor::getEvaluation().tokens_.size() >= (num + 1));
+    }
+
+    unsigned int CommandExecutor::argumentsGiven()
+    {
+        // Because we added a cursor we have +1 arguments
+        if (CommandExecutor::getEvaluation().tokens_.size() >= 1)
+            return (CommandExecutor::getEvaluation().tokens_.size() - 1);
+        else
+            return 0;
+    }
+
+    std::string CommandExecutor::getToken(unsigned int index)
+    {
+        if ((index >= 0) && (index < (CommandExecutor::getEvaluation().tokens_.size() - 1)))
+            return CommandExecutor::getEvaluation().tokens_[index];
+        else if (index == (CommandExecutor::getEvaluation().tokens_.size() - 1))
+            return CommandExecutor::getEvaluation().tokens_[index].substr(0, CommandExecutor::getEvaluation().tokens_[index].size() - 1);
+        else
+            return "";
+    }
+
+    bool CommandExecutor::enoughParametersGiven(unsigned int head, Executor* executor)
+    {
+        unsigned int neededParams = head + executor->getParamCount();
+        /*
+        for (unsigned int i = executor->getParamCount() - 1; i >= 0; i--)
+        {
+            if (executor->defaultValueSet(i))
+                neededParams--;
+            else
+                break;
+        }
+        */
+        return ((CommandExecutor::getEvaluation().tokens_.size() >= neededParams) && (CommandExecutor::getEvaluation().tokens_[neededParams - 1] != COMMAND_EXECUTOR_CURSOR));
+    }
+
+    void CommandExecutor::createListOfPossibleFunctionClasses(const std::string& fragment)
+    {
+        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMapBegin(); it != Identifier::getLowercaseIdentifierMapEnd(); ++it)
+        {
+            if ((*it).second->hasConsoleCommands())
+            {
+                if ((*it).first.find(getLowercase(fragment)) == 0 || fragment == "")
+                {
+                    CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
+                }
+            }
+        }
+
+        CommandExecutor::getEvaluation().listOfPossibleFunctionClasses_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleShortcuts(const std::string& fragment)
+    {
+        for (std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMapBegin(); it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0 || fragment == "")
+            {
+                CommandExecutor::getEvaluation().listOfPossibleShortcuts_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
+            }
+        }
+
+        CommandExecutor::getEvaluation().listOfPossibleShortcuts_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier)
+    {
+        for (std::map<std::string, ExecutorStatic*>::const_iterator it = identifier->getLowercaseConsoleCommandMapBegin(); it != identifier->getLowercaseConsoleCommandMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0 || fragment == "")
+            {
+                CommandExecutor::getEvaluation().listOfPossibleFunctions_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
+            }
+        }
+
+        CommandExecutor::getEvaluation().listOfPossibleFunctions_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleConfigValueClasses(const std::string& fragment)
+    {
+        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMapBegin(); it != Identifier::getLowercaseIdentifierMapEnd(); ++it)
+        {
+            if ((*it).second->hasConfigValues())
+            {
+                if ((*it).first.find(getLowercase(fragment)) == 0 || fragment == "")
+                {
+                    CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
+                }
+            }
+        }
+
+        CommandExecutor::getEvaluation().listOfPossibleConfigValueClasses_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleConfigValues(const std::string& fragment, Identifier* identifier)
+    {
+        for (std::map<std::string, ConfigValueContainer*>::const_iterator it = identifier->getLowercaseConfigValueMapBegin(); it != identifier->getLowercaseConfigValueMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0 || fragment == "")
+            {
+                CommandExecutor::getEvaluation().listOfPossibleConfigValues_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
+            }
+        }
+
+        CommandExecutor::getEvaluation().listOfPossibleConfigValues_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleKeys(const std::string& fragment)
+    {
+        // todo
+
+        CommandExecutor::getEvaluation().listOfPossibleKeys_.sort(CommandExecutor::compareStringsInList);
+    }
+
+    bool CommandExecutor::compareStringsInList(const std::pair<const std::string*, const std::string*>& first, const std::pair<const std::string*, const std::string*>& second)
+    {
+        return ((*first.first) < (*second.first));
+    }
+
+    Identifier* CommandExecutor::getIdentifierOfPossibleFunctionClass(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMap().find(getLowercase(name));
+        if ((it != Identifier::getLowercaseIdentifierMapEnd()) && (*it).second->hasConsoleCommands())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ExecutorStatic* CommandExecutor::getExecutorOfPossibleShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMap().find(getLowercase(name));
+        if (it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ExecutorStatic* CommandExecutor::getExecutorOfPossibleFunction(const std::string& name, Identifier* identifier)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = identifier->getLowercaseConsoleCommandMap().find(getLowercase(name));
+        if (it != identifier->getLowercaseConsoleCommandMapEnd())
+            return (*it).second;
+
+        return 0;
+    }
+
+    Identifier* CommandExecutor::getIdentifierOfPossibleConfigValueClass(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMap().find(getLowercase(name));
+        if ((it != Identifier::getLowercaseIdentifierMapEnd()) && (*it).second->hasConfigValues())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ConfigValueContainer* CommandExecutor::getContainerOfPossibleConfigValue(const std::string& name, Identifier* identifier)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = identifier->getLowercaseConfigValueMap().find(getLowercase(name));
+        if (it != identifier->getLowercaseConfigValueMapEnd())
+        {
+            return (*it).second;
+        }
+
+        return 0;
+    }
+
+    ConfigValueContainer* CommandExecutor::getContainerOfPossibleKey(const std::string& name)
+    {
+        // todo
+
+        return 0;
+    }
+
+    std::string CommandExecutor::dump(const std::list<std::pair<const std::string*, const std::string*> >& list)
+    {
+        std::string output = "";
+        for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it)
+        {
+            if (it != list.begin())
+                output += " ";
+
+            output += *(*it).second;
+        }
+        return output;
+    }
+
+    std::string CommandExecutor::dump(const ExecutorStatic* executor)
+    {
+        std::string output = "";
+        for (unsigned int i = 0; i < executor->getParamCount(); i++)
+        {
+            if (i != 0)
+                output += " ";
+
+            if (executor->defaultValueSet(i))
+                output += "[";
+            else
+                output += "{";
+
+            output += executor->getTypenameParam(i);
+
+            if (executor->defaultValueSet(i))
+                output += "=" + executor->getDefaultValue(i).toString() + "]";
+            else
+                output += "}";
+        }
+        return output;
+    }
+
+    std::string CommandExecutor::dump(const ConfigValueContainer* container)
+    {
+        AddLanguageEntry("CommandExecutor::oldvalue", "old value");
+        if (!container->isVector())
+            return ("{" + container->getTypename() + "} (" + GetLocalisation("CommandExecutor::oldvalue") + ": " + container->toString() + ")");
+        else
+            return ("(vector<" + container->getTypename() + ">) (size: " + getConvertedValue<unsigned int, std::string>(container->getVectorSize()) + ")");
+    }
+
+    std::string CommandExecutor::getCommonBegin(const std::list<std::pair<const std::string*, const std::string*> >& list)
+    {
+        if (list.size() == 0)
+        {
+            return "";
+        }
+        else if (list.size() == 1)
+        {
+            return ((*(*list.begin()).first) + " ");
+        }
+        else
+        {
+            std::string output = "";
+            for (unsigned int i = 0; true; i++)
+            {
+                char temp = 0;
+                for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it)
+                {
+                    if ((*(*it).first).size() > i)
+                    {
+                        if (it == list.begin())
+                        {
+                            temp = (*(*it).first)[i];
+                        }
+                        else
+                        {
+                            if (temp != (*(*it).first)[i])
+                                return output;
+                        }
+                    }
+                    else
+                    {
+                        return output;
+                    }
+                }
+                output += temp;
+            }
+            return output;
+        }
+    }
+}
Index: code/trunk/src/orxonox/core/CommandExecutor.h
===================================================================
--- code/trunk/src/orxonox/core/CommandExecutor.h	(revision 1052)
+++ code/trunk/src/orxonox/core/CommandExecutor.h	(revision 1052)
@@ -0,0 +1,206 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _CommandExecutor_H__
+#define _CommandExecutor_H__
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "util/SubString.h"
+#include "util/MultiTypeMath.h"
+#include "CorePrereqs.h"
+
+#define COMMAND_EXECUTOR_CURSOR "$"
+
+namespace orxonox
+{
+    enum CommandState
+    {
+        CS_Uninitialized,
+        CS_Empty,
+        CS_FunctionClass_Or_Shortcut_Or_Keyword,
+        CS_Shortcut_Params,
+        CS_Shortcut_Finished,
+        CS_Function,
+        CS_Function_Params,
+        CS_Function_Finished,
+        CS_ConfigValueClass,
+        CS_ConfigValue,
+        CS_ConfigValueType,
+        CS_ConfigValueFinished,
+        CS_KeybindKey,
+        CS_KeybindCommand,
+        CS_KeybindFinished,
+        CS_Error
+    };
+
+    void exec(const std::string& filename);
+    std::string echo(const std::string& text);
+
+    void write(const std::string& filename, const std::string& text);
+    void append(const std::string& filename, const std::string& text);
+    std::string read(const std::string& filename);
+
+    enum KeybindMode {}; // temporary
+
+    ///////////////////////
+    // CommandEvaluation //
+    ///////////////////////
+    class _CoreExport CommandEvaluation
+    {
+        friend class CommandExecutor;
+
+        public:
+            CommandEvaluation();
+
+            KeybindMode getKeybindMode();
+            bool isValid() const;
+
+            inline void setAdditionalParameter(const std::string& param)
+                { this->additionalParameter_ = param; this->bEvaluatedParams_ = false; }
+            inline std::string getAdditionalParameter() const
+                { return (this->additionalParameter_ != "") ? (" " + this->additionalParameter_) : ""; }
+
+            void setEvaluatedParameter(unsigned int index, MultiTypeMath param);
+            MultiTypeMath getEvaluatedParameter(unsigned int index) const;
+
+            void evaluateParams();
+
+            MultiTypeMath getReturnvalue() const;
+
+        private:
+            std::string processedCommand_;
+            SubString tokens_;
+            std::string additionalParameter_;
+
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleFunctionClasses_;
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleShortcuts_;
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleFunctions_;
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleConfigValueClasses_;
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleConfigValues_;
+            std::list<std::pair<const std::string*, const std::string*> > listOfPossibleKeys_;
+
+            Identifier* functionclass_;
+            Identifier* configvalueclass_;
+            ExecutorStatic* shortcut_;
+            ExecutorStatic* function_;
+            ConfigValueContainer* configvalue_;
+            ConfigValueContainer* key_;
+
+            std::string errorMessage_;
+            CommandState state_;
+
+            bool bEvaluatedParams_;
+            MultiTypeMath param_[5];
+            ExecutorStatic* evaluatedExecutor_;
+    };
+
+    /////////////////////
+    // CommandExecutor //
+    /////////////////////
+    class _CoreExport CommandExecutor
+    {
+        public:
+            static bool execute(const std::string& command);
+            static bool execute(const CommandEvaluation& evaluation);
+
+            static std::string complete(const std::string& command);
+            static std::string complete(const CommandEvaluation& evaluation);
+
+            static std::string hint(const std::string& command);
+            static std::string hint(const CommandEvaluation& evaluation);
+
+            static CommandEvaluation evaluate(const std::string& command);
+
+            static Executor& addConsoleCommandShortcut(ExecutorStatic* executor);
+            static ExecutorStatic* getConsoleCommandShortcut(const std::string& name);
+            static ExecutorStatic* getLowercaseConsoleCommandShortcut(const std::string& name);
+
+            /** @brief Returns the map that stores all console commands. @return The const_iterator */
+            static inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_.end(); }
+
+            /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end(); }
+
+        private:
+            CommandExecutor() {}
+            CommandExecutor(const CommandExecutor& other) {}
+            ~CommandExecutor() {}
+
+            static CommandExecutor& getInstance();
+            static CommandEvaluation& getEvaluation();
+
+            static void parse(const std::string& command, bool bInitialize = true);
+            static void initialize(const std::string& command);
+
+            static bool argumentsGiven(unsigned int num);
+            static unsigned int argumentsGiven();
+
+            static std::string getToken(unsigned int index);
+
+            static bool enoughParametersGiven(unsigned int head, Executor* executor);
+
+            static void createListOfPossibleShortcuts(const std::string& fragment);
+            static void createListOfPossibleFunctionClasses(const std::string& fragment);
+            static void createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier);
+            static void createListOfPossibleConfigValueClasses(const std::string& fragment);
+            static void createListOfPossibleConfigValues(const std::string& fragment, Identifier* identifier);
+            static void createListOfPossibleKeys(const std::string& fragment);
+
+            static bool compareStringsInList(const std::pair<const std::string*, const std::string*>& first, const std::pair<const std::string*, const std::string*>& second);
+
+            static std::string dump(const std::list<std::pair<const std::string*, const std::string*> >& list);
+            static std::string dump(const ExecutorStatic* executor);
+            static std::string dump(const ConfigValueContainer* container);
+
+            static std::string getCommonBegin(const std::list<std::pair<const std::string*, const std::string*> >& list);
+
+            static Identifier* getIdentifierOfPossibleFunctionClass(const std::string& name);
+            static ExecutorStatic* getExecutorOfPossibleShortcut(const std::string& name);
+            static ExecutorStatic* getExecutorOfPossibleFunction(const std::string& name, Identifier* identifier);
+            static Identifier* getIdentifierOfPossibleConfigValueClass(const std::string& name);
+            static ConfigValueContainer* getContainerOfPossibleConfigValue(const std::string& name, Identifier* identifier);
+            static ConfigValueContainer* getContainerOfPossibleKey(const std::string& name);
+
+            CommandEvaluation evaluation_;
+
+            std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_;
+            std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_LC_;
+    };
+}
+
+#endif /* _CommandExecutor_H__ */
Index: code/trunk/src/orxonox/core/ConfigFileManager.cc
===================================================================
--- code/trunk/src/orxonox/core/ConfigFileManager.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/ConfigFileManager.cc	(revision 1052)
@@ -0,0 +1,522 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ConfigFileManager.h"
+#include "ConfigValueContainer.h"
+#include "ConsoleCommand.h"
+#include "Identifier.h"
+#include "util/Convert.h"
+#include "util/String.h"
+
+#define CONFIG_FILE_MAX_LINELENGHT 1024
+
+namespace orxonox
+{
+    ConsoleCommandShortcutExtern(reloadConfig, AccessLevel::None);
+    ConsoleCommandShortcutExtern(cleanConfig, AccessLevel::None);
+    ConsoleCommandShortcutExtern(loadSettings, AccessLevel::None);
+    ConsoleCommandShortcutExtern(loadKeybindings, AccessLevel::None);
+
+    void reloadConfig()
+    {
+        ConfigFileManager::getSingleton()->load();
+    }
+
+    void cleanConfig()
+    {
+        ConfigFileManager::getSingleton()->clean(false);
+    }
+
+    void loadSettings(const std::string& filename)
+    {
+        ConfigFileManager::getSingleton()->setFile(CFT_Settings, filename, false);
+    }
+
+    void loadKeybindings(const std::string& filename)
+    {
+        ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, filename);
+    }
+
+
+    //////////////////////////
+    // ConfigFileEntryValue //
+    //////////////////////////
+
+    void ConfigFileEntryValue::setValue(const std::string& value)
+    {
+        if (!this->bString_)
+            this->value_ = value;
+        else
+            this->value_ = "\"" + addSlashes(stripEnclosingQuotes(value)) + "\"";
+    }
+
+    std::string ConfigFileEntryValue::getValue() const
+    {
+        if (!this->bString_)
+            return this->value_;
+        else
+            return removeSlashes(stripEnclosingQuotes(this->value_));
+    }
+
+    std::string ConfigFileEntryValue::getFileEntry() const
+    {
+        if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)
+            return (this->name_ + "=" + this->value_);
+        else
+            return (this->name_ + "=" + this->value_ + " " + this->additionalComment_);
+    }
+
+
+    ///////////////////////////////
+    // ConfigFileEntryVectorValue //
+    ///////////////////////////////
+    std::string ConfigFileEntryVectorValue::getFileEntry() const
+    {
+        if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)
+            return (this->name_ + "[" + getConvertedValue<unsigned int, std::string>(this->index_, "0") + "]" + "=" + this->value_);
+        else
+            return (this->name_ + "[" + getConvertedValue<unsigned int, std::string>(this->index_, "0") + "]=" + this->value_ + " " + this->additionalComment_);
+    }
+
+
+    ///////////////////////
+    // ConfigFileSection //
+    ///////////////////////
+    ConfigFileSection::~ConfigFileSection()
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
+            delete (*(it++));
+    }
+
+    void ConfigFileSection::deleteVectorEntries(const std::string& name, unsigned int startindex)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
+        {
+            if (((*it)->getName() == name) && ((*it)->getIndex() >= startindex))
+            {
+                delete (*it);
+                this->entries_.erase(it++);
+            }
+            else
+            {
+                ++it;
+            }
+        }
+    }
+
+    unsigned int ConfigFileSection::getVectorSize(const std::string& name)
+    {
+        unsigned int size = 0;
+        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+            if ((*it)->getName() == name)
+                if ((*it)->getIndex() > size)
+                    size = (*it)->getIndex();
+        return (size + 1);
+    }
+
+    std::string ConfigFileSection::getFileEntry() const
+    {
+        if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)
+            return ("[" + this->name_ + "]");
+        else
+            return ("[" + this->name_ + "] " + this->additionalComment_);
+    }
+
+    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getEntryIterator(const std::string& name, const std::string& fallback, bool bString)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if ((*it)->getName() == name)
+            {
+                (*it)->setString(bString);
+                return it;
+            }
+        }
+
+        this->bUpdated_ = true;
+
+        return this->entries_.insert(this->entries_.end(), (ConfigFileEntry*)(new ConfigFileEntryValue(name, fallback, bString)));
+    }
+
+    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if (((*it)->getName() == name) && ((*it)->getIndex() == index))
+            {
+                (*it)->setString(bString);
+                return it;
+            }
+        }
+
+        this->bUpdated_ = true;
+
+        if (index == 0)
+            return this->entries_.insert(this->entries_.end(), (ConfigFileEntry*)(new ConfigFileEntryVectorValue(name, index, fallback, bString)));
+        else
+            return this->entries_.insert(++this->getEntryIterator(name, index - 1, "", bString), (ConfigFileEntry*)(new ConfigFileEntryVectorValue(name, index, fallback, bString)));
+    }
+
+
+    ////////////////
+    // ConfigFile //
+    ////////////////
+    ConfigFile::~ConfigFile()
+    {
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); )
+            delete (*(it++));
+    }
+
+    void ConfigFile::load(bool bCreateIfNotExisting)
+    {
+        if (bCreateIfNotExisting)
+        {
+            // This creates the default config file if it's not existing
+            std::ofstream createFile;
+            createFile.open(this->filename_.c_str(), std::fstream::app);
+            createFile.close();
+        }
+
+        // Open the file
+        std::ifstream file;
+        file.open(this->filename_.c_str(), std::fstream::in);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "An error occurred in ConfigFileManager.cc:" << std::endl;
+            COUT(1) << "Error: Couldn't open config-file \"" << this->filename_ << "\"." << std::endl;
+            return;
+        }
+
+        char linearray[CONFIG_FILE_MAX_LINELENGHT];
+
+        ConfigFileSection* newsection = 0;
+
+        while (file.good() && !file.eof())
+        {
+            file.getline(linearray, CONFIG_FILE_MAX_LINELENGHT);
+
+            std::string line = std::string(linearray);
+
+            std::string temp = getStripped(line);
+            if (!isEmpty(temp) && !isComment(temp))
+            {
+                unsigned int   pos1 = temp.find('[');
+                if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
+                unsigned int   pos2 = line.find(']');
+
+                if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
+                {
+                    // New section
+                    std::string comment = line.substr(pos2 + 1);
+                    if (isComment(comment))
+                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
+                    else
+                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
+                    this->sections_.insert(this->sections_.end(), newsection);
+                    continue;
+                }
+            }
+
+            if (newsection != 0)
+            {
+                if (isComment(line))
+                {
+                    // New comment
+                    newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
+                    continue;
+                }
+                else
+                {
+                    unsigned int pos1 = line.find('=');
+
+                    if (pos1 != std::string::npos && pos1 > 0)
+                    {
+                        // New entry
+                        unsigned int pos2 = line.find('[');
+                        unsigned int pos3 = line.find(']');
+                        unsigned int commentposition = getNextCommentPosition(line, pos1 + 1);
+                        while (isBetweenQuotes(line, commentposition))
+                        {
+                            commentposition = getNextCommentPosition(line, commentposition + 1);
+                        }
+                        std::string value = "", comment = "";
+                        if (commentposition == std::string::npos)
+                        {
+                            value = removeTrailingWhitespaces(line.substr(pos1 + 1));
+                        }
+                        else
+                        {
+                            value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
+                            comment = removeTrailingWhitespaces(line.substr(commentposition));
+                        }
+
+                        if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
+                        {
+                            // There might be an array index
+                            unsigned int index = 0;
+                            if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
+                            {
+                                // New array
+                                std::list<ConfigFileEntry*>::iterator it = newsection->getEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
+                                (*it)->setValue(value);
+                                (*it)->setComment(comment);
+                                continue;
+                            }
+                        }
+
+                        // New value
+                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
+                        continue;
+                    }
+                }
+            }
+        }
+
+        file.close();
+
+        COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
+
+        // Save the file in case something changed (like stripped whitespaces)
+        this->save();
+    }
+
+    void ConfigFile::save() const
+    {
+        std::ofstream file;
+        file.open(this->filename_.c_str(), std::fstream::out);
+        file.setf(std::ios::fixed, std::ios::floatfield);
+        file.precision(6);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "An error occurred in ConfigFileManager.cc:" << std::endl;
+            COUT(1) << "Error: Couldn't open config-file \"" << this->filename_ << "\"." << std::endl;
+            return;
+        }
+
+        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+        {
+            file << (*it)->getFileEntry() << std::endl;
+
+            for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
+            {
+                file << (*it_entries)->getFileEntry() << std::endl;
+            }
+
+            file << std::endl;
+        }
+
+        file.close();
+
+        COUT(4) << "Saved config file \"" << this->filename_ << "\"." << std::endl;
+    }
+
+    void ConfigFile::clean(bool bCleanComments)
+    {
+        for (std::list<ConfigFileSection*>::iterator it1 = this->sections_.begin(); it1 != this->sections_.end(); )
+        {
+            std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getIdentifierMap().find((*it1)->getName());
+            if (it2 != Identifier::getIdentifierMapEnd() && (*it2).second->hasConfigValues())
+            {
+                // The section exists, delete comment
+                if (bCleanComments)
+                    (*it1)->setComment("");
+                for (std::list<ConfigFileEntry*>::iterator it3 = (*it1)->entries_.begin(); it3 != (*it1)->entries_.end(); )
+                {
+                    std::map<std::string, ConfigValueContainer*>::const_iterator it4 = (*it2).second->getConfigValueMap().find((*it3)->getName());
+                    if (it4 != (*it2).second->getConfigValueMapEnd())
+                    {
+                        // The config-value exists, delete comment
+                        if (bCleanComments)
+                            (*it3)->setComment("");
+                        ++it3;
+                    }
+                    else
+                    {
+                        // The config-value doesn't exist
+                        delete (*it3);
+                        (*it1)->entries_.erase(it3++);
+                    }
+                }
+                ++it1;
+            }
+            else
+            {
+                // The section doesn't exist
+                delete (*it1);
+                this->sections_.erase(it1++);
+            }
+        }
+
+        // Save the file
+        this->save();
+    }
+
+    ConfigFileSection* ConfigFile::getSection(const std::string& section)
+    {
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+            if ((*it)->getName() == section)
+                return (*it);
+
+        this->bUpdated_ = true;
+
+        return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section)));
+    }
+
+    void ConfigFile::saveIfUpdated()
+    {
+        bool sectionsUpdated = false;
+
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+        {
+            if ((*it)->bUpdated_)
+            {
+                sectionsUpdated = true;
+                (*it)->bUpdated_ = false;
+            }
+        }
+
+        if (this->bUpdated_ || sectionsUpdated)
+        {
+            this->bUpdated_ = false;
+            this->save();
+        }
+    }
+
+
+    ///////////////////////
+    // ConfigFileManager //
+    ///////////////////////
+    ConfigFileManager::ConfigFileManager()
+    {
+        this->setFile(CFT_Settings, DEFAULT_CONFIG_FILE);
+    }
+
+    ConfigFileManager::~ConfigFileManager()
+    {
+        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )
+            delete (*(it++)).second;
+    }
+
+    ConfigFileManager* ConfigFileManager::getSingleton()
+    {
+        static ConfigFileManager instance;
+        return (&instance);
+    }
+
+    void ConfigFileManager::setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting)
+    {
+        std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.find(type);
+        if (it != this->configFiles_.end())
+            if ((*it).second != 0)
+                delete (*it).second;
+
+        this->configFiles_[type] = new ConfigFile(this->getFilePath(filename));
+        this->load(type, bCreateIfNotExisting);
+    }
+
+    void ConfigFileManager::load(bool bCreateIfNotExisting)
+    {
+        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+            (*it).second->load(bCreateIfNotExisting);
+
+        this->updateConfigValues();
+    }
+
+    void ConfigFileManager::save()
+    {
+        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+            (*it).second->save();
+    }
+
+    void ConfigFileManager::clean(bool bCleanComments)
+    {
+        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+            this->clean((*it).first, bCleanComments);
+    }
+
+    void ConfigFileManager::load(ConfigFileType type, bool bCreateIfNotExisting)
+    {
+        this->getFile(type)->load(bCreateIfNotExisting);
+        this->updateConfigValues(type);
+    }
+
+    void ConfigFileManager::save(ConfigFileType type)
+    {
+        this->getFile(type)->save();
+    }
+
+    void ConfigFileManager::clean(ConfigFileType type, bool bCleanComments)
+    {
+        this->getFile(type)->clean(bCleanComments);
+    }
+
+    void ConfigFileManager::updateConfigValues() const
+    {
+        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+            this->updateConfigValues((*it).first);
+    }
+
+    void ConfigFileManager::updateConfigValues(ConfigFileType type) const
+    {
+        if (type == CFT_Settings)
+        {
+            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
+            {
+                if ((*it).second->hasConfigValues() /* && (*it).second != ClassManager<KeyBinder>::getIdentifier()*/)
+                {
+                    for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = (*it).second->getConfigValueMapBegin(); it2 != (*it).second->getConfigValueMapEnd(); ++it2)
+                        (*it2).second->update();
+
+                    (*it).second->updateConfigValues();
+                }
+            }
+        }
+        else if (type == CFT_Keybindings)
+        {
+            // todo
+        }
+    }
+
+    ConfigFile* ConfigFileManager::getFile(ConfigFileType type)
+    {
+        std::map<ConfigFileType, ConfigFile*>::iterator it = this->configFiles_.find(type);
+        if (it != this->configFiles_.end())
+            return (*it).second;
+
+        if (type == CFT_Settings)
+            return this->configFiles_[type] = new ConfigFile(DEFAULT_CONFIG_FILE);
+        else
+            return this->configFiles_[type] = new ConfigFile("");
+    }
+
+    std::string ConfigFileManager::getFilePath(const std::string& name) const
+    {
+        return name;
+    }
+}
Index: code/trunk/src/orxonox/core/ConfigFileManager.h
===================================================================
--- code/trunk/src/orxonox/core/ConfigFileManager.h	(revision 1052)
+++ code/trunk/src/orxonox/core/ConfigFileManager.h	(revision 1052)
@@ -0,0 +1,298 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ConfigFileManager_H__
+#define _ConfigFileManager_H__
+
+#include <iostream>
+#include <string>
+#include <list>
+#include <map>
+
+#include "util/Math.h"
+
+#include "CorePrereqs.h"
+
+#define DEFAULT_CONFIG_FILE "default.ini"
+
+namespace orxonox
+{
+    enum _CoreExport ConfigFileType
+    {
+        CFT_Settings,
+        CFT_Keybindings
+    };
+
+
+    void reloadConfig();
+    void saveConfig();
+    void cleanConfig();
+    void loadSettings(const std::string& filename);
+    void loadKeybindings(const std::string& filename);
+
+
+    /////////////////////
+    // ConfigFileEntry //
+    /////////////////////
+    class _CoreExport ConfigFileEntry
+    {
+        public:
+            virtual void setValue(const std::string& value) = 0;
+            virtual std::string getValue() const = 0;
+            virtual const std::string& getName() const = 0;
+            virtual void setComment(const std::string& comment) = 0;
+            virtual unsigned int getIndex() const { return 0; }
+            virtual void setString(bool bString) = 0;
+            virtual std::string getFileEntry() const = 0;
+    };
+
+
+    //////////////////////////
+    // ConfigFileEntryValue //
+    //////////////////////////
+    class _CoreExport ConfigFileEntryValue : public ConfigFileEntry
+    {
+        public:
+            inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : name_(name), value_(value), bString_(bString), additionalComment_(additionalComment) {}
+            inline virtual ~ConfigFileEntryValue() {}
+
+            inline virtual const std::string& getName() const
+                { return this->name_; }
+
+            inline virtual void setComment(const std::string& comment)
+                { this->additionalComment_ = comment; }
+
+            virtual void setValue(const std::string& value);
+            virtual std::string getValue() const;
+
+            inline bool isString() const
+                { return this->bString_; }
+            inline void setString(bool bString)
+                { this->bString_ = bString; }
+
+            virtual std::string getFileEntry() const;
+
+        protected:
+            std::string name_;
+            std::string value_;
+            bool bString_;
+            std::string additionalComment_;
+    };
+
+
+    ///////////////////////////////
+    // ConfigFileEntryVectorValue //
+    ///////////////////////////////
+    class _CoreExport ConfigFileEntryVectorValue : public ConfigFileEntryValue
+    {
+        public:
+            inline ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : ConfigFileEntryValue(name, value, bString, additionalComment), index_(index) {}
+            inline virtual ~ConfigFileEntryVectorValue() {}
+
+            inline virtual unsigned int getIndex() const
+                { return this->index_; }
+
+            virtual std::string getFileEntry() const;
+
+        private:
+            unsigned int index_;
+    };
+
+
+    ////////////////////////////
+    // ConfigFileEntryComment //
+    ////////////////////////////
+    class _CoreExport ConfigFileEntryComment : public ConfigFileEntry
+    {
+        public:
+            inline ConfigFileEntryComment(const std::string& comment) : comment_(comment) {}
+            inline virtual ~ConfigFileEntryComment() {}
+
+            inline virtual const std::string& getName() const
+                { return this->comment_; }
+
+            inline virtual void setComment(const std::string& comment)
+                { this->comment_ = comment; }
+
+            inline virtual void setValue(const std::string& value)
+                {}
+            inline virtual std::string getValue() const
+                { return this->comment_; }
+
+            inline void setString(bool bString) {}
+
+            inline virtual std::string getFileEntry() const
+                { return this->comment_; }
+
+        private:
+            std::string comment_;
+    };
+
+
+    ///////////////////////
+    // ConfigFileSection //
+    ///////////////////////
+    class _CoreExport ConfigFileSection
+    {
+        friend class ConfigFile;
+
+        public:
+            inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "") : name_(name), additionalComment_(additionalComment), bUpdated_(false) {}
+            ~ConfigFileSection();
+
+            inline const std::string& getName() const
+                { return this->name_; }
+
+            inline void setComment(const std::string& comment)
+                { this->additionalComment_ = comment; }
+
+            inline void setValue(const std::string& name, const std::string& value, bool bString)
+                { this->getEntry(name, value, bString)->setValue(value); }
+            inline std::string getValue(const std::string& name, const std::string& fallback, bool bString)
+                { return this->getEntry(name, fallback, bString)->getValue(); }
+
+            inline void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)
+                { this->getEntry(name, index, value, bString)->setValue(value); }
+            inline std::string getValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { return this->getEntry(name, index, fallback, bString)->getValue(); }
+
+            void deleteVectorEntries(const std::string& name, unsigned int startindex = 0);
+            unsigned int getVectorSize(const std::string& name);
+
+            std::string getFileEntry() const;
+
+        private:
+            std::list<ConfigFileEntry*>& getEntries()
+                { return this->entries_; }
+            std::list<ConfigFileEntry*>::const_iterator getEntriesBegin() const
+                { return this->entries_.begin(); }
+            std::list<ConfigFileEntry*>::const_iterator getEntriesEnd() const
+                { return this->entries_.end(); }
+
+            std::list<ConfigFileEntry*>::iterator getEntryIterator(const std::string& name, const std::string& fallback, bool bString);
+            std::list<ConfigFileEntry*>::iterator getEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString);
+
+            inline ConfigFileEntry* getEntry(const std::string& name, const std::string& fallback, bool bString)
+                { return (*this->getEntryIterator(name, fallback, bString)); }
+            inline ConfigFileEntry* getEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { return (*this->getEntryIterator(name, index, fallback, bString)); }
+
+            std::string name_;
+            std::string additionalComment_;
+            std::list<ConfigFileEntry*> entries_;
+            bool bUpdated_;
+    };
+
+
+    ////////////////
+    // ConfigFile //
+    ////////////////
+    class _CoreExport ConfigFile
+    {
+        public:
+            inline ConfigFile(const std::string& filename) : filename_(filename), bUpdated_(false) {}
+            ~ConfigFile();
+
+            void load(bool bCreateIfNotExisting = true);
+            void save() const;
+            void clean(bool bCleanComments = false);
+
+            inline void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)
+                { this->getSection(section)->setValue(name, value, bString); this->save(); }
+            inline std::string getValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
+                { std::string output = this->getSection(section)->getValue(name, fallback, bString); this->saveIfUpdated(); return output; }
+
+            inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
+                { this->getSection(section)->setValue(name, index, value, bString); this->save(); }
+            inline std::string getValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { std::string output = this->getSection(section)->getValue(name, index, fallback, bString); this->saveIfUpdated(); return output; }
+
+            inline void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0)
+                { this->getSection(section)->deleteVectorEntries(name, startindex); }
+            inline unsigned int getVectorSize(const std::string& section, const std::string& name)
+                { return this->getSection(section)->getVectorSize(name); }
+
+        private:
+            ConfigFileSection* getSection(const std::string& section);
+            void saveIfUpdated();
+
+            std::string filename_;
+            std::list<ConfigFileSection*> sections_;
+            bool bUpdated_;
+    };
+
+
+    ///////////////////////
+    // ConfigFileManager //
+    ///////////////////////
+    class _CoreExport ConfigFileManager
+    {
+        public:
+            static ConfigFileManager* getSingleton();
+
+            void setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting = true);
+
+            void load(bool bCreateIfNotExisting = true);
+            void save();
+            void clean(bool bCleanComments = false);
+
+            void load(ConfigFileType type, bool bCreateIfNotExisting = true);
+            void save(ConfigFileType type);
+            void clean(ConfigFileType type, bool bCleanComments = false);
+
+            inline void setValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& value, bool bString)
+                { this->getFile(type)->setValue(section, name, value, bString); }
+            inline std::string getValue(ConfigFileType type, const std::string& section, const std::string& name, const std::string& fallback, bool bString)
+                { return this->getFile(type)->getValue(section, name, fallback, bString); }
+
+            inline void setValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
+                { this->getFile(type)->setValue(section, name, index, value, bString); }
+            inline std::string getValue(ConfigFileType type, const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { return this->getFile(type)->getValue(section, name, index, fallback, bString); }
+
+            inline void deleteVectorEntries(ConfigFileType type, const std::string& section, const std::string& name, unsigned int startindex = 0)
+                { this->getFile(type)->deleteVectorEntries(section, name, startindex); }
+            inline unsigned int getVectorSize(ConfigFileType type, const std::string& section, const std::string& name)
+                { return this->getFile(type)->getVectorSize(section, name); }
+
+            void updateConfigValues() const;
+            void updateConfigValues(ConfigFileType type) const;
+
+        private:
+            ConfigFileManager();
+            ConfigFileManager(const ConfigFileManager& other) {}
+            ~ConfigFileManager();
+
+            ConfigFile* getFile(ConfigFileType type);
+
+            std::string getFilePath(const std::string& name) const;
+
+            std::map<ConfigFileType, ConfigFile*> configFiles_;
+    };
+}
+
+#endif /* _ConfigFileManager_H__ */
Index: code/trunk/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- code/trunk/src/orxonox/core/ConfigValueContainer.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/ConfigValueContainer.cc	(revision 1052)
@@ -34,9 +34,11 @@
 
 #include "ConfigValueContainer.h"
-#include "util/Tokenizer.h"
+#include "Language.h"
+#include "Identifier.h"
+#include "util/SubString.h"
 #include "util/Convert.h"
-#include "Language.h"
-
-#define CONFIGFILEPATH "orxonox.ini"
+
+#define MAX_VECTOR_INDEX 255 // to avoid up to 4*10^9 vector entries in the config file after accidentally using a wrong argument
+
 
 namespace orxonox
@@ -44,134 +46,219 @@
     /**
         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
-        @param value This is only needed to determine the right type.
-        @param classname The name of the class the variable belongs to
+        @param type The type of the corresponding config-file
+        @param identifier The identifier of the class the variable belongs to
         @param varname The name of the variable
         @param defvalue The default-value
     */
-    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, MultiTypeMath defvalue)
-    {
+    ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue)
+    {
+        this->type_ = type;
+        this->identifier_ = identifier;
+        this->sectionname_ = identifier->getName();
+        this->varname_ = varname;
+
+        this->value_ = defvalue;
         this->bAddedDescription_ = false;
-        this->classname_ = classname;
+        this->bIsVector_ = false;
+
+        this->defvalueString_ = defvalue.toString();
+        this->update();
+    }
+
+    /**
+        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
+        @param type The type of the corresponding config-file
+        @param identifier The identifier of the class the variable belongs to
+        @param varname The name of the variable
+        @param defvalue The default-value
+    */
+    ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue)
+    {
+        this->type_ = type;
+        this->identifier_ = identifier;
+        this->sectionname_ = identifier->getName();
         this->varname_ = varname;
 
-        this->valueToString(&this->defvalueString_, defvalue);                      // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                               // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString(!(defvalue.isA(MT_string) || defvalue.isA(MT_constchar)));     // Parses the value string from the config-file-entry
-        if (!this->parseString(valueString, defvalue))                              // Try to convert the string to a value
-            this->resetConfigFileEntry();                                           // The conversion failed
-    }
-
-    /**
-        @brief Converts a value to a string.
-        @param output The string to write to
-        @param input The value to convert
-        @return True if the converson was successful
-    */
-    bool ConfigValueContainer::valueToString(std::string* output, MultiTypeMath& input)
-    {
-        if (input.getType() == MT_int)
-            return ConvertValue(output, input.getInt(), std::string("0"));
-        else if (input.getType() == MT_uint)
-            return ConvertValue(output, input.getUnsignedInt(), std::string("0"));
-        else if (input.getType() == MT_char)
-            return ConvertValue(output, (int)input.getChar(), std::string("0"));
-        else if (input.getType() == MT_uchar)
-            return ConvertValue(output, (unsigned int)input.getUnsignedChar(), std::string("0"));
-        else if (input.getType() == MT_short)
-            return ConvertValue(output, input.getShort(), std::string("0"));
-        else if (input.getType() == MT_ushort)
-            return ConvertValue(output, input.getUnsignedShort(), std::string("0"));
-        else if (input.getType() == MT_long)
-            return ConvertValue(output, input.getLong(), std::string("0"));
-        else if (input.getType() == MT_ulong)
-            return ConvertValue(output, input.getUnsignedLong(), std::string("0"));
-        else if (input.getType() == MT_float)
-            return ConvertValue(output, input.getFloat(), std::string("0.000000"));
-        else if (input.getType() == MT_double)
-            return ConvertValue(output, input.getDouble(), std::string("0.000000"));
-        else if (input.getType() == MT_longdouble)
-            return ConvertValue(output, input.getChar(), std::string("0.000000"));
-        else if (input.getType() == MT_bool)
-        {
-            if (input.getBool())
-                (*output) = "true";
+        this->valueVector_ = defvalue;
+        this->bAddedDescription_ = false;
+        this->bIsVector_ = true;
+
+        if (defvalue.size() > 0)
+            this->value_ = defvalue[0];
+
+        for (unsigned int i = 0; i < defvalue.size(); i++)
+            ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string));
+
+        for (unsigned int i = 0; i < defvalue.size(); i++)
+            this->defvalueStringVector_.push_back(defvalue[i].toString());
+
+        this->update();
+    }
+
+    /**
+        @brief Adds a new entry to the end of the vector.
+        @param input The new entry
+        @return True if the new entry was successfully added
+    */
+    bool ConfigValueContainer::add(const std::string& input)
+    {
+        if (this->bIsVector_)
+            return this->set(this->valueVector_.size(), input);
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
+    }
+
+    /**
+        @brief Removes an existing entry from the vector.
+        @param index The index of the entry
+        @return True if the entry was removed
+    */
+    bool ConfigValueContainer::remove(unsigned int index)
+    {
+        if (this->bIsVector_)
+        {
+            if (index < this->valueVector_.size())
+            {
+                this->valueVector_.erase(this->valueVector_.begin() + index);
+                for (unsigned int i = index; i < this->valueVector_.size(); i++)
+                    ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
+                ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
+
+                return true;
+            }
+            COUT(1) << "Error: Invalid vector-index." << std::endl;
+        }
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::set(const std::string& input)
+    {
+        if (this->bIsVector_)
+        {
+            SubString token(input, " ", "", true, '"', false, '(', ')', false, '\0');
+            int index = -1;
+            bool success = false;
+
+            if (token.size() > 0)
+                success = ConvertValue(&index, token[0]);
+
+            if (!success || index < 0 || index > MAX_VECTOR_INDEX)
+            {
+                if (!success)
+                {
+                    COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << std::endl;
+                }
+                else
+                {
+                    COUT(1) << "Error: Invalid vector-index." << std::endl;
+                }
+                return false;
+            }
+
+            if (token.size() >= 2)
+                return this->set(index, token.subSet(1).join());
             else
-                (*output) = "false";
-
-            return true;
-        }
-        else if (input.getType() == MT_constchar)
-        {
-            (*output) = "\"" + input.getString() + "\"";
-            return true;
-        }
-        else if (input.getType() == MT_string)
-        {
-            (*output) = "\"" + input.getString() + "\"";
-            return true;
-        }
-        else if (input.getType() == MT_vector2)
-        {
-            std::ostringstream ostream;
-            if (ostream << "(" << input.getVector2().x << "," << input.getVector2().y << ")")
-            {
-                (*output) = ostream.str();
-                return true;
-            }
-            else
-            {
-                (*output) = "(0,0)";
-                return false;
-            }
-        }
-        else if (input.getType() == MT_vector3)
-        {
-            std::ostringstream ostream;
-            if (ostream << "(" << input.getVector3().x << "," << input.getVector3().y << "," << input.getVector3().z << ")")
-            {
-                (*output) = ostream.str();
-                return true;
-            }
-            else
-            {
-                (*output) = "(0,0,0)";
-                return false;
-            }
-        }
-        else if (input.getType() == MT_colourvalue)
-        {
-            std::ostringstream ostream;
-            if (ostream << "(" << input.getColourValue().r << "," << input.getColourValue().g << "," << input.getColourValue().b << "," << input.getColourValue().a << ")")
-            {
-                (*output) = ostream.str();
-                return true;
-            }
-            else
-            {
-                (*output) = "(0,0,0,0)";
-                return false;
-            }
-        }
-        else if (input.getType() == MT_quaternion)
-        {
-            std::ostringstream ostream;
-            if (ostream << "(" << input.getQuaternion().w << "," << input.getQuaternion().x << "," << input.getQuaternion().y << "," << input.getQuaternion().z << ")")
-            {
-                (*output) = ostream.str();
-                return true;
-            }
-            else
-            {
-                (*output) = "(0,0,0,0)";
-                return false;
-            }
-        }
-        else if (input.getType() == MT_radian)
-            return ConvertValue(output, input.getRadian(), std::string("0.000000"));
-        else if (input.getType() == MT_degree)
-            return ConvertValue(output, input.getDegree(), std::string("0.000000"));
-
-        return false;
+                return this->set(index, "");
+        }
+
+        bool success = this->tset(input);
+        ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isA(MT_string));
+        return success;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
+        @param index The index in the vector
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::set(unsigned int index, const std::string& input)
+    {
+        if (this->bIsVector_)
+        {
+            bool success = this->tset(index, input);
+            ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isA(MT_string));
+            return success;
+        }
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::tset(const std::string& input)
+    {
+        bool success = this->parse(input);
+        if (this->identifier_)
+            this->identifier_->updateConfigValues();
+        return success;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
+        @param index The index in the vector
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::tset(unsigned int index, const std::string& input)
+    {
+        if (this->bIsVector_)
+        {
+            bool success = this->parse(index, input);
+            if (this->identifier_)
+                this->identifier_->updateConfigValues();
+            return success;
+        }
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
+    }
+
+    /**
+        @brief Sets the value of the variable back to the default value and resets the config-file entry.
+    */
+    bool ConfigValueContainer::reset()
+    {
+        if (!this->bIsVector_)
+            return this->set(this->defvalueString_);
+        else
+        {
+            bool success = true;
+            for (unsigned int i = 0; i < this->defvalueStringVector_.size(); i++)
+                if (!this->set(i, this->defvalueStringVector_[i]))
+                    success = false;
+            ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->defvalueStringVector_.size());
+            return success;
+        }
+    }
+
+    /**
+        @brief Retrieves the configured value from the currently loaded config-file.
+    */
+    void ConfigValueContainer::update()
+    {
+        if (!this->bIsVector_)
+            this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));
+        else
+        {
+            this->valueVector_.clear();
+            for (unsigned int i = 0; i < ConfigFileManager::getSingleton()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
+            {
+                this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));
+                this->valueVector_.push_back(this->value_);
+            }
+        }
     }
 
@@ -181,760 +268,110 @@
         @return True if the string was successfully parsed
     */
-    bool ConfigValueContainer::parseString(const std::string& input, MultiTypeMath& defvalue)
-    {
-        if (defvalue.getType() == MT_int)
-            return this->parseString(input, defvalue.getInt());
-        else if (defvalue.getType() == MT_uint)
-            return this->parseString(input, defvalue.getUnsignedInt());
-        else if (defvalue.getType() == MT_char)
-            return this->parseString(input, defvalue.getChar());
-        else if (defvalue.getType() == MT_uchar)
-            return this->parseString(input, defvalue.getUnsignedChar());
-        else if (defvalue.getType() == MT_short)
-            return this->parseString(input, defvalue.getShort());
-        else if (defvalue.getType() == MT_ushort)
-            return this->parseString(input, defvalue.getUnsignedShort());
-        else if (defvalue.getType() == MT_long)
-            return this->parseString(input, defvalue.getLong());
-        else if (defvalue.getType() == MT_ulong)
-            return this->parseString(input, defvalue.getUnsignedLong());
-        else if (defvalue.getType() == MT_float)
-            return this->parseString(input, defvalue.getFloat());
-        else if (defvalue.getType() == MT_double)
-            return this->parseString(input, defvalue.getDouble());
-        else if (defvalue.getType() == MT_longdouble)
-            return this->parseString(input, defvalue.getLongDouble());
-        else if (defvalue.getType() == MT_bool)
-            return this->parseString(input, defvalue.getBool());
-        else if (defvalue.getType() == MT_constchar)
-            return this->parseString(input, defvalue.getString());
-        else if (defvalue.getType() == MT_string)
-            return this->parseString(input, defvalue.getString());
-        else if (defvalue.getType() == MT_vector2)
-            return this->parseString(input, defvalue.getVector2());
-        else if (defvalue.getType() == MT_vector3)
-            return this->parseString(input, defvalue.getVector3());
-        else if (defvalue.getType() == MT_colourvalue)
-            return this->parseString(input, defvalue.getColourValue());
-        else if (defvalue.getType() == MT_quaternion)
-            return this->parseString(input, defvalue.getQuaternion());
-        else if (defvalue.getType() == MT_radian)
-            return this->parseString(input, defvalue.getRadian());
-        else if (defvalue.getType() == MT_degree)
-            return this->parseString(input, defvalue.getDegree());
-
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type int and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, int defvalue)
-    {
-        int temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type unsigned int and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, unsigned int defvalue)
-    {
-        unsigned int temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type char and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, char defvalue)
-    {
-        // I used value_int_ instead of value_char_ to avoid number <-> char confusion in the config-file
-        int temp;
-        bool success = ConvertValue(&temp, input, (int)defvalue);
-        this->value_.setValue((char)temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type unsigned char and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, unsigned char defvalue)
-    {
-        // I used value_uint_ instead of value_uchar_ to avoid number <-> char confusion in the config-file
-        unsigned int temp;
-        bool success = ConvertValue(&temp, input, (unsigned int)defvalue);
-        this->value_.setValue((unsigned char)temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type short and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, short defvalue)
-    {
-        short temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type unsigned short and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, unsigned short defvalue)
-    {
-        unsigned short temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type long and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, long defvalue)
-    {
-        long temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type unsigned long and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, unsigned long defvalue)
-    {
-        unsigned long temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type float and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, float defvalue)
-    {
-        float temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, double defvalue)
-    {
-        double temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type long double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, long double defvalue)
-    {
-        long double temp;
-        bool success = ConvertValue(&temp, input, defvalue);
-        this->value_.setValue(temp);
-        return success;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type bool and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, bool defvalue)
-    {
-        // Try to parse the value-string - is it a word?
-        if (input.find("true") < input.size()
-         || input.find("True") < input.size()
-         || input.find("yes") < input.size()
-         || input.find("Yes") < input.size())
-            this->value_.setValue(true);
-        else if (input.find("false") < input.size()
-              || input.find("False") < input.size()
-              || input.find("no") < input.size()
-              || input.find("No") < input.size())
-            this->value_.setValue(false);
-        else
-        {
-            // Its not a known word - is it a number?
-            bool temp;
-            bool success = ConvertValue(&temp, input, defvalue);
-            this->value_.setValue(temp);
-            return success;
-        }
-
-        return true;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type std::string and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const std::string& defvalue)
-    {
-        // Strip the quotes
-        unsigned int pos1 = input.find("\"") + 1;
-        unsigned int pos2 = input.find("\"", pos1);
-
-        // Check if the entry was correctly quoted
-        if (pos1 < input.length() && pos2 < input.length() && !(input.find("\"", pos2 + 1) < input.length()))
-        {
-            // It was - get the string between the quotes
-            this->value_.setValue(input.substr(pos1, pos2 - pos1));
-            return true;
-        }
-
-        // It wasn't - use the default-value and restore the entry in the config-file.
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type const char* and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const char* defvalue)
-    {
-        // Strip the quotes
-        unsigned int pos1 = input.find("\"") + 1;
-        unsigned int pos2 = input.find("\"", pos1);
-
-        // Check if the entry was correctly quoted
-        if (pos1 < input.length() && pos2 < input.length() && !(input.find("\"", pos2 + 1) < input.length()))
-        {
-            // It was - get the string between the quotes
-            this->value_.setValue(input.substr(pos1, pos2 - pos1));
-            return true;
-        }
-
-        // It wasn't - use the default-value and restore the entry in the config-file.
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type _Vector2 and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const Vector2& defvalue)
-    {
-        // Strip the value-string
-        unsigned int pos1 = input.find("(") + 1;
-        unsigned int pos2 = input.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector2
-        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
-        {
-            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
-            if (!ConvertValue(&this->value_.getVector2().x, tokens[0]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getVector2().y, tokens[1]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-
-            return true;
-        }
-
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type Vector3 and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const Vector3& defvalue)
-    {
-        // Strip the value-string
-        unsigned int pos1 = input.find("(") + 1;
-        unsigned int pos2 = input.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector3
-        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
-        {
-            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
-            if (!ConvertValue(&this->value_.getVector3().x, tokens[0]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getVector3().y, tokens[1]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getVector3().z, tokens[2]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-
-            return true;
-        }
-
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type ColourValue and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const ColourValue& defvalue)
-    {
-        // Strip the value-string
-        unsigned int pos1 = input.find("(") + 1;
-        unsigned int pos2 = input.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector3
-        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
-        {
-            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
-            if (!ConvertValue(&this->value_.getColourValue().r, tokens[0]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getColourValue().g, tokens[1]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getColourValue().b, tokens[2]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getColourValue().a, tokens[3]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-
-            return true;
-        }
-
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type Quaternion and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const Quaternion& defvalue)
-    {
-        // Strip the value-string
-        unsigned int pos1 = input.find("(") + 1;
-        unsigned int pos2 = input.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector3
-        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
-        {
-            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
-            if (!ConvertValue(&this->value_.getQuaternion().w, tokens[0]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getQuaternion().x, tokens[1]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getQuaternion().y, tokens[2]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-            if (!ConvertValue(&this->value_.getQuaternion().z, tokens[3]))
-            {
-                this->value_.setValue(defvalue);
-                return false;
-            }
-
-            return true;
-        }
-
-        this->value_.setValue(defvalue);
-        return false;
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type long double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const Radian& defvalue)
-    {
-        return ConvertValue(&this->value_.getRadian(), input, defvalue);
-    }
-
-    /**
-        @brief Parses a given std::string into a value of the type long double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.
-        @param input The string to convert
-        @param defvalue The default-value
-        @return True if the string was successfully parsed
-    */
-    bool ConfigValueContainer::parseString(const std::string& input, const Degree& defvalue)
-    {
-        return ConvertValue(&this->value_.getDegree(), input, defvalue);
-    }
-
-    /**
-        @brief Sets the corresponding entry in the config-file back to the default value.
-    */
-    void ConfigValueContainer::resetConfigFileEntry()
-    {
-        (*this->configFileLine_) = this->varname_ + "=" + this->defvalueString_;
-        ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);
-    }
-
-    /**
-        @brief Sets the value of the variable back to the default value and resets the config-file entry.
-    */
-    void ConfigValueContainer::resetConfigValue()
-    {
-        this->parseString(this->defvalueString_, this->value_);
-        this->resetConfigFileEntry();
-    }
-
-    /**
-        @brief Searches the corresponding entry in the config-file and creates it, if there is no entry.
-    */
-    void ConfigValueContainer::searchConfigFileLine()
-    {
-        // Read the file if needed
-        if (!ConfigValueContainer::finishedReadingConfigFile())
-            ConfigValueContainer::readConfigFile(CONFIGFILEPATH);
-
-        // The string of the section we're searching
-        std::string section = "";
-        section.append("[");
-        section.append(this->classname_);
-        section.append("]");
-
-        // Iterate through all config-file-lines
-        bool success = false;
-        std::list<std::string>::iterator it1;
-        for(it1 = ConfigValueContainer::getConfigFileLines().begin(); it1 != ConfigValueContainer::getConfigFileLines().end(); ++it1)
-        {
-            // Don't try to parse comments
-            if (this->isComment(*it1))
-                continue;
-
-            if ((*it1).find(section) < (*it1).length())
-            {
-                // We found the right section
-                bool bLineIsEmpty = false;
-                std::list<std::string>::iterator positionToPutNewLineAt;
-
-                // Iterate through all lines in the section
-                std::list<std::string>::iterator it2;
-                for(it2 = ++it1; it2 != ConfigValueContainer::getConfigFileLines().end(); ++it2)
-                {
-                    // Don't try to parse comments
-                    if (this->isComment(*it2))
-                        continue;
-
-                    // This if-else block is used to write a new line right after the last line of the
-                    // section but in front of the following empty lines before the next section.
-                    // (So this helps to keep a nice formatting with empty-lines between sections in the config-file)
-                    if (this->isEmpty(*it2))
-                    {
-                        if (!bLineIsEmpty)
-                        {
-                            bLineIsEmpty = true;
-                            positionToPutNewLineAt = it2;
-                        }
-                    }
-                    else
-                    {
-                        if (!bLineIsEmpty)
-                            positionToPutNewLineAt = it2;
-
-                        bLineIsEmpty = false;
-                    }
-
-                    // Look out for the beginning of the next section
-                    unsigned int open = (*it2).find("[");
-                    unsigned int close = (*it2).find("]");
-                    if ((open < (*it2).length()) && (close < (*it2).length()) && (open < close))
-                    {
-                        // The next section startet, so our line isn't yet in the file - now we add it and safe the file
-                        this->configFileLine_ = this->getConfigFileLines().insert(positionToPutNewLineAt, this->varname_ + "=" + this->defvalueString_);
-                        ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);
-                        success = true;
-                        break;
-                    }
-
-                    // Look out for the variable-name
-                    if ((*it2).find(this->varname_) < (*it2).length())
-                    {
-                        // We found the right line - safe it and return
-                        this->configFileLine_ = it2;
-                        success = true;
-                        break;
-                    }
-                }
-
-                // Check if we succeeded
+    bool ConfigValueContainer::parse(const std::string& input)
+    {
+        if (this->bIsVector_)
+        {
+            SubString token(input, " ", "", true, '"', false, '(', ')', false, '\0');
+            int index = -1;
+            bool success = false;
+
+            if (token.size() > 0)
+                success = ConvertValue(&index, token[0]);
+
+            if (!success || index < 0 || index > MAX_VECTOR_INDEX)
+            {
                 if (!success)
                 {
-                    // Looks like we found the right section, but the file ended without containing our variable - so we add it and safe the file
-                    this->configFileLine_ = this->getConfigFileLines().insert(positionToPutNewLineAt, this->varname_ + "=" + this->defvalueString_);
-                    ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);
-                    success = true;
+                    COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << std::endl;
                 }
-                break;
-            }
-        }
-
-        // Check if we succeeded
-        if (!success)
-        {
-            // We obviously didn't found the right section, so we'll create it
-            this->getConfigFileLines().push_back("[" + this->classname_ + "]");                   // Create the section
-            this->getConfigFileLines().push_back(this->varname_ + "=" + this->defvalueString_);   // Create the line
-            this->configFileLine_ = --this->getConfigFileLines().end();                           // Set the pointer to the last element
-            success = true;
-            this->getConfigFileLines().push_back("");                                             // Add an empty line - this is needed for the algorithm in the searchConfigFileLine-function
-            ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);                              // Save the changed config-file
-        }
-    }
-
-    /**
-        @brief Determines if a line in the config-file is a comment.
-        @param line The line to check
-        @return True = it's a comment
-    */
-    bool ConfigValueContainer::isComment(const std::string& line)
-    {
-        // Strip the line, whitespaces are disturbing
-        std::string teststring = getStrippedLine(line);
-
-        // There are four possible comment-symbols:
-        //  1) #comment in script-language style
-        //  2) %comment in matlab style
-        //  3) ;comment in unreal tournament config-file style
-        //  4) //comment in code style
-        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[0] == '/'))
+                else
+                {
+                    COUT(1) << "Error: Invalid vector-index." << std::endl;
+                }
+                return false;
+            }
+
+            if (token.size() >= 2)
+                return this->parse(index, token.subSet(1).join());
+            else
+                return this->parse(index, "");
+        }
+
+        MultiTypeMath temp = this->value_;
+        if (temp.fromString(input))
+        {
+            this->value_ = temp;
             return true;
-
-        return false;
-    }
-
-    /**
-        @brief Determines if a line in the config-file is empty (contains only whitespaces).
-        @param line The line to check
-        @return True = it's empty
-    */
-    bool ConfigValueContainer::isEmpty(const std::string& line)
-    {
-        return getStrippedLine(line) == "";
-    }
-
-    /**
-        @brief Removes all whitespaces from a line.
-        @param line The line to strip
-        @return The stripped line
-    */
-    std::string ConfigValueContainer::getStrippedLine(const std::string& line)
-    {
-        std::string output = line;
-        unsigned int pos;
-        while ((pos = output.find(" ")) < output.length())
-            output.erase(pos, 1);
-        while ((pos = output.find("\t")) < output.length())
-            output.erase(pos, 1);
-
-        return output;
-    }
-
-    /**
-        @brief Returns the part in the corresponding config-file-entry of the container that defines the value.
-        @param bStripped True = strip the value-string
-        @return The value-string
-    */
-    std::string ConfigValueContainer::parseValueString(bool bStripped)
-    {
-        std::string output;
-        if (bStripped)
-            output = this->getStrippedLine(*this->configFileLine_);
-        else
-            output = *this->configFileLine_;
-
-        return output.substr(output.find("=") + 1);
-    }
-
-    /**
-        @brief Rreturns a list, containing all entrys in the config-file.
-        @return The list
-    */
-    std::list<std::string>& ConfigValueContainer::getConfigFileLines()
-    {
-        // This is done to avoid problems while executing this code before main()
-        static std::list<std::string> configFileLinesStaticReference = std::list<std::string>();
-        return configFileLinesStaticReference;
-    }
-
-    /**
-        @brief Returns true if the ConfigFile is read and stored into the ConfigFile-lines-list.
-        @param finished This is used to change the state
-        @return True if the ConfigFile is read and stored into the ConfigFile-lines-list
-    */
-    bool ConfigValueContainer::finishedReadingConfigFile(bool finished)
-    {
-        // This is done to avoid problems while executing this code before main()
-        static bool finishedReadingConfigFileStaticVariable = false;
-
-        if (finished)
-            finishedReadingConfigFileStaticVariable = true;
-
-        return finishedReadingConfigFileStaticVariable;
-    }
-
-    /**
-        @brief Reads the config-file and stores the lines in a list.
-        @param filename The name of the config-file
-    */
-    void ConfigValueContainer::readConfigFile(const std::string& filename)
-    {
-        // This creates the file if it's not existing
-        std::ofstream createFile;
-        createFile.open(filename.c_str(), std::fstream::app);
-        createFile.close();
-
-        // Open the file
-        std::ifstream file;
-        file.open(filename.c_str(), std::fstream::in);
-
-        if (!file.is_open())
-        {
-            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open config-file " << filename << " to read the config values!" << std::endl;
-            return;
-        }
-
-        char line[1024];
-
-        // Iterate through the file and add the lines into the list
-        while (file.good() && !file.eof())
-        {
-            file.getline(line, 1024);
-            ConfigValueContainer::getConfigFileLines().push_back(line);
-//            std::cout << "### ->" << line << "<- : empty: " << isEmpty(line) << " comment: " << isComment(line) << std::endl;
-        }
-
-        // The last line is useless
-        ConfigValueContainer::getConfigFileLines().pop_back();
-
-        // Add an empty line to the end of the file if needed
-        // this is needed for the algorithm in the searchConfigFileLine-function
-        if ((ConfigValueContainer::getConfigFileLines().size() > 0) && !isEmpty(*ConfigValueContainer::getConfigFileLines().rbegin()))
-        {
-//            std::cout << "### newline added" << std::endl;
-            ConfigValueContainer::getConfigFileLines().push_back("");
-        }
-
-        file.close();
-
-        ConfigValueContainer::finishedReadingConfigFile(true);
-    }
-
-    /**
-        @brief Writes the content of the list, containing all lines of the config-file, into the config-file.
-        @param filename The name of the config-file
-    */
-    void ConfigValueContainer::writeConfigFile(const std::string& filename)
-    {
-        // Make sure we stored the config-file in the list
-        if (!ConfigValueContainer::finishedReadingConfigFile())
-            ConfigValueContainer::readConfigFile(filename);
-
-        // Open the file
-        std::ofstream file;
-        file.open(filename.c_str(), std::fstream::out);
-
-        if (!file.is_open())
-        {
-            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open config-file " << filename << " to write the config values!" << std::endl;
-            return;
-        }
-
-        // Iterate through the list an write the lines into the file
-        std::list<std::string>::iterator it;
-        for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it)
-        {
-            file << (*it) << std::endl;
-        }
-
-        file.close();
+        }
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type of the associated variable and assigns it.
+        @param index The index in the vector
+        @param input The string to convert
+        @return True if the string was successfully parsed
+    */
+    bool ConfigValueContainer::parse(unsigned int index, const std::string& input)
+    {
+        if (this->bIsVector_)
+        {
+            if (index >= this->valueVector_.size())
+            {
+                for (unsigned int i = this->valueVector_.size(); i <= index; i++)
+                {
+                    this->valueVector_.push_back(MultiTypeMath());
+                    ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
+                }
+            }
+
+            MultiTypeMath temp = this->value_;
+            if (temp.fromString(input))
+            {
+                this->valueVector_[index] = temp;
+                return true;
+            }
+            return false;
+        }
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type of the associated variable and assigns it.
+        @param input The string to convert
+        @param defvalue The default value to assign if the parsing fails
+        @return True if the string was successfully parsed
+    */
+    bool ConfigValueContainer::parse(const std::string& input, const MultiTypeMath& defvalue)
+    {
+        if (this->parse(input))
+            return true;
+
+        this->value_ = defvalue;
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type of the associated variable and assigns it.
+        @param index The index in the vector
+        @param input The string to convert
+        @param defvalue The default value to assign if the parsing fails
+        @return True if the string was successfully parsed
+    */
+    bool ConfigValueContainer::parse(unsigned int index, const std::string& input, const MultiTypeMath& defvalue)
+    {
+        if (this->bIsVector_)
+        {
+            if (this->parse(index, input))
+                return true;
+
+            this->valueVector_[index] = defvalue;
+            return false;
+        }
+
+        COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
+        return false;
     }
 
@@ -947,5 +384,5 @@
         if (!this->bAddedDescription_)
         {
-            this->description_ = std::string("ConfigValueDescription::" + this->classname_ + "::" + this->varname_);
+            this->description_ = std::string("ConfigValueDescription::" + this->identifier_->getName() + "::" + this->varname_);
             AddLanguageEntry(this->description_, description);
             this->bAddedDescription_ = true;
Index: code/trunk/src/orxonox/core/ConfigValueContainer.h
===================================================================
--- code/trunk/src/orxonox/core/ConfigValueContainer.h	(revision 1051)
+++ code/trunk/src/orxonox/core/ConfigValueContainer.h	(revision 1052)
@@ -43,6 +43,6 @@
 #define _ConfigValueContainer_H__
 
-#include <list>
 #include <string>
+#include <vector>
 
 #include "CorePrereqs.h"
@@ -50,4 +50,5 @@
 #include "util/Math.h"
 #include "util/MultiTypeMath.h"
+#include "ConfigFileManager.h"
 
 namespace orxonox
@@ -72,83 +73,67 @@
     {
         public:
-            ConfigValueContainer(const std::string& classname, const std::string& varname, MultiTypeMath defvalue);
+            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue);
+            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue);
 
             /** @brief Returns the configured value. @param value This is only needed to determine the right type. @return The value */
-/*            template <typename T>
-            inline ConfigValueContainer& getValue(T& value)                           { this->value_.getValue(value); return *this; }
-*/
-            inline ConfigValueContainer& getValue(int* value)            { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(unsigned int* value)   { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(char* value)           { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(unsigned char* value)  { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(short* value)          { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(unsigned short* value) { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(long* value)           { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(unsigned long* value)  { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(float* value)          { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(double* value)         { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(long double* value)    { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(bool* value)           { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(std::string* value)    { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(const char** value)    { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(Vector2* value)        { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(Vector3* value)        { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(ColourValue* value)    { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(Quaternion* value)     { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(Radian* value)         { this->value_.getValue(value); return *this; }
-            inline ConfigValueContainer& getValue(Degree* value)         { this->value_.getValue(value); return *this; }
+            template <typename T>
+            inline ConfigValueContainer& getValue(T* value)
+                { this->value_.getValue(value); return *this; }
+            template <typename T>
+            inline ConfigValueContainer& getValue(std::vector<T>* value)
+            {
+                value->clear();
+                for (unsigned int i = 0; i < this->valueVector_.size(); i++)
+                    value->push_back(this->valueVector_[i]);
+                return *this;
+            }
+
+            inline const std::string& getName() const
+                { return this->varname_; }
+            inline bool isVector() const
+                { return this->bIsVector_; }
+            inline unsigned int getVectorSize() const
+                { return this->valueVector_.size(); }
 
             void description(const std::string& description);
             const std::string& getDescription() const;
 
-            bool parseString(const std::string& input, MultiTypeMath& defvalue);
-            bool valueToString(std::string* output, MultiTypeMath& input);
-            void resetConfigFileEntry();
-            void resetConfigValue();
+            bool add(const std::string& input);
+            bool remove(unsigned int index);
+            bool set(const std::string& input);
+            bool tset(const std::string& input);
+            bool reset();
+            void update();
 
-            static std::string getStrippedLine(const std::string& line);
-            static bool isEmpty(const std::string& line);
-            static bool isComment(const std::string& line);
+            /** @brief Converts the config-value to a string. @return The string */
+            inline std::string toString() const
+                { return this->value_.toString(); }
+            /** @brief Returns the typename of the assigned config-value. @return The typename */
+            inline std::string getTypename() const
+                { return this->value_.getTypename(); }
 
         private:
-            bool parseString(const std::string& input, int defvalue);
-            bool parseString(const std::string& input, unsigned int defvalue);
-            bool parseString(const std::string& input, char defvalue);
-            bool parseString(const std::string& input, unsigned char defvalue);
-            bool parseString(const std::string& input, short defvalue);
-            bool parseString(const std::string& input, unsigned short defvalue);
-            bool parseString(const std::string& input, long defvalue);
-            bool parseString(const std::string& input, unsigned long defvalue);
-            bool parseString(const std::string& input, float defvalue);
-            bool parseString(const std::string& input, double defvalue);
-            bool parseString(const std::string& input, long double defvalue);
-            bool parseString(const std::string& input, bool defvalue);
-            bool parseString(const std::string& input, const std::string& defvalue);
-            bool parseString(const std::string& input, const char* defvalue);
-            bool parseString(const std::string& input, const Vector2& defvalue);
-            bool parseString(const std::string& input, const Vector3& defvalue);
-            bool parseString(const std::string& input, const ColourValue& defvalue);
-            bool parseString(const std::string& input, const Quaternion& defvalue);
-            bool parseString(const std::string& input, const Radian& defvalue);
-            bool parseString(const std::string& input, const Degree& defvalue);
+            bool parse(const std::string& input);
+            bool parse(const std::string& input, const MultiTypeMath& defvalue);
 
-            static std::list<std::string>& getConfigFileLines();
-            static bool finishedReadingConfigFile(bool finished = false);
-            void searchConfigFileLine();
-            std::string parseValueString(bool bStripped = true);
+            bool set(unsigned int index, const std::string& input);
+            bool tset(unsigned int index, const std::string& input);
+            bool parse(unsigned int index, const std::string& input);
+            bool parse(unsigned int index, const std::string& input, const MultiTypeMath& defvalue);
 
-            static void readConfigFile(const std::string& filename);
-            static void writeConfigFile(const std::string& filename);
+            bool                       bIsVector_;                  //!< True if the container contains a std::vector
 
-            std::string         classname_;                     //!< The name of the class the variable belongs to
-            std::string         varname_;                       //!< The name of the variable
-            std::string         defvalueString_;                //!< The string of the default-variable
+            ConfigFileType             type_;                       //!< The type of the corresponding config-file
+            Identifier*                identifier_;                 //!< The identifier of the class
+            std::string                sectionname_;                //!< The name of the class the variable belongs to
+            std::string                varname_;                    //!< The name of the variable
+            std::string                defvalueString_;             //!< The string of the default-value
+            std::vector<std::string>   defvalueStringVector_;       //!< A vector, containg the strings of the default-values in case we're storing a vector
 
-            MultiTypeMath       value_;                         //!< The value
+            MultiTypeMath              value_;                      //!< The value
+            std::vector<MultiTypeMath> valueVector_;                //!< A vector, containg the values in case we're storing a vector
 
-            std::list<std::string>::iterator configFileLine_;   //!< An iterator, pointing to the entry of the variable in the config-file
-
-            bool bAddedDescription_;                            //!< True if a description was added
-            LanguageEntryLabel description_;                    //!< The description
+            bool                       bAddedDescription_;          //!< True if a description was added
+            LanguageEntryLabel         description_;                //!< The description
     };
 }
Index: code/trunk/src/orxonox/core/ConfigValueIncludes.h
===================================================================
--- code/trunk/src/orxonox/core/ConfigValueIncludes.h	(revision 1052)
+++ code/trunk/src/orxonox/core/ConfigValueIncludes.h	(revision 1052)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ConfigValueIncludes.h
+    @brief Definition of macros for config-values.
+*/
+
+#ifndef _ConfigValueIncludes_H__
+#define _ConfigValueIncludes_H__
+
+#include "Identifier.h"
+#include "ConfigValueContainer.h"
+#include "ConfigFileManager.h"
+
+
+/**
+    @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
+    @param varname The name of the variable
+    @param defvalue The default-value of the variable
+*/
+#define SetConfigValue(varname, defvalue) \
+    orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
+    if (!container##varname) \
+    { \
+        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, varname = defvalue); \
+        this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
+    } \
+    container##varname->getValue(&varname)
+
+/**
+    @brief Assigns the vector-values, defined in the config-file, to the vector (or the default-value, if there are no entries in the file).
+    @param varname The name of the std::vector
+    @param defvalue The default-value
+*/
+#define SetConfigValueVector(varname, defvalue) \
+    orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
+    if (!container##varname) \
+    { \
+        std::vector<MultiTypeMath> temp; \
+        for (unsigned int i = 0; i < defvalue.size(); i++) \
+            temp.push_back(MultiTypeMath(defvalue[i])); \
+        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, temp); \
+        this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
+    } \
+    container##varname->getValue(&varname)
+
+/**
+    @brief Sets the variable and the config-file entry back to the previously defined default-value.
+    @param varname The name of the variable
+*/
+#define ResetConfigValue(varname) \
+    orxonox::ConfigValueContainer* container##varname##reset = this->getIdentifier()->getConfigValueContainer(#varname); \
+    if (container##varname##reset) \
+    { \
+        container##varname##reset->reset(); \
+        container##varname##reset->getValue(&varname); \
+    } \
+    else \
+    { \
+        COUT(2) << "Warning: Couldn't reset config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
+    }
+
+/**
+    @brief Modifies a config-value by using a modifier and some arguments.
+    @param varname The name of the config-value
+    @param modifier The name of the modifier: set, tset, add, remove, reset, update
+*/
+#define ModifyConfigValue(varname, modifier, ...) \
+    orxonox::ConfigValueContainer* container##varname##modify##modifier = this->getIdentifier()->getConfigValueContainer(#varname); \
+    if (container##varname##modify##modifier) \
+    { \
+        container##varname##modify##modifier->modifier(__VA_ARGS__); \
+        container##varname##modify##modifier->getValue(&varname); \
+    } \
+    else \
+    { \
+        COUT(2) << "Warning: Couln't modify config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
+    }
+
+/**
+    @brief Assigns the command, defined in the keybind-file, to the key-variable (or an empty string, if there is no entry in the file).
+    @param varname The name of the key-variable
+*/
+#define SetKeybind(keyname) \
+    orxonox::ConfigValueContainer* container##keyname = this->getIdentifier()->getConfigValueContainer(#keyname); \
+    if (!container##keyname) \
+    { \
+        container##keyname = new orxonox::ConfigValueContainer(CFT_Keybindings, this->getIdentifier(), #keyname, keyname = ""); \
+        this->getIdentifier()->addConfigValueContainer(#keyname, container##keyname); \
+    } \
+    container##keyname->getValue(&varname)
+
+#endif /* _ConfigValueIncludes_H__ */
Index: code/trunk/src/orxonox/core/ConsoleCommand.h
===================================================================
--- code/trunk/src/orxonox/core/ConsoleCommand.h	(revision 1052)
+++ code/trunk/src/orxonox/core/ConsoleCommand.h	(revision 1052)
@@ -0,0 +1,55 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ConsoleCommand_H__
+#define _ConsoleCommand_H__
+
+#include "Executor.h"
+#include "ClassManager.h"
+#include "Identifier.h"
+#include "CommandExecutor.h"
+
+
+
+#define ConsoleCommand(classname, function, accesslevel, bCreateShortcut) \
+    ConsoleCommandGeneric(classname##function##consolecommand__, classname, orxonox::createExecutor(orxonox::createFunctor(&classname::function), #function, accesslevel), bCreateShortcut)
+
+#define ConsoleCommandGeneric(fakevariable, classname, executor, bCreateShortcut) \
+    Executor& fakevariable = ClassManager<classname>::getIdentifier()->addConsoleCommand((ExecutorStatic*)executor, bCreateShortcut)
+
+
+#define ConsoleCommandShortcut(classname, function, accesslevel) \
+    ConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createExecutor(orxonox::createFunctor(&classname::function), #function, accesslevel))
+
+#define ConsoleCommandShortcutExtern(function, accesslevel) \
+    ConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createExecutor(orxonox::createFunctor(&function), #function, accesslevel))
+
+#define ConsoleCommandShortcutGeneric(fakevariable, executor) \
+    Executor& fakevariable = CommandExecutor::addConsoleCommandShortcut((ExecutorStatic*)executor)
+
+
+#endif /* _ConsoleCommand_H__ */
Index: code/trunk/src/orxonox/core/CoreIncludes.h
===================================================================
--- code/trunk/src/orxonox/core/CoreIncludes.h	(revision 1051)
+++ code/trunk/src/orxonox/core/CoreIncludes.h	(revision 1052)
@@ -28,5 +28,5 @@
 /**
     @file CoreIncludes.h
-    @brief Definition of macros and typedefs.
+    @brief Definition of macros for Identifier and Factory.
 
     Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
@@ -40,18 +40,11 @@
 #define _CoreIncludes_H__
 
-#include "CorePrereqs.h"
-
-// All needed header-files
 #include "Identifier.h"
 #include "ClassManager.h"
 #include "Factory.h"
 #include "ClassFactory.h"
-#include "Iterator.h"
-#include "OrxonoxClass.h"
-#include "ConfigValueContainer.h"
 #include "Debug.h"
 
 
-// All needed macros
 /**
     @brief Intern macro, containing the common parts of RegisterObject and RegisterRootObject.
@@ -111,31 +104,3 @@
     orxonox::Factory::getIdentifier(StringOrInt)
 
-/**
-    @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
-    @param varname The name of the variable
-    @param defvalue The default-value of the variable
-*/
-#define SetConfigValue(varname, defvalue) \
-    orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
-    if (!container##varname) \
-    { \
-        container##varname = new orxonox::ConfigValueContainer(this->getIdentifier()->getName(), #varname, varname = defvalue); \
-        this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
-    } \
-    container##varname->getValue(&varname)
-
-/**
-    @brief Sets the variable and the config-file entry back to the previously defined default-value.
-    @param varname The name of the variable
-*/
-#define ResetConfigValue(varname) \
-    orxonox::ConfigValueContainer* container##varname##reset = this->getIdentifier()->getConfigValueContainer(#varname); \
-    if (container##varname##reset) \
-    { \
-        container##varname##reset->resetConfigValue(); \
-        container##varname##reset->getValue(&varname); \
-    } \
-    else \
-        COUT(2) << "Warning: Couldn't reset variable " << #varname << ", corresponding container doesn't exist." << std::endl
-
 #endif /* _CoreIncludes_H__ */
Index: code/trunk/src/orxonox/core/CorePrereqs.h
===================================================================
--- code/trunk/src/orxonox/core/CorePrereqs.h	(revision 1051)
+++ code/trunk/src/orxonox/core/CorePrereqs.h	(revision 1052)
@@ -65,4 +65,16 @@
 namespace orxonox
 {
+#ifndef _XMLPort_Mode__
+#define _XMLPort_Mode__
+  namespace XMLPort
+  {
+    enum Mode
+    {
+      LoadObject,
+      SaveObject
+    };
+  }
+#endif
+
   typedef std::string LanguageEntryLabel;
 
@@ -79,11 +91,28 @@
   class ClassTreeMaskIterator;
   class ClassTreeMaskNode;
+  class CommandEvaluation;
+  class CommandExecutor;
+  class ConfigFile;
+  class ConfigFileEntry;
+  class ConfigFileEntryComment;
+  class ConfigFileEntryValue;
+  class ConfigFileManager;
+  class ConfigFileSection;
   class ConfigValueContainer;
-  class DebugLevel;
+  class CoreSettings;
   class Error;
   class Executor;
+  template <class T>
+  class ExecutorMember;
+  class ExecutorStatic;
   class Factory;
+  class Functor;
+  template <class T>
+  class FunctorMember;
+  class FunctorStatic;
   class Identifier;
   class IdentifierDistributor;
+  class InputBuffer;
+  class InputBufferListener;
   class InputHandlerGame;
   class InputHandlerGUI;
@@ -98,4 +127,6 @@
   template <class T>
   class MetaObjectListElement;
+  class Namespace;
+  class NamespaceNode;
   template <class T>
   class ObjectList;
@@ -104,4 +135,5 @@
   class OrxonoxClass;
   class OutputHandler;
+  class Shell;
   template <class T>
   class SubclassIdentifier;
Index: code/trunk/src/orxonox/core/CoreSettings.cc
===================================================================
--- code/trunk/src/orxonox/core/CoreSettings.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/CoreSettings.cc	(revision 1052)
@@ -0,0 +1,162 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file CoreSettings.cc
+    @brief Implementation of the CoreSettings class.
+*/
+
+#include "CoreSettings.h"
+#include "Language.h"
+#include "CoreIncludes.h"
+#include "ConfigValueIncludes.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Registers the object and sets the config-values.
+        @param A reference to a global variable, used to avoid an infinite recursion in getSoftDebugLevel()
+    */
+    CoreSettings::CoreSettings()
+    {
+        RegisterRootObject(CoreSettings);
+        this->setConfigValues();
+    }
+
+    bool& CoreSettings::isCreatingCoreSettings()
+    {
+        static bool bCreatingCoreSettings = true;
+        static bool bFirstTime = true;
+        if (bFirstTime)
+        {
+            bFirstTime = false;
+            CoreSettings::getInstance();
+        }
+        return bCreatingCoreSettings;
+    }
+
+    /**
+        @brief Returns a unique instance of CoreSettings.
+        @return The instance
+    */
+    CoreSettings& CoreSettings::getInstance()
+    {
+        static CoreSettings instance = CoreSettings();
+
+        // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
+        if (CoreSettings::isCreatingCoreSettings())
+        {
+            isCreatingCoreSettings() = false;
+            instance.setConfigValues();
+        }
+        return instance;
+    }
+
+    /**
+        @brief Function to collect the SetConfigValue-macro calls.
+    */
+    void CoreSettings::setConfigValues()
+    {
+        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
+        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
+        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
+
+        // softDebugLevel_ is the maximum of the 3 variables
+        this->softDebugLevel_ = this->softDebugLevelConsole_;
+        if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelLogfile_;
+        if (this->softDebugLevelShell_ > this->softDebugLevel_)
+            this->softDebugLevel_ = this->softDebugLevelShell_;
+
+
+        std::string temp = this->language_;
+        SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text");
+
+        if (this->language_ != temp)
+        {
+            // Read the translation file after the language was configured
+            Language::getLanguage().readTranslatedLanguageFile();
+        }
+    }
+
+    /**
+        @brief Static function that holds the singleton.
+    */
+    int CoreSettings::getSoftDebugLevel(OutputHandler::OutputDevice device)
+    {
+        if (!CoreSettings::isCreatingCoreSettings())
+        {
+            if (device == OutputHandler::LD_All)
+                return CoreSettings::getInstance().softDebugLevel_;
+            else if (device == OutputHandler::LD_Console)
+                return CoreSettings::getInstance().softDebugLevelConsole_;
+            else if (device == OutputHandler::LD_Logfile)
+                return CoreSettings::getInstance().softDebugLevelLogfile_;
+            else if (device == OutputHandler::LD_Shell)
+                return CoreSettings::getInstance().softDebugLevelShell_;
+        }
+
+        // Return a constant value while we're creating the object
+        return 2;
+    }
+
+    /**
+        @brief Returns the configured language.
+    */
+    const std::string& CoreSettings::getLanguage()
+    {
+        if (!CoreSettings::isCreatingCoreSettings())
+            return CoreSettings::getInstance().language_;
+
+        return Language::getLanguage().defaultLanguage_;
+    }
+
+    /**
+        @brief Sets the language in the config-file back to the default.
+    */
+    void CoreSettings::resetLanguage()
+    {
+        CoreSettings::getInstance().resetLanguageIntern();
+    }
+
+    /**
+        @brief Sets the language in the config-file back to the default.
+    */
+    void CoreSettings::resetLanguageIntern()
+    {
+        ResetConfigValue(language_);
+    }
+}
+
+/**
+    @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
+    @return The soft debug level
+*/
+int getSoftDebugLevel()
+{
+    return orxonox::CoreSettings::getSoftDebugLevel();
+}
Index: code/trunk/src/orxonox/core/CoreSettings.h
===================================================================
--- code/trunk/src/orxonox/core/CoreSettings.h	(revision 1052)
+++ code/trunk/src/orxonox/core/CoreSettings.h	(revision 1052)
@@ -0,0 +1,73 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file CoreSettings.h
+    @brief Definition of the CoreSettings class.
+
+    The CoreSettings class is a singleton, only used to configure some variables
+    in the core through the config-file.
+*/
+
+#ifndef _CoreSettings_H__
+#define _CoreSettings_H__
+
+#include "OrxonoxClass.h"
+#include "OutputHandler.h"
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    //! The CoreSettings class is a singleton, only used to configure some config-values.
+    class _CoreExport CoreSettings : public OrxonoxClass
+    {
+        public:
+            static CoreSettings& getInstance();
+            static bool& isCreatingCoreSettings();
+            void setConfigValues();
+
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
+            static const std::string& getLanguage();
+            static void resetLanguage();
+
+        private:
+            void resetLanguageIntern();
+
+            CoreSettings();
+            CoreSettings(const CoreSettings& other) {}
+            virtual ~CoreSettings() {}
+
+            int softDebugLevel_;                            //!< The debug level
+            int softDebugLevelConsole_;                     //!< The debug level for the console
+            int softDebugLevelLogfile_;                     //!< The debug level for the logfile
+            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
+            std::string language_;                          //!< The language
+    };
+}
+
+#endif /* _CoreSettings_H__ */
Index: code/trunk/src/orxonox/core/DebugLevel.cc
===================================================================
--- code/trunk/src/orxonox/core/DebugLevel.cc	(revision 1051)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file DebugLevel.cc
-    @brief Implementation of the DebugLevel class.
-*/
-
-#include "DebugLevel.h"
-#include "CoreIncludes.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor: Registers the object and sets the debug level.
-        @param A reference to a global variable, used to avoid an infinite recursion in getSoftDebugLevel()
-    */
-    DebugLevel::DebugLevel(bool& bReturnSoftDebugLevel)
-    {
-        RegisterRootObject(DebugLevel);
-        this->setConfigValues();
-        bReturnSoftDebugLevel = true;
-    }
-
-    /**
-        @brief Function to collect the SetConfigValue-macro calls.
-    */
-    void DebugLevel::setConfigValues()
-    {
-        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
-        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
-        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
-
-        // softDebugLevel_ is the maximum of the 3 variables
-        this->softDebugLevel_ = this->softDebugLevelConsole_;
-        if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
-            this->softDebugLevel_ = this->softDebugLevelLogfile_;
-        if (this->softDebugLevelShell_ > this->softDebugLevel_)
-            this->softDebugLevel_ = this->softDebugLevelShell_;
-    }
-
-    /**
-        @brief Static function that holds the singleton.
-    */
-    int DebugLevel::getSoftDebugLevel(OutputHandler::OutputDevice device)
-    {
-        static bool bCreatingSoftDebugLevelObject = true;   // Static variable - used to enhance the performance
-        static bool bReturnSoftDebugLevel = false;          // Static variable - used to avoid an infinite recursion
-        static DebugLevel* theOnlyDebugLevelObject = 0;     // Static variable - will contain a pointer to the only instance of the DebugLevel class
-
-        // If bReturnSoftDebugLevel is true, the instance of DebugLevel was created (it's set to true at the end of the constructor, call by reference)
-        if (bReturnSoftDebugLevel)
-        {
-            if (device == OutputHandler::LD_All)
-                return theOnlyDebugLevelObject->softDebugLevel_;
-            else if (device == OutputHandler::LD_Console)
-                return theOnlyDebugLevelObject->softDebugLevelConsole_;
-            else if (device == OutputHandler::LD_Logfile)
-                return theOnlyDebugLevelObject->softDebugLevelLogfile_;
-            else if (device == OutputHandler::LD_Shell)
-                return theOnlyDebugLevelObject->softDebugLevelShell_;
-        }
-
-        // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
-        if (bCreatingSoftDebugLevelObject)
-        {
-            bCreatingSoftDebugLevelObject = false;
-            theOnlyDebugLevelObject = new DebugLevel(bReturnSoftDebugLevel);
-            return getSoftDebugLevel(device);
-        }
-
-        // Return a constant value while we're creating the object
-        return 3;
-    }
-}
-
-/**
-    @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
-    @return The soft debug level
-*/
-int getSoftDebugLevel()
-{
-    return orxonox::DebugLevel::getSoftDebugLevel();
-}
Index: code/trunk/src/orxonox/core/DebugLevel.h
===================================================================
--- code/trunk/src/orxonox/core/DebugLevel.h	(revision 1051)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file DebugLevel.h
-    @brief Definition of the DebugLevel class.
-
-    The DebugLevel class is a singleton, only used to configure the amount of debug
-    output (see Debug.h) into the console and the logfile (see OutputHandler.h).
-*/
-
-#ifndef _DebugLevel_H__
-#define _DebugLevel_H__
-
-#include "CorePrereqs.h"
-
-#include "OrxonoxClass.h"
-#include "OutputHandler.h"
-
-namespace orxonox
-{
-    //! The DebugLevel class is a singleton, only used to configure the amount of debug output.
-    class _CoreExport DebugLevel : public OrxonoxClass
-    {
-        template <class T>
-        friend class ClassIdentifier; // forward declaration because of the private destructor
-
-        public:
-            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
-            void setConfigValues();
-
-        private:
-            explicit DebugLevel(bool& bReturnSoftDebugLevel);
-            DebugLevel(const DebugLevel& dl) {} // don't copy
-            virtual ~DebugLevel() {}            // don't delete
-
-            int softDebugLevel_;                            //!< The debug level
-            int softDebugLevelConsole_;                     //!< The debug level for the console
-            int softDebugLevelLogfile_;                     //!< The debug level for the logfile
-            int softDebugLevelShell_;                       //!< The debug level for the ingame shell
-            ConfigValueContainer* softDebugLevelContainer_; //!< The config value container for the debug level
-    };
-}
-
-#endif /* _DebugLevel_H__ */
Index: code/trunk/src/orxonox/core/Executor.cc
===================================================================
--- code/trunk/src/orxonox/core/Executor.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/Executor.cc	(revision 1052)
@@ -29,14 +29,17 @@
 #include "Executor.h"
 #include "Language.h"
-#include "util/String.h"
+#include "util/Math.h"
 
 namespace orxonox
 {
-    Executor::Executor(Functor* functor, const std::string& name)
+    Executor::Executor(Functor* functor, const std::string& name, AccessLevel::Level level)
     {
         this->functor_ = functor;
         this->name_ = name;
+        this->accessLevel_ = level;
+
         this->bAddedDescription_ = false;
         this->bAddedDescriptionReturnvalue_ = false;
+
         this->bAddedDescriptionParam_[0] = false;
         this->bAddedDescriptionParam_[1] = false;
@@ -44,21 +47,71 @@
         this->bAddedDescriptionParam_[3] = false;
         this->bAddedDescriptionParam_[4] = false;
+
+        this->bAddedDefaultValue_[0] = false;
+        this->bAddedDefaultValue_[1] = false;
+        this->bAddedDefaultValue_[2] = false;
+        this->bAddedDefaultValue_[3] = false;
+        this->bAddedDefaultValue_[4] = false;
     }
 
     Executor::~Executor()
     {
-    }
-
-    void Executor::setName(const std::string name)
-    {
-        this->name_ = name;
-    }
-
-    const std::string& Executor::getName() const
-    {
-        return this->name_;
-    }
-
-    void Executor::description(const std::string& description)
+        delete this->functor_;
+    }
+
+    bool Executor::parse(const std::string& params, const std::string& delimiter) const
+    {
+        EXECUTOR_PARSE(normal);
+    }
+
+    bool Executor::evaluate(const std::string& params, MultiTypeMath param[5], const std::string& delimiter) const
+    {
+        unsigned int paramCount = this->functor_->getParamCount();
+
+        if (paramCount == 1)
+        {
+            // only one param: check if there are params given, otherwise try to use default values
+            std::string temp = getStripped(params);
+            if ((temp != "") && (temp.size() != 0))
+            {
+                param[0] = params;
+                this->functor_->evaluateParam(0, param[0]);
+                return true;
+            }
+            else if (this->bAddedDefaultValue_[0])
+            {
+                param[0] = this->defaultValue_[0];
+                this->functor_->evaluateParam(0, param[0]);
+                return true;
+            }
+            return false;
+        }
+        else
+        {
+            // more than one param
+            SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0');
+
+            // if there are not enough params given, check if there are default values
+            for (unsigned int i = tokens.size(); i < this->functor_->getParamCount(); i++)
+                if (!this->bAddedDefaultValue_[i])
+                    return false;
+
+            // assign all given arguments to the multitypes
+            for (unsigned int i = 0; i < min(tokens.size(), (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
+                param[i] = tokens[i];
+
+            // fill the remaining multitypes with default values
+            for (unsigned int i = tokens.size(); i < min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
+                param[i] = this->defaultValue_[i];
+
+            // evaluate the param types through the functor
+            for (unsigned int i = 0; i < min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
+                this->functor_->evaluateParam(i, param[i]);
+
+            return true;
+        }
+    }
+
+    Executor& Executor::setDescription(const std::string& description)
     {
         if (!this->bAddedDescription_)
@@ -68,4 +121,5 @@
             this->bAddedDescription_ = true;
         }
+        return (*this);
     }
 
@@ -75,7 +129,7 @@
     }
 
-    void Executor::descriptionParam(int param, const std::string& description)
-    {
-        if (param > 0 && param <= 5)
+    Executor& Executor::setDescriptionParam(int param, const std::string& description)
+    {
+        if (param >= 0 && param < MAX_FUNCTOR_ARGUMENTS)
         {
             if (!this->bAddedDescriptionParam_[param])
@@ -83,5 +137,5 @@
                 std::string paramnumber;
                 if (!Convert::ToString(&paramnumber, param))
-                    return;
+                    return (*this);
 
                 this->descriptionParam_[param] = std::string("ExecutorDescription::" + this->name_ + "::param" + paramnumber);
@@ -90,17 +144,16 @@
             }
         }
+        return (*this);
     }
 
     const std::string& Executor::getDescriptionParam(int param) const
     {
-        if (param > 0 && param <= 5)
-        {
+        if (param >= 0 && param < MAX_FUNCTOR_ARGUMENTS)
             return GetLocalisation(this->descriptionParam_[param]);
-        }
 
         return this->descriptionParam_[0];
     }
 
-    void Executor::descriptionReturnvalue(const std::string& description)
+    Executor& Executor::setDescriptionReturnvalue(const std::string& description)
     {
         if (!this->bAddedDescriptionReturnvalue_)
@@ -110,4 +163,5 @@
             this->bAddedDescriptionReturnvalue_ = true;
         }
+        return (*this);
     }
 
@@ -116,3 +170,82 @@
         return GetLocalisation(this->descriptionReturnvalue_);
     }
+
+    Executor& Executor::setDefaultValues(const MultiTypeMath& param1)
+    {
+        this->defaultValue_[0] = param1;
+        this->bAddedDefaultValue_[0] = true;
+
+        return (*this);
+    }
+
+    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
+    {
+        this->defaultValue_[0] = param1;
+        this->bAddedDefaultValue_[0] = true;
+        this->defaultValue_[1] = param2;
+        this->bAddedDefaultValue_[1] = true;
+
+        return (*this);
+    }
+
+    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
+    {
+        this->defaultValue_[0] = param1;
+        this->bAddedDefaultValue_[0] = true;
+        this->defaultValue_[1] = param2;
+        this->bAddedDefaultValue_[1] = true;
+        this->defaultValue_[2] = param3;
+        this->bAddedDefaultValue_[2] = true;
+
+        return (*this);
+    }
+
+    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
+    {
+        this->defaultValue_[0] = param1;
+        this->bAddedDefaultValue_[0] = true;
+        this->defaultValue_[1] = param2;
+        this->bAddedDefaultValue_[1] = true;
+        this->defaultValue_[2] = param3;
+        this->bAddedDefaultValue_[2] = true;
+        this->defaultValue_[3] = param4;
+        this->bAddedDefaultValue_[3] = true;
+
+        return (*this);
+    }
+
+    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
+    {
+        this->defaultValue_[0] = param1;
+        this->bAddedDefaultValue_[0] = true;
+        this->defaultValue_[1] = param2;
+        this->bAddedDefaultValue_[1] = true;
+        this->defaultValue_[2] = param3;
+        this->bAddedDefaultValue_[2] = true;
+        this->defaultValue_[3] = param4;
+        this->bAddedDefaultValue_[3] = true;
+        this->defaultValue_[4] = param5;
+        this->bAddedDefaultValue_[4] = true;
+
+        return (*this);
+    }
+
+    Executor& Executor::setDefaultValue(unsigned int index, const MultiTypeMath& param)
+    {
+        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+        {
+            this->defaultValue_[index] = param;
+            this->bAddedDefaultValue_[index] = true;
+        }
+        return (*this);
+    }
+
+    bool Executor::allDefaultValuesSet() const
+    {
+        for (unsigned int i = 0; i < this->functor_->getParamCount(); i++)
+            if (!this->bAddedDefaultValue_[i])
+                return false;
+
+        return true;
+    }
 }
Index: code/trunk/src/orxonox/core/Executor.h
===================================================================
--- code/trunk/src/orxonox/core/Executor.h	(revision 1051)
+++ code/trunk/src/orxonox/core/Executor.h	(revision 1052)
@@ -32,4 +32,116 @@
 #include "CorePrereqs.h"
 #include "Functor.h"
+#include "Debug.h"
+#include "util/SubString.h"
+#include "util/String.h"
+
+
+#define EXECUTOR_PARSE_FUNCTORCALL(mode) EXECUTOR_PARSE_FUNCTORCALL##mode
+#define EXECUTOR_PARSE_FUNCTORCALLnormal (*this->functor_)
+#define EXECUTOR_PARSE_FUNCTORCALLobject (*((FunctorMember<T>*)this->functor_))
+
+#define EXECUTOR_PARSE_OBJECT(mode, comma) EXECUTOR_PARSE_OBJECT##mode##comma
+#define EXECUTOR_PARSE_OBJECTnormal0
+#define EXECUTOR_PARSE_OBJECTnormal1
+#define EXECUTOR_PARSE_OBJECTobject0 object
+#define EXECUTOR_PARSE_OBJECTobject1 object,
+
+#define EXECUTOR_PARSE(mode) \
+    unsigned int paramCount = this->functor_->getParamCount(); \
+    \
+    if (paramCount == 0) \
+    { \
+        COUT(5) << "Calling Executor " << this->name_ << " through parser without parameters." << std::endl; \
+        EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 0)); \
+    } \
+    else if (paramCount == 1) \
+    { \
+        std::string temp = getStripped(params); \
+        if ((temp != "") && (temp.size() != 0)) \
+        { \
+            COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using whole string: " << params << std::endl; \
+            EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) MultiTypeMath(params)); \
+        } \
+        else if (this->bAddedDefaultValue_[0]) \
+        { \
+            COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using default value: " << this->defaultValue_[0] << std::endl; \
+            EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) this->defaultValue_[0]); \
+        } \
+        else \
+        { \
+            COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input: " << temp << ")." << std::endl; \
+            return false; \
+        } \
+    } \
+    else \
+    { \
+        SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0'); \
+        \
+        for (unsigned int i = tokens.size(); i < this->functor_->getParamCount(); i++) \
+        { \
+            if (!this->bAddedDefaultValue_[i]) \
+            { \
+                COUT(2) << "Warning: Can't call executor " << this->name_ << " through parser: Not enough parameters or default values given (input:" << params << ")." << std::endl; \
+                return false; \
+            } \
+        } \
+        \
+        MultiTypeMath param[MAX_FUNCTOR_ARGUMENTS]; \
+        COUT(5) << "Calling Executor " << this->name_ << " through parser with " << paramCount << " parameters, using " << tokens.size() << " tokens ("; \
+        for (unsigned int i = 0; i < tokens.size() && i < MAX_FUNCTOR_ARGUMENTS; i++) \
+        { \
+            param[i] = tokens[i]; \
+            if (i != 0) \
+            { \
+                COUT(5) << ", "; \
+            } \
+            COUT(5) << tokens[i]; \
+        } \
+        COUT(5) << ") and " << (paramCount - tokens.size()) << " default values ("; \
+        for (unsigned int i = tokens.size(); i < paramCount; i++) \
+        { \
+            param[i] = this->defaultValue_[i]; \
+            if (i != 0) \
+            { \
+                COUT(5) << ", "; \
+            } \
+            COUT(5) << this->defaultValue_[i]; \
+        } \
+        COUT(5) << ")." << std::endl; \
+        \
+        if ((tokens.size() > paramCount) && (this->functor_->getTypenameParam(paramCount - 1) == "string")) \
+            param[paramCount - 1] = tokens.subSet(paramCount - 1).join(); \
+        \
+        switch(paramCount) \
+        { \
+            case 2: \
+                EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) param[0], param[1]); \
+                break; \
+            case 3: \
+                EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) param[0], param[1], param[2]); \
+                break; \
+            case 4: \
+                EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) param[0], param[1], param[2], param[3]); \
+                break; \
+            case 5: \
+                EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) param[0], param[1], param[2], param[3], param[4]); \
+                break; \
+        } \
+    } \
+    \
+    return true
+
+namespace AccessLevel
+{
+    enum Level
+    {
+        None,
+        User,
+        Admin,
+        Offline,
+        Debug,
+        Disabled
+    };
+}
 
 namespace orxonox
@@ -38,23 +150,34 @@
     {
         public:
-            Executor(Functor* functor, const std::string& name = "");
+            Executor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None);
             virtual ~Executor();
 
-            inline virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
+            inline void operator()() const
+                { (*this->functor_)(this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const MultiTypeMath& param1) const
+                { (*this->functor_)(param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2) const
+                { (*this->functor_)(param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
+                { (*this->functor_)(param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
+                { (*this->functor_)(param1, param2, param3, param4, this->defaultValue_[4]); }
+            inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
                 { (*this->functor_)(param1, param2, param3, param4, param5); }
 
-            void setName(const std::string name);
-            const std::string& getName() const;
-
-            void description(const std::string& description);
+            bool parse(const std::string& params, const std::string& delimiter = " ") const;
+
+            bool evaluate(const std::string& params, MultiTypeMath param[5], const std::string& delimiter = " ") const;
+
+            Executor& setDescription(const std::string& description);
             const std::string& getDescription() const;
 
-            void descriptionParam(int param, const std::string& description);
+            Executor& setDescriptionParam(int param, const std::string& description);
             const std::string& getDescriptionParam(int param) const;
 
-            void descriptionReturnvalue(const std::string& description);
+            Executor& setDescriptionReturnvalue(const std::string& description);
             const std::string& getDescriptionReturnvalue(int param) const;
 
-            inline int getParamCount() const
+            inline unsigned int getParamCount() const
                 { return this->functor_->getParamCount(); }
             inline bool hasReturnvalue() const
@@ -64,22 +187,59 @@
             inline MultiTypeMath getReturnvalue() const
                 { return this->functor_->getReturnvalue(); }
-            inline std::string getTypenameParam(int param) const
+            inline std::string getTypenameParam(unsigned int param) const
                 { return this->functor_->getTypenameParam(param); }
             inline std::string getTypenameReturnvalue() const
                 { return this->functor_->getTypenameReturnvalue(); }
 
+            inline void setName(const std::string name)
+                { this->name_ = name; }
+            inline const std::string& getName() const
+                { return this->name_; }
+
+            inline void setAccessLevel(AccessLevel::Level level)
+                { this->accessLevel_ = level; }
+            inline AccessLevel::Level getAccessLevel() const
+                { return this->accessLevel_; }
+
+            Executor& setDefaultValues(const MultiTypeMath& param1);
+            Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2);
+            Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3);
+            Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4);
+            Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5);
+            Executor& setDefaultValue(unsigned int index, const MultiTypeMath& param);
+
+            inline MultiTypeMath getDefaultValue(unsigned int index) const
+            {
+                if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+                    return this->defaultValue_[index];
+
+                return MT_null;
+            }
+
+            bool allDefaultValuesSet() const;
+            inline bool defaultValueSet(unsigned int index) const
+            {
+                if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+                    return this->bAddedDefaultValue_[index];
+
+                return false;
+            }
+
         protected:
             Functor* functor_;
+            std::string name_;
+            MultiTypeMath defaultValue_[MAX_FUNCTOR_ARGUMENTS];
+            bool bAddedDefaultValue_[MAX_FUNCTOR_ARGUMENTS];
 
         private:
-            std::string name_;
-
             LanguageEntryLabel description_;
             LanguageEntryLabel descriptionReturnvalue_;
-            LanguageEntryLabel descriptionParam_[5];
+            LanguageEntryLabel descriptionParam_[MAX_FUNCTOR_ARGUMENTS];
 
             bool bAddedDescription_;
             bool bAddedDescriptionReturnvalue_;
-            bool bAddedDescriptionParam_[5];
+            bool bAddedDescriptionParam_[MAX_FUNCTOR_ARGUMENTS];
+
+            AccessLevel::Level accessLevel_;
     };
 
@@ -87,9 +247,6 @@
     {
         public:
-            ExecutorStatic(FunctorStatic* functor, const std::string& name = "") : Executor(functor, name) {}
+            ExecutorStatic(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
             virtual ~ExecutorStatic() {}
-
-            inline virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-                { (*this->functor_)(param1, param2, param3, param4, param5); }
     };
 
@@ -98,19 +255,65 @@
     {
         public:
-            ExecutorMember(FunctorMember<T>* functor, const std::string& name = "") : Executor(functor, name) {}
+            ExecutorMember(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
             virtual ~ExecutorMember() {}
 
-            inline virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-                { (*this->functor_)(object, param1, param2, param3, param4, param5); }
-            inline virtual void operator()(const T* object, const MultiTypeMath param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-                { (*this->functor_)(object, param1, param2, param3, param4, param5); }
-            inline virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-                { (*this->functor_)(param1, param2, param3, param4, param5); }
-
-            inline void setObject(T* object)
-                { this->functor_->setObject(object); }
-            inline void setObject(const T* object)
-                { this->functor_->setObject(object); }
+            inline void operator()(T* object) const
+                { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(T* object, const MultiTypeMath& param1) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }
+            inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }
+
+
+            inline void operator()(const T* object) const
+                { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const T* object, const MultiTypeMath& param1) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
+            inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }
+            inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
+                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }
+
+            inline void setObject(T* object) const
+                { ((FunctorMember<T>*)this->functor_)->setObject(object); }
+            inline void setObject(const T* object) const
+                { ((FunctorMember<T>*)this->functor_)->setObject(object); }
+
+            bool parse(T* object, const std::string& params, const std::string& delimiter = " ") const
+            {
+                EXECUTOR_PARSE(object);
+            }
+
+            bool parse(const T* object, const std::string& params, const std::string& delimiter = " ") const
+            {
+                EXECUTOR_PARSE(object);
+            }
     };
+
+    inline Executor* createExecutor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new Executor(functor, name, level);
+    }
+
+    template <class T>
+    inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new ExecutorMember<T>(functor, name, level);
+    }
+
+    inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new ExecutorStatic(functor, name, level);
+    }
 }
 
Index: code/trunk/src/orxonox/core/Functor.h
===================================================================
--- code/trunk/src/orxonox/core/Functor.h	(revision 1051)
+++ code/trunk/src/orxonox/core/Functor.h	(revision 1052)
@@ -35,140 +35,148 @@
 #include "CorePrereqs.h"
 
-
-enum FunctionType
+#define MAX_FUNCTOR_ARGUMENTS 5
+
+namespace orxonox
 {
-    FT_MEMBER,
-    FT_CONSTMEMBER,
-    FT_STATIC
-};
-
-
-template <class T>
-inline std::string typeToString();
+    enum FunctionType
+    {
+        FT_MEMBER,
+        FT_CONSTMEMBER,
+        FT_STATIC
+    };
+
+
+    template <class T>
+    inline std::string typeToString() { return "unknown"; }
 
 #define CreateTypeToStringTemplate(type) \
     template <> \
-    inline std::string typeToString<type>() { return #type; }
-
-CreateTypeToStringTemplate(int);
-CreateTypeToStringTemplate(unsigned int);
-CreateTypeToStringTemplate(char);
-CreateTypeToStringTemplate(unsigned char);
-CreateTypeToStringTemplate(short);
-CreateTypeToStringTemplate(unsigned short);
-CreateTypeToStringTemplate(long);
-CreateTypeToStringTemplate(unsigned long);
-CreateTypeToStringTemplate(float);
-CreateTypeToStringTemplate(double);
-CreateTypeToStringTemplate(long double);
-CreateTypeToStringTemplate(bool);
-CreateTypeToStringTemplate(std::string);
-CreateTypeToStringTemplate(orxonox::Vector2);
-CreateTypeToStringTemplate(orxonox::Vector3);
-CreateTypeToStringTemplate(orxonox::Quaternion);
-CreateTypeToStringTemplate(orxonox::ColourValue);
-CreateTypeToStringTemplate(orxonox::Radian);
-CreateTypeToStringTemplate(orxonox::Degree);
-
-
-class _CoreExport Functor
-{
-    public:
-        Functor() {}
-        virtual ~Functor() {}
-
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-
-        inline int getParamCount() const { return this->numParams_; }
-        inline bool hasReturnvalue() const { return this->hasReturnValue_; }
-        inline FunctionType getType() const { return this->type_; }
-        inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
-
-        std::string getTypenameParam(int param) const { return (param > 0 && param <= 5) ? this->typeParam_[param-1] : ""; }
-        std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
-
-    protected:
-        int numParams_;
-        bool hasReturnValue_;
-        FunctionType type_;
-        MultiTypeMath returnedValue_;
-
-        std::string typeReturnvalue_;
-        std::string typeParam_[5];
-};
-
-class _CoreExport FunctorStatic : public Functor
-{
-    public:
-        virtual ~FunctorStatic() {}
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-};
-
-template <class T>
-class FunctorMember : public Functor
-{
-    public:
-        FunctorMember()
-        {
-            constObject_ = 0;
-            object_ = 0;
-            bConstObject_ = false;
-        }
-        virtual ~FunctorMember() {}
-
-        virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-        virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-        {
-            if (this->bConstObject_)
+    inline std::string typeToString<type>() { return #type; } \
+    template <> \
+    inline std::string typeToString<type&>() { return #type; } \
+    template <> \
+    inline std::string typeToString<const type>() { return #type; } \
+    template <> \
+    inline std::string typeToString<const type&>() { return #type; }
+
+    CreateTypeToStringTemplate(int);
+    CreateTypeToStringTemplate(unsigned int);
+    CreateTypeToStringTemplate(char);
+    CreateTypeToStringTemplate(unsigned char);
+    CreateTypeToStringTemplate(short);
+    CreateTypeToStringTemplate(unsigned short);
+    CreateTypeToStringTemplate(long);
+    CreateTypeToStringTemplate(unsigned long);
+    CreateTypeToStringTemplate(float);
+    CreateTypeToStringTemplate(double);
+    CreateTypeToStringTemplate(long double);
+    CreateTypeToStringTemplate(bool);
+    CreateTypeToStringTemplate(Vector2);
+    CreateTypeToStringTemplate(Vector3);
+    CreateTypeToStringTemplate(Quaternion);
+    CreateTypeToStringTemplate(ColourValue);
+    CreateTypeToStringTemplate(Radian);
+    CreateTypeToStringTemplate(Degree);
+
+    template <> \
+    inline std::string typeToString<std::string>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<std::string&>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<const std::string>() { return "string"; } \
+    template <> \
+    inline std::string typeToString<const std::string&>() { return "string"; }
+
+    class _CoreExport Functor
+    {
+        public:
+            Functor() {}
+            virtual ~Functor() {}
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            inline unsigned int getParamCount() const { return this->numParams_; }
+            inline bool hasReturnvalue() const { return this->hasReturnValue_; }
+            inline FunctionType getType() const { return this->type_; }
+            inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
+
+            std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }
+            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
+
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0;
+
+        protected:
+            unsigned int numParams_;
+            bool hasReturnValue_;
+            FunctionType type_;
+            MultiTypeMath returnedValue_;
+
+            std::string typeReturnvalue_;
+            std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];
+    };
+
+    class _CoreExport FunctorStatic : public Functor
+    {
+        public:
+            virtual ~FunctorStatic() {}
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+    };
+
+    template <class T>
+    class FunctorMember : public Functor
+    {
+        public:
+            FunctorMember()
             {
-                if (this->constObject_)
-                    (*this)(this->constObject_, param1, param2, param3, param4, param5);
+                constObject_ = 0;
+                object_ = 0;
+                bConstObject_ = false;
+            }
+            virtual ~FunctorMember() {}
+
+            virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+            virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
+            {
+                if (this->bConstObject_)
+                {
+                    if (this->constObject_)
+                        (*this)(this->constObject_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No const object set." << std::endl;
+                    }
+                }
                 else
                 {
-                    COUT(1) << "An error occurred in Functor.h:" << std::endl;
-                    COUT(1) << "Error: No const object set." << std::endl;
+                    if (this->object_)
+                        (*this)(this->object_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No object set." << std::endl;
+                    }
                 }
             }
-            else
+
+            void setObject(T* object)
             {
-                if (this->object_)
-                    (*this)(this->object_, param1, param2, param3, param4, param5);
-                else
-                {
-                    COUT(1) << "An error occurred in Functor.h:" << std::endl;
-                    COUT(1) << "Error: No object set." << std::endl;
-                }
+                this->bConstObject_ = false;
+                this->object_ = object;
             }
-        }
-
-        void setObject(T* object)
-        {
-            this->bConstObject_ = false;
-            this->object_ = object;
-        }
-
-        void setObject(const T* object)
-        {
-            this->bConstObject_ = true;
-            this->constObject_ = object;
-        }
-
-    private:
-        const T* constObject_;
-        T* object_;
-        bool bConstObject_;
-};
-
-
-
-#define MAKE_COMMA(x) MAKE_COMMA##x
-#define MAKE_COMMA0
-#define MAKE_COMMA1 ,
-#define MAKE_COMMA2 ,
-#define MAKE_COMMA3 ,
-#define MAKE_COMMA4 ,
-#define MAKE_COMMA5 ,
+
+            void setObject(const T* object)
+            {
+                this->bConstObject_ = true;
+                this->constObject_ = object;
+            }
+
+        private:
+            const T* constObject_;
+            T* object_;
+            bool bConstObject_;
+    };
 
 
@@ -272,4 +280,29 @@
 
 
+#define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams
+#define FUNCTOR_EVALUATE_PARAM0
+#define FUNCTOR_EVALUATE_PARAM1 \
+    if (index == 0) param = (P1)param
+#define FUNCTOR_EVALUATE_PARAM2 \
+    if (index == 0) param = (P1)param; \
+    else if (index == 1) param = (P2)param
+#define FUNCTOR_EVALUATE_PARAM3 \
+    if (index == 0) param = (P1)param; \
+    else if (index == 1) param = (P2)param; \
+    else if (index == 2) param = (P3)param
+#define FUNCTOR_EVALUATE_PARAM4 \
+    if (index == 0) param = (P1)param; \
+    else if (index == 1) param = (P2)param; \
+    else if (index == 2) param = (P3)param; \
+    else if (index == 3) param = (P4)param
+#define FUNCTOR_EVALUATE_PARAM5 \
+    if (index == 0) param = (P1)param; \
+    else if (index == 1) param = (P2)param; \
+    else if (index == 2) param = (P3)param; \
+    else if (index == 3) param = (P4)param; \
+    else if (index == 4) param = (P5)param
+
+
+
 
 
@@ -295,4 +328,9 @@
             } \
     \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
+            } \
+    \
         private: \
             FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
@@ -334,4 +372,9 @@
             } \
     \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
+            } \
+    \
         private: \
             FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
@@ -359,4 +402,9 @@
             { \
                 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
+            } \
+    \
+            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
+            { \
+                FUNCTOR_EVALUATE_PARAM(numparams); \
             } \
     \
@@ -412,6 +460,7 @@
 
 
-CREATE_ALL_STATIC_FUNCTORS();
-CREATE_ALL_MEMBER_FUNCTORS();
+    CREATE_ALL_STATIC_FUNCTORS();
+    CREATE_ALL_MEMBER_FUNCTORS();
+}
 
 #endif /* _Functor_H__ */
Index: code/trunk/src/orxonox/core/Identifier.cc
===================================================================
--- code/trunk/src/orxonox/core/Identifier.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/Identifier.cc	(revision 1052)
@@ -35,4 +35,6 @@
 #include "Identifier.h"
 #include "Factory.h"
+#include "Executor.h"
+#include "CommandExecutor.h"
 
 namespace orxonox
@@ -51,6 +53,9 @@
         this->factory_ = 0;
 
-        this->children_ = new std::list<const Identifier*>();
-        this->directChildren_ = new std::list<const Identifier*>();
+        this->bHasConfigValues_ = false;
+        this->bHasConsoleCommands_ = false;
+
+        this->children_ = new std::set<const Identifier*>();
+        this->directChildren_ = new std::set<const Identifier*>();
 
         // Use a static variable because the classID gets created before main() and that's why we should avoid static member variables
@@ -72,5 +77,5 @@
         @param parents A list containing all parents
     */
-    void Identifier::initialize(std::list<const Identifier*>* parents)
+    void Identifier::initialize(std::set<const Identifier*>* parents)
     {
         COUT(4) << "*** Identifier: Initialize " << this->name_ << "-Singleton." << std::endl;
@@ -83,5 +88,5 @@
 
             // Iterate through all parents
-            for (std::list<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
+            for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
             {
                 // Tell the parent we're one of it's children
@@ -89,8 +94,8 @@
 
                 // Erase all parents of our parent from our direct-parent-list
-                for (std::list<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)
+                for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)
                 {
                     // Search for the parent's parent in our direct-parent-list
-                    for (std::list<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)
+                    for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)
                     {
                         if ((*it1) == (*it2))
@@ -105,5 +110,5 @@
 
             // Now iterate through all direct parents
-            for (std::list<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+            for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
             {
                 // Tell the parent we're one of it's direct children
@@ -149,5 +154,5 @@
     bool Identifier::isA(const Identifier* identifier) const
     {
-        return (identifier == this || this->identifierIsInList(identifier, this->parents_));
+        return (identifier == this || (this->parents_.find(identifier) != this->children_->end()));
     }
 
@@ -167,5 +172,5 @@
     bool Identifier::isChildOf(const Identifier* identifier) const
     {
-        return this->identifierIsInList(identifier, this->parents_);
+        return (this->parents_.find(identifier) != this->children_->end());
     }
 
@@ -176,5 +181,5 @@
     bool Identifier::isDirectChildOf(const Identifier* identifier) const
     {
-        return this->identifierIsInList(identifier, this->directParents_);
+        return (this->directParents_.find(identifier) != this->children_->end());
     }
 
@@ -185,5 +190,5 @@
     bool Identifier::isParentOf(const Identifier* identifier) const
     {
-        return this->identifierIsInList(identifier, *this->children_);
+        return (this->children_->find(identifier) != this->children_->end());
     }
 
@@ -194,5 +199,37 @@
     bool Identifier::isDirectParentOf(const Identifier* identifier) const
     {
-        return this->identifierIsInList(identifier, *this->directChildren_);
+        return (this->directChildren_->find(identifier) != this->children_->end());
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> identifierMap;
+        return identifierMap;
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getLowercaseIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> lowercaseIdentifierMap;
+        return lowercaseIdentifierMap;
+    }
+
+    /**
+        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.
+        @param varname The name of the variablee
+        @param container The container
+    */
+    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
+    {
+        this->bHasConfigValues_ = true;
+        this->configValues_[varname] = container;
+        this->configValues_LC_[getLowercase(varname)] = container;
     }
 
@@ -212,31 +249,72 @@
 
     /**
-        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.
-        @param varname The name of the variablee
-        @param container The container
-    */
-    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
-    {
-        this->configValues_[varname] = container;
-    }
-
-    /**
-        @brief Searches for a given identifier in a list and returns whether the identifier is in the list or not.
-        @param identifier The identifier to look for
-        @param list The list
-        @return True = the identifier is in the list
-    */
-    bool Identifier::identifierIsInList(const Identifier* identifier, const std::list<const Identifier*>& list)
-    {
-        for (std::list<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
-            if (identifier == (*it))
-                return true;
-
-        return false;
-    }
-
-    std::ostream& operator<<(std::ostream& out, const std::list<const Identifier*>& list)
-    {
-        for (std::list<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
+        @brief Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.
+        @param varname The name of the variable in lowercase
+        @return The ConfigValueContainer
+    */
+    ConfigValueContainer* Identifier::getLowercaseConfigValueContainer(const std::string& varname)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_LC_.find(varname);
+        if (it != configValues_LC_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new console command of this class.
+        @param executor The executor of the command
+        @param bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command
+        @return The executor of the command
+    */
+    ExecutorStatic& Identifier::addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut)
+    {
+        this->bHasConsoleCommands_ = true;
+        this->consoleCommands_[executor->getName()] = executor;
+        this->consoleCommands_LC_[getLowercase(executor->getName())] = executor;
+
+        if (bCreateShortcut)
+            CommandExecutor::addConsoleCommandShortcut(executor);
+
+        return (*executor);
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name.
+        @brief name The name of the requested console command
+        @return The executor of the requested console command
+    */
+    ExecutorStatic* Identifier::getConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_.find(name);
+        if (it != this->consoleCommands_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name in lowercase.
+        @brief name The name of the requested console command in lowercae
+        @return The executor of the requested console command
+    */
+    ExecutorStatic* Identifier::getLowercaseConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_LC_.find(name);
+        if (it != this->consoleCommands_LC_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
+        @param out The outstream
+        @param list The list (or set) of Identifiers
+        @return The outstream
+    */
+    std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list)
+    {
+        for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
             out << (*it)->getName() << " ";
 
Index: code/trunk/src/orxonox/core/Identifier.h
===================================================================
--- code/trunk/src/orxonox/core/Identifier.h	(revision 1051)
+++ code/trunk/src/orxonox/core/Identifier.h	(revision 1052)
@@ -52,5 +52,5 @@
 #define _Identifier_H__
 
-#include <list>
+#include <set>
 #include <map>
 #include <string>
@@ -62,4 +62,5 @@
 #include "Debug.h"
 #include "Iterator.h"
+#include "util/String.h"
 
 namespace orxonox
@@ -105,37 +106,90 @@
             bool isDirectParentOf(const Identifier* identifier) const;
 
-            /** @brief Removes all objects of the corresponding class. */
-            virtual void removeObjects() const = 0;
+            virtual const ObjectList<BaseObject>* getObjectList() const = 0;
+
+            virtual void updateConfigValues() const = 0;
 
             /** @brief Returns the name of the class the Identifier belongs to. @return The name */
             inline const std::string& getName() const { return this->name_; }
 
+
             /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
-            inline const std::list<const Identifier*>& getParents() const { return this->parents_; }
+            inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
             /** @brief Returns the begin-iterator of the parents-list. @return The begin-iterator */
-            inline std::list<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); }
+            inline std::set<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); }
             /** @brief Returns the end-iterator of the parents-list. @return The end-iterator */
-            inline std::list<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); }
+            inline std::set<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); }
 
             /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
-            inline const std::list<const Identifier*>& getChildren() const { return (*this->children_); }
+            inline const std::set<const Identifier*>& getChildren() const { return (*this->children_); }
             /** @brief Returns the begin-iterator of the children-list. @return The begin-iterator */
-            inline std::list<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_->begin(); }
+            inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_->begin(); }
             /** @brief Returns the end-iterator of the children-list. @return The end-iterator */
-            inline std::list<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_->end(); }
+            inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_->end(); }
 
             /** @brief Returns the direct parents of the class the Identifier belongs to. @return The list of all direct parents */
-            inline const std::list<const Identifier*>& getDirectParents() const { return this->directParents_; }
+            inline const std::set<const Identifier*>& getDirectParents() const { return this->directParents_; }
             /** @brief Returns the begin-iterator of the direct-parents-list. @return The begin-iterator */
-            inline std::list<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); }
+            inline std::set<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); }
             /** @brief Returns the end-iterator of the direct-parents-list. @return The end-iterator */
-            inline std::list<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); }
+            inline std::set<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); }
 
             /** @brief Returns the direct children the class the Identifier belongs to. @return The list of all direct children */
-            inline const std::list<const Identifier*>& getDirectChildren() const { return (*this->directChildren_); }
+            inline const std::set<const Identifier*>& getDirectChildren() const { return (*this->directChildren_); }
             /** @brief Returns the begin-iterator of the direct-children-list. @return The begin-iterator */
-            inline std::list<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_->begin(); }
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_->begin(); }
             /** @brief Returns the end-iterator of the direct-children-list. @return The end-iterator */
-            inline std::list<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); }
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); }
+
+
+            /** @brief Returns the map that stores all Identifiers. @return The map */
+            static inline const std::map<std::string, Identifier*>& getIdentifierMap() { return Identifier::getIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapBegin() { return Identifier::getIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapEnd() { return Identifier::getIdentifierMap().end(); }
+
+            /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
+            static inline const std::map<std::string, Identifier*>& getLowercaseIdentifierMap() { return Identifier::getLowercaseIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapBegin() { return Identifier::getLowercaseIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapEnd() { return Identifier::getLowercaseIdentifierMap().end(); }
+
+
+            /** @brief Returns the map that stores all config values. @return The const_iterator */
+            inline const std::map<std::string, ConfigValueContainer*>& getConfigValueMap() const { return this->configValues_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all config values. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getConfigValueMapBegin() const { return this->configValues_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all config values. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getConfigValueMapEnd() const { return this->configValues_.end(); }
+
+            /** @brief Returns the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline const std::map<std::string, ConfigValueContainer*>& getLowercaseConfigValueMap() const { return this->configValues_LC_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getLowercaseConfigValueMapBegin() const { return this->configValues_LC_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getLowercaseConfigValueMapEnd() const { return this->configValues_LC_.end(); }
+
+
+            /** @brief Returns the map that stores all console commands. @return The const_iterator */
+            inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandMap() const { return this->consoleCommands_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandMapBegin() const { return this->consoleCommands_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandMapEnd() const { return this->consoleCommands_.end(); }
+
+            /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandMap() const { return this->consoleCommands_LC_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandMapBegin() const { return this->consoleCommands_LC_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }
+
+
+            /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */
+            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
+            /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
+            inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
 
             /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
@@ -148,14 +202,23 @@
             void setNetworkID(unsigned int id);
 
+            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
             ConfigValueContainer* getConfigValueContainer(const std::string& varname);
-            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
-
+            ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
+
+            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
             virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0;
-            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
-
+
+            virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
             virtual XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname) = 0;
-            virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
-
-            static bool identifierIsInList(const Identifier* identifier, const std::list<const Identifier*>& list);
+
+            ExecutorStatic& addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut);
+            ExecutorStatic* getConsoleCommand(const std::string& name) const;
+            ExecutorStatic* getLowercaseConsoleCommand(const std::string& name) const;
+
+        protected:
+            /** @brief Returns the map that stores all Identifiers. @return The map */
+            static std::map<std::string, Identifier*>& getIdentifierMapIntern();
+            /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
+            static std::map<std::string, Identifier*>& getLowercaseIdentifierMapIntern();
 
         private:
@@ -163,10 +226,10 @@
             Identifier(const Identifier& identifier) {} // don't copy
             virtual ~Identifier();
-            void initialize(std::list<const Identifier*>* parents);
+            void initialize(std::set<const Identifier*>* parents);
 
             /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
-            inline std::list<const Identifier*>& getChildrenIntern() const { return (*this->children_); }
+            inline std::set<const Identifier*>& getChildrenIntern() const { return (*this->children_); }
             /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */
-            inline std::list<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
+            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
 
             /**
@@ -188,20 +251,27 @@
             }
 
-            std::list<const Identifier*> parents_;                      //!< The parents of the class the Identifier belongs to
-            std::list<const Identifier*>* children_;                    //!< The children of the class the Identifier belongs to
-
-            std::list<const Identifier*> directParents_;                //!< The direct parents of the class the Identifier belongs to
-            std::list<const Identifier*>* directChildren_;              //!< The direct children of the class the Identifier belongs to
-
-            std::string name_;                                          //!< The name of the class the Identifier belongs to
-
-            BaseFactory* factory_;                                      //!< The Factory, able to create new objects of the given class (if available)
-            bool bCreatedOneObject_;                                    //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
-            static int hierarchyCreatingCounter_s;                      //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
-            unsigned int classID_;                                      //!< The network ID to identify a class through the network
-            std::map<std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer
+            std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
+            std::set<const Identifier*>* children_;                        //!< The children of the class the Identifier belongs to
+
+            std::set<const Identifier*> directParents_;                    //!< The direct parents of the class the Identifier belongs to
+            std::set<const Identifier*>* directChildren_;                  //!< The direct children of the class the Identifier belongs to
+
+            std::string name_;                                             //!< The name of the class the Identifier belongs to
+
+            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
+            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
+            static int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
+            unsigned int classID_;                                         //!< The network ID to identify a class through the network
+
+            bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
+            std::map<std::string, ConfigValueContainer*> configValues_;    //!< A map to link the string of configurable variables with their ConfigValueContainer
+            std::map<std::string, ConfigValueContainer*> configValues_LC_; //!< A map to link the string of configurable variables with their ConfigValueContainer
+
+            bool bHasConsoleCommands_;                                     //!< True if this class has at least one assigned console command
+            std::map<std::string, ExecutorStatic*> consoleCommands_;       //!< All console commands of this class
+            std::map<std::string, ExecutorStatic*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
     };
 
-    _CoreExport std::ostream& operator<<(std::ostream& out, const std::list<const Identifier*>& list);
+    _CoreExport std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list);
 
 
@@ -228,9 +298,13 @@
 
         public:
-            ClassIdentifier<T>* registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass);
+            ClassIdentifier<T>* registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass);
             void addObject(T* object);
-            void removeObjects() const;
             void setName(const std::string& name);
+            /** @brief Returns the list of all existing objects of this class. @return The list */
             inline const ObjectList<T>* getObjects() const { return this->objects_; }
+            /** @brief Returns a list of all existing objects of this class. @return The list */
+            inline const ObjectList<BaseObject>* getObjectList() const { return (ObjectList<BaseObject>*)this->objects_; }
+
+            void updateConfigValues() const;
 
             XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
@@ -245,8 +319,8 @@
             ~ClassIdentifier() {}                                       // don't delete
 
-            ObjectList<T>* objects_;    //!< The ObjectList, containing all objects of type T
-            bool bSetName_;             //!< True if the name is set
-            std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;
-            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;
+            ObjectList<T>* objects_;                                                                    //!< The ObjectList, containing all objects of type T
+            bool bSetName_;                                                                             //!< True if the name is set
+            std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;              //!< All loadable parameters
+            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
     };
 
@@ -270,14 +344,12 @@
     */
     template <class T>
-    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass)
-    {
-        COUT(5) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
+    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass)
+    {
+        this->setName(name);
 
         // Check if at least one object of the given type was created
-        if (!this->bCreatedOneObject_)
+        if (!this->bCreatedOneObject_ && Identifier::isCreatingHierarchy())
         {
             // If no: We have to store the informations and initialize the Identifier
-            this->setName(name);
-
             COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl;
             if (bRootClass)
@@ -301,4 +373,6 @@
             this->name_ = name;
             this->bSetName_ = true;
+            Identifier::getIdentifierMapIntern()[name] = this;
+            Identifier::getLowercaseIdentifierMapIntern()[getLowercase(name)] = this;
         }
     }
@@ -316,13 +390,18 @@
 
     /**
-        @brief Removes all objects of the corresponding class.
-    */
-    template <class T>
-    void ClassIdentifier<T>::removeObjects() const
-    {
-        for (Iterator<T> it = this->objects_->start(); it;)
-            delete *(it++);
-    }
-
+        @brief Updates the config-values of all existing objects of this class by calling their setConfigValues() function.
+    */
+    template <class T>
+    void ClassIdentifier<T>::updateConfigValues() const
+    {
+        for (Iterator<T> it = this->objects_->start(); it; ++it)
+            ((T*)*it)->setConfigValues();
+    }
+
+    /**
+        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @return The container
+    */
     template <class T>
     XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname)
@@ -335,4 +414,9 @@
     }
 
+    /**
+        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @param container The container
+    */
     template <class T>
     void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
@@ -341,4 +425,9 @@
     }
 
+    /**
+        @brief Returns a XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @return The container
+    */
     template <class T>
     XMLPortObjectContainer* ClassIdentifier<T>::getXMLPortObjectContainer(const std::string& sectionname)
@@ -351,4 +440,9 @@
     }
 
+    /**
+        @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @param container The container
+    */
     template <class T>
     void ClassIdentifier<T>::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
Index: code/trunk/src/orxonox/core/InputBuffer.cc
===================================================================
--- code/trunk/src/orxonox/core/InputBuffer.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/InputBuffer.cc	(revision 1052)
@@ -0,0 +1,186 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <iostream>
+
+#include "InputBuffer.h"
+#include "InputManager.h"
+#include "util/Clipboard.h"
+
+namespace orxonox
+{
+    InputBuffer::InputBuffer()
+    {
+        this->bActivated_ = false;
+        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZäöüÄÖÜ0123456789 \\\"().:,;_-+*/=!?<>[|]";
+        this->keyboard_ = InputManager::getSingleton().getKeyboard();
+        this->buffer_ = "";
+
+        this->keyboard_->setEventCallback(this);
+    }
+/*
+    void InputBuffer::registerListener(InputBufferListener* listener, void (InputBufferListener::*function)(), bool bOnlySingleInput)
+    {
+        struct InputBufferListenerTuple newListener = {listener, function, true, bOnlySingleInput, ' '};
+        this->listeners_.insert(this->listeners_.end(), newListener);
+    }
+
+    void InputBuffer::registerListener(InputBufferListener* listener, void (InputBufferListener::*function)(), char char_, bool bOnlySingleInput)
+    {
+        struct InputBufferListenerTuple newListener = {listener, function, false, bOnlySingleInput, char_};
+        this->listeners_.insert(this->listeners_.end(), newListener);
+    }
+*/
+    void InputBuffer::set(const std::string& input)
+    {
+        this->buffer_ = "";
+        this->append(input);
+    }
+
+    void InputBuffer::append(const std::string& input)
+    {
+        for (unsigned int i = 0; i < input.size(); i++)
+        {
+            if (this->charIsAllowed(input[i]))
+                this->buffer_ += input[i];
+
+            this->updated(input[i], false);
+        }
+        this->updated();
+    }
+
+    void InputBuffer::append(const char& input)
+    {
+        if (this->charIsAllowed(input))
+            this->buffer_ += input;
+
+        this->updated(input, true);
+    }
+
+    void InputBuffer::clear()
+    {
+        this->buffer_ = "";
+        this->updated();
+    }
+
+    void InputBuffer::removeLast()
+    {
+        this->buffer_ = this->buffer_.substr(0, this->buffer_.size() - 1);
+        this->updated();
+    }
+
+    void InputBuffer::updated()
+    {
+        for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+        {
+            if ((*it).bListenToAllChanges_)
+                (*(*it).listener_.*(*it).function_)();
+        }
+    }
+
+    void InputBuffer::updated(const char& update, bool bSingleInput)
+    {
+        for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+        {
+            if (((*it).bListenToAllChanges_ || ((*it).char_ == update)) && (!(*it).bOnlySingleInput_ || bSingleInput))
+                (*(*it).listener_.*(*it).function_)();
+        }
+    }
+
+    void InputBuffer::activityChanged() const
+    {
+    }
+
+    bool InputBuffer::charIsAllowed(const char& input)
+    {
+        if (this->allowedChars_ == "")
+            return true;
+        else
+            return (this->allowedChars_.find(input) != std::string::npos);
+    }
+
+    bool InputBuffer::keyPressed(const OIS::KeyEvent &e)
+    {
+        if (e.key == OIS::KC_NUMPADENTER)
+        {
+            this->setActivated(!this->isActivated());
+            this->clear();
+            return true;
+        }
+
+        if (this->keyboard_->isModifierDown(OIS::Keyboard::Ctrl))
+        {
+            if (e.key == OIS::KC_V)
+            {
+                this->append(fromClipboard());
+                return true;
+            }
+            else if (e.key == OIS::KC_C)
+            {
+                toClipboard(this->buffer_);
+                return true;
+            }
+            else if (e.key == OIS::KC_X)
+            {
+                toClipboard(this->buffer_);
+                this->clear();
+                return true;
+            }
+        }
+        else if (this->keyboard_->isModifierDown(OIS::Keyboard::Shift))
+        {
+            if (e.key == OIS::KC_INSERT)
+            {
+                this->append(fromClipboard());
+                return true;
+            }
+            else if (e.key == OIS::KC_DELETE)
+            {
+                toClipboard(this->buffer_);
+                this->clear();
+                return true;
+            }
+        }
+
+        if (this->bActivated_)
+        {
+//std::cout << this->keyboard_->getAsString(e.key) << " / " << (char)e.text << std::endl;
+/*
+            std::string input = this->keyboard_->getAsString(e.key);
+            if (input.size() >= 1)
+                this->append(input[0]);
+*/
+            this->append((char)e.text);
+        }
+        return true;
+    }
+
+    bool InputBuffer::keyReleased(const OIS::KeyEvent &e)
+    {
+        return true;
+    }
+}
Index: code/trunk/src/orxonox/core/InputBuffer.h
===================================================================
--- code/trunk/src/orxonox/core/InputBuffer.h	(revision 1052)
+++ code/trunk/src/orxonox/core/InputBuffer.h	(revision 1052)
@@ -0,0 +1,125 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _InputBuffer_H__
+#define _InputBuffer_H__
+
+#include <string>
+#include <list>
+
+#ifdef WIN32
+#include <OIS/OISKeyboard.h>
+#else
+#include <OISKeyboard.h>
+#endif
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class _CoreExport InputBufferListener
+    {
+    };
+
+    class _CoreExport InputBuffer : public OIS::KeyListener
+    {
+        struct InputBufferListenerTuple
+        {
+            InputBufferListener* listener_;
+            void (InputBufferListener::*function_)();
+            bool bListenToAllChanges_;
+            bool bOnlySingleInput_;
+            char char_;
+        };
+
+        public:
+            InputBuffer();
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), bool bOnlySingleInput)
+            {
+                struct InputBufferListenerTuple newListener = {listener, (void (InputBufferListener::*)())function, true, bOnlySingleInput, ' '};
+                this->listeners_.insert(this->listeners_.end(), newListener);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, bool bOnlySingleInput)
+            {
+                struct InputBufferListenerTuple newListener = {listener, (void (InputBufferListener::*)())function, true, bOnlySingleInput, ' '};
+                this->listeners_.insert(this->listeners_.end(), newListener);
+            }
+
+            template <class T>
+            void registerListener(T* listener, void (T::*function)(), char char_, bool bOnlySingleInput)
+            {
+                struct InputBufferListenerTuple newListener = {listener, (void (InputBufferListener::*)())function, false, bOnlySingleInput, char_};
+                this->listeners_.insert(this->listeners_.end(), newListener);
+            }
+            template <class T>
+            void registerListener(T* listener, void (T::*function)() const, char char_, bool bOnlySingleInput)
+            {
+                struct InputBufferListenerTuple newListener = {listener, (void (InputBufferListener::*)())function, false, bOnlySingleInput, char_};
+                this->listeners_.insert(this->listeners_.end(), newListener);
+            }
+
+            void set(const std::string& input);
+            void append(const std::string& input);
+            void append(const char& input);
+            void removeLast();
+            void clear();
+
+            void updated();
+            void updated(const char& update, bool bSingleInput);
+
+            inline std::string get() const
+                { return this->buffer_; }
+
+            inline void activate()
+                { this->setActivated(true); }
+            inline void deactivate()
+                { this->setActivated(false); }
+            inline void setActivated(bool bActivated)
+                { if (this->bActivated_ != bActivated) { this->bActivated_ = bActivated; this->activityChanged(); } else { this->bActivated_ = bActivated; } }
+            inline bool isActivated() const
+                { return this->bActivated_; }
+
+            void activityChanged() const;
+
+        private:
+            bool charIsAllowed(const char& input);
+
+            bool keyPressed(const OIS::KeyEvent &e);
+            bool keyReleased(const OIS::KeyEvent &e);
+
+            OIS::Keyboard* keyboard_;
+            bool bActivated_;
+            std::string buffer_;
+            std::list<InputBufferListenerTuple> listeners_;
+            std::string allowedChars_;
+    };
+}
+
+#endif /* _InputBuffer_H__ */
Index: code/trunk/src/orxonox/core/InputHandler.cc
===================================================================
--- code/trunk/src/orxonox/core/InputHandler.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/InputHandler.cc	(revision 1052)
@@ -66,6 +66,6 @@
     {
       // simply write the key number (i) in the string
-      this->bindingsKeyPressed_[i] = ConvertValueAndReturn<int, std::string>(i);
-      this->bindingsKeyReleased_[i] = ConvertValueAndReturn<int, std::string>(i);
+      this->bindingsKeyPressed_[i] = getConvertedValue<int, std::string>(i);
+      this->bindingsKeyReleased_[i] = getConvertedValue<int, std::string>(i);
     }
     return true;
Index: code/trunk/src/orxonox/core/Language.cc
===================================================================
--- code/trunk/src/orxonox/core/Language.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/Language.cc	(revision 1052)
@@ -28,11 +28,11 @@
 /**
     @file Language.cc
-    @brief Implementation of the Language and the LanguageEntry class.
+    @brief Implementation of the Language and the LanguageEntry classes.
 */
 
 #include <fstream>
 
-#include "CoreIncludes.h"
 #include "Language.h"
+#include "CoreSettings.h"
 
 namespace orxonox
@@ -47,6 +47,4 @@
     LanguageEntry::LanguageEntry(const std::string& fallbackEntry)
     {
-        RegisterRootObject(LanguageEntry);
-
         this->fallbackEntry_ = fallbackEntry;
         this->localisedEntry_ = fallbackEntry; // Set the localisation to the fallback entry, for the case that no translation gets assigned
@@ -61,5 +59,5 @@
     {
         // Check if the translation is more than just an empty string
-        if (localisation.compare("") != 0)
+        if ((localisation != "") && (localisation.size() > 0))
         {
             this->localisedEntry_ = localisation;
@@ -91,6 +89,4 @@
     Language::Language()
     {
-        RegisterRootObject(Language);
-
         this->defaultLanguage_ = "default";
         this->defaultLocalisation_ = "ERROR: LANGUAGE ENTRY DOESN'T EXIST!";
@@ -101,15 +97,4 @@
 
     /**
-        @brief Function to collect the SetConfigValue-macro calls.
-    */
-    void Language::setConfigValues()
-    {
-        SetConfigValue(language_, this->defaultLanguage_).description("The language of the ingame text");
-
-        // Read the translation file after the language was configured
-        this->readTranslatedLanguageFile();
-    }
-
-    /**
         @brief Returns a reference to the only existing instance of the Language class and calls the setConfigValues() function.
         @return The reference to the only existing instance
@@ -117,16 +102,6 @@
     Language& Language::getLanguage()
     {
-        // Use static variables to avoid conflicts while executing this code before main()
-        static Language theOnlyLanguageObject = Language();
-        static bool bCreatingTheOnlyLanguageObject = true;
-
-        // This workaround is used to set a description of the own config value without creating an infinite recursion
-        if (bCreatingTheOnlyLanguageObject)
-        {
-            bCreatingTheOnlyLanguageObject = false;
-            theOnlyLanguageObject.setConfigValues();
-        }
-
-        return theOnlyLanguageObject;
+        static Language instance = Language();
+        return instance;
     }
 
@@ -244,5 +219,5 @@
 
             // Check if the line is empty
-            if (lineString.compare("") != 0)
+            if ((lineString != "") && (lineString.size() > 0))
             {
                 unsigned int pos = lineString.find('=');
@@ -252,5 +227,7 @@
                     this->createEntry(lineString.substr(0, pos), lineString.substr(pos + 1));
                 else
+                {
                     COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(this->defaultLanguage_) << std::endl;
+                }
             }
         }
@@ -264,15 +241,15 @@
     void Language::readTranslatedLanguageFile()
     {
-        COUT(4) << "Read translated language file (" << this->language_ << ")." << std::endl;
+        COUT(4) << "Read translated language file (" << CoreSettings::getLanguage() << ")." << std::endl;
 
         // Open the file
         std::ifstream file;
-        file.open(getFileName(this->language_).c_str(), std::fstream::in);
+        file.open(getFileName(CoreSettings::getLanguage()).c_str(), std::fstream::in);
 
         if (!file.is_open())
         {
             COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFileName(this->language_) << " to read the translated language entries!" << std::endl;
-            ResetConfigValue(language_);
+            COUT(1) << "Error: Couldn't open file " << getFileName(CoreSettings::getLanguage()) << " to read the translated language entries!" << std::endl;
+            CoreSettings::resetLanguage();
             COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << "." << std::endl;
             return;
@@ -288,5 +265,5 @@
 
             // Check if the line is empty
-            if (lineString.compare("") != 0)
+            if ((lineString != "") && (lineString.size() > 0))
             {
                 unsigned int pos = lineString.find('=');
@@ -304,5 +281,7 @@
                 }
                 else
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(this->language_) << std::endl;
+                {
+                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(CoreSettings::getLanguage()) << std::endl;
+                }
             }
         }
@@ -330,7 +309,7 @@
 
         // Iterate through the list an write the lines into the file
-        for (Iterator<LanguageEntry> it = ObjectList<LanguageEntry>::start(); it; ++it)
-        {
-            file << it->getLabel() << "=" << it->getDefault() << std::endl;
+        for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
+        {
+            file << (*it).second->getLabel() << "=" << (*it).second->getDefault() << std::endl;
         }
 
Index: code/trunk/src/orxonox/core/Language.h
===================================================================
--- code/trunk/src/orxonox/core/Language.h	(revision 1051)
+++ code/trunk/src/orxonox/core/Language.h	(revision 1052)
@@ -49,5 +49,4 @@
 
 #include "CorePrereqs.h"
-#include "OrxonoxClass.h"
 
 
@@ -65,5 +64,5 @@
     // ###############################
     //! The LanguageEntry class stores the default- and the translated string of a given entry in the language file.
-    class _CoreExport LanguageEntry : public OrxonoxClass
+    class _CoreExport LanguageEntry
     {
         public:
@@ -112,12 +111,10 @@
     // ###############################
     //! The Language class manges the language files and entries and stores the LanguageEntry objects in a map.
-    class _CoreExport Language : public OrxonoxClass
+    class _CoreExport Language
     {
-        template <class T>
-        friend class ClassIdentifier; // forward declaration because of the private destructor
+        friend class CoreSettings;
 
         public:
             static Language& getLanguage();
-            void setConfigValues();
             void addEntry(const LanguageEntryLabel& label, const std::string& entry);
             const std::string& getLocalisation(const LanguageEntryLabel& label) const;
@@ -134,5 +131,4 @@
             LanguageEntry* createEntry(const LanguageEntryLabel& label, const std::string& entry);
 
-            std::string language_;                                  //!< The configured language
             std::string defaultLanguage_;                           //!< The default language
             std::string defaultLocalisation_;                       //!< The returned string, if an entry unavailable entry is requested
Index: code/trunk/src/orxonox/core/Loader.cc
===================================================================
--- code/trunk/src/orxonox/core/Loader.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/Loader.cc	(revision 1052)
@@ -34,4 +34,5 @@
 #include "CoreIncludes.h"
 #include "Script.h"
+#include "Namespace.h"
 
 #include "util/tinyxml/ticpp.h"
@@ -129,26 +130,22 @@
             xmlfile.Parse(lua->getLuaOutput(), true);
 
-            for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ )
-            {
-                Identifier* identifier = ID(child->Value());
-                if (identifier)
-                {
-                    if (Loader::currentMask_s.isIncluded(identifier))
-                    {
-                        COUT(4) << "  fabricating " << child->Value() << "..." << std::endl;
-                        BaseObject* newObject = identifier->fabricate();
-                        newObject->setLoaderIndentation("    ");
-                        newObject->setLevel(level);
-                        newObject->XMLPort(*child, true);
-                        COUT(5) << "  ...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
-                    }
-                }
-                else
-                {
-                    COUT(2) << "  Warning: '" << child->Value() << "' is not a valid classname." << std::endl;
-                }
-            }
+            ticpp::Element rootElement;
+            rootElement.SetAttribute("name", "root");
+            rootElement.SetAttribute("bAutogenerated", true);
+
+            for (ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++)
+                rootElement.InsertEndChild(*child);
+
+            COUT(4) << "  creating root-namespace..." << std::endl;
+            Namespace* rootNamespace = new Namespace();
+            rootNamespace->setLoaderIndentation("    ");
+            rootNamespace->setLevel(level);
+            rootNamespace->setNamespace(rootNamespace);
+            rootNamespace->setRoot(true);
+            rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
 
             COUT(0) << "Finished loading " << level->getFile() << "." << std::endl;
+
+            COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString("  ") << std::endl;
 
             return true;
Index: code/trunk/src/orxonox/core/MetaObjectList.h
===================================================================
--- code/trunk/src/orxonox/core/MetaObjectList.h	(revision 1051)
+++ code/trunk/src/orxonox/core/MetaObjectList.h	(revision 1052)
@@ -99,5 +99,5 @@
 
 
-        COUT(5) << "*** MetaObjectList: Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
+        COUT(5) << "*** MetaObjectList: Removing Object from " << ClassManager<T>::getIdentifier()->getName() << "-list." << std::endl;
         delete this->element_;
     }
Index: code/trunk/src/orxonox/core/Namespace.cc
===================================================================
--- code/trunk/src/orxonox/core/Namespace.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/Namespace.cc	(revision 1052)
@@ -0,0 +1,179 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Namespace.h"
+#include "CoreIncludes.h"
+#include "XMLPort.h"
+#include "util/SubString.h"
+#include "NamespaceNode.h"
+
+namespace orxonox
+{
+    CreateFactory(Namespace);
+
+    Namespace::Namespace()
+    {
+        RegisterObject(Namespace);
+
+        this->bAutogeneratedFileRootNamespace_ = false;
+        this->bRoot_ = false;
+        this->operator_ = "or";
+    }
+
+    Namespace::~Namespace()
+    {
+        if (this->bRoot_)
+            for (std::set<NamespaceNode*>::iterator it = this->representingNamespaces_.begin(); it != this->representingNamespaces_.end(); ++it)
+                delete (*it);
+    }
+
+    /**
+        @brief XML loading and saving.
+        @param xmlelement The XML-element
+        @param loading Loading (true) or saving (false)
+        @return The XML-element
+    */
+    void Namespace::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlelement, mode);
+
+        std::string name = this->getName();
+        unsigned int pos = 0;
+        while ((pos = name.find(',')) != std::string::npos)
+            name.replace(pos, 1, " ");
+        while ((pos = name.find(';')) != std::string::npos)
+            name.replace(pos, 1, " ");
+        while ((pos = name.find('\n')) != std::string::npos)
+            name.replace(pos, 1, " ");
+        while ((pos = name.find('\t')) != std::string::npos)
+            name.replace(pos, 1, " ");
+        SubString tokens(name, " ", "", false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (this->bRoot_)
+        {
+            this->representingNamespaces_.insert(new NamespaceNode(this->getName()));
+        }
+        else
+        {
+            for (unsigned int i = 0; i < tokens.size(); i++)
+            {
+                for (std::set<NamespaceNode*>::iterator it = this->getNamespace()->representingNamespaces_.begin(); it != this->getNamespace()->representingNamespaces_.end(); ++it)
+                {
+                    std::set<NamespaceNode*> temp = (*it)->getNodeRelative(tokens[i]);
+                    this->representingNamespaces_.insert(temp.begin(), temp.end());
+                }
+            }
+        }
+
+        XMLPortParam(Namespace, "operator", setOperator, getOperator, xmlelement, mode);
+        XMLPortParam(Namespace, "bAutogenerated", setAutogenerated, isAutogenerated, xmlelement, mode);
+
+        if (this->bAutogeneratedFileRootNamespace_)
+        {
+            for (std::set<NamespaceNode*>::iterator it = this->representingNamespaces_.begin(); it != this->representingNamespaces_.end(); ++it)
+            {
+                (*it)->setRoot(true);
+                (*it)->setHidden(true);
+            }
+        }
+
+        XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, mode, true, false);
+    }
+
+    void Namespace::loadObjects(BaseObject* object)
+    {
+        object->setNamespace(this);
+    }
+
+    const BaseObject* Namespace::saveObjects(unsigned int index) const
+    {
+        return 0; // todo
+    }
+
+    bool Namespace::includes(const Namespace* ns) const
+    {
+        for (std::set<NamespaceNode*>::const_iterator it1 = this->representingNamespaces_.begin(); it1 != this->representingNamespaces_.end(); ++it1)
+        {
+            for (std::set<NamespaceNode*>::const_iterator it2 = ns->representingNamespaces_.begin(); it2 != ns->representingNamespaces_.end(); ++it2)
+            {
+                if ((*it1)->includes(*it2))
+                {
+                    if (this->operator_ == "or")
+                        return true;
+
+                    if (this->operator_ == "not")
+                        return false;
+                }
+                else
+                {
+                    if (this->operator_ == "and")
+                        return false;
+                }
+            }
+        }
+
+        if (this->operator_ == "or")
+            return false;
+        else if (this->operator_ == "and")
+            return true;
+        else if (this->operator_ == "not")
+            return true;
+
+        return false;
+    }
+
+    std::string Namespace::toString() const
+    {
+        std::string output;
+
+        int i = 0;
+        for (std::set<NamespaceNode*>::const_iterator it = this->representingNamespaces_.begin(); it != this->representingNamespaces_.end(); i++, ++it)
+        {
+            if (i > 0)
+                output += " / ";
+
+            output += (*it)->toString();
+        }
+
+        return output;
+    }
+
+    std::string Namespace::toString(const std::string& indentation) const
+    {
+        std::string output;
+
+        int i = 0;
+        for (std::set<NamespaceNode*>::const_iterator it = this->representingNamespaces_.begin(); it != this->representingNamespaces_.end(); i++, ++it)
+        {
+            if (i > 0)
+                output += "\n";
+
+            output += (*it)->toString(indentation);
+        }
+
+        return output;
+    }
+}
Index: code/trunk/src/orxonox/core/Namespace.h
===================================================================
--- code/trunk/src/orxonox/core/Namespace.h	(revision 1052)
+++ code/trunk/src/orxonox/core/Namespace.h	(revision 1052)
@@ -0,0 +1,78 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Namespace_H__
+#define _Namespace_H__
+
+#include <map>
+
+#include "BaseObject.h"
+#include "util/XMLIncludes.h"
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class Namespace : public BaseObject
+    {
+        public:
+            Namespace();
+            virtual ~Namespace();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void loadObjects(BaseObject* object);
+            const BaseObject* saveObjects(unsigned int index) const;
+
+            void setAutogenerated(bool bAutogenerated)
+                { this->bAutogeneratedFileRootNamespace_ = bAutogenerated; }
+            bool isAutogenerated() const
+                { return this->bAutogeneratedFileRootNamespace_; }
+
+            void setOperator(const std::string& op)
+                { this->operator_ = op; }
+            const std::string& getOperator() const
+                { return this->operator_; }
+
+            void setRoot(bool bRoot)
+                { this->bRoot_ = bRoot; }
+
+            bool includes(const Namespace* ns) const;
+            bool isIncludedIn(const Namespace* ns) const { return ns->includes(this); }
+
+            std::string toString() const;
+            std::string toString(const std::string& indentation) const;
+
+        private:
+            std::set<NamespaceNode*> representingNamespaces_;
+            bool bAutogeneratedFileRootNamespace_;
+            bool bRoot_;
+            std::string operator_;
+    };
+}
+
+#endif /* _Namespace_H__ */
Index: code/trunk/src/orxonox/core/NamespaceNode.cc
===================================================================
--- code/trunk/src/orxonox/core/NamespaceNode.cc	(revision 1052)
+++ code/trunk/src/orxonox/core/NamespaceNode.cc	(revision 1052)
@@ -0,0 +1,173 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "NamespaceNode.h"
+#include "Debug.h"
+
+namespace orxonox
+{
+    NamespaceNode::NamespaceNode(const std::string& name, NamespaceNode* parent)
+    {
+        this->name_ = name;
+        this->parent_ = parent;
+        this->bRoot_ = false;
+        this->bHidden_ = false;
+    }
+
+    NamespaceNode::~NamespaceNode()
+    {
+        for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); )
+            delete ((*(it++)).second);
+    }
+
+    std::set<NamespaceNode*> NamespaceNode::getNodeRelative(const std::string& name)
+    {
+        std::set<NamespaceNode*> nodes;
+
+        if ((name.size() == 0) || (name == ""))
+        {
+            nodes.insert(this);
+        }
+        else
+        {
+            unsigned int pos = name.find("::");
+            std::string firstPart = name;
+            std::string secondPart;
+
+            if (pos != std::string::npos)
+            {
+                firstPart = name.substr(0, pos);
+                secondPart = name.substr(pos + 2, std::string::npos);
+            }
+
+            if (firstPart == "..")
+            {
+                if (this->bRoot_)
+                {
+                    COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", namespace is root." << std::endl;
+                    nodes = this->getNodeRelative(secondPart);
+                }
+                else if (!this->parent_)
+                {
+                    COUT(2) << "Warning: Can't go to enclosing namespace with '..' operator in namespace " << this->name_ << ", no parent namespace set." << std::endl;
+                    nodes = this->getNodeRelative(secondPart);
+                }
+                else
+                {
+                    nodes = this->parent_->getNodeRelative(secondPart);
+                }
+            }
+            else if (name.find('@') != 0)
+            {
+                std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.find(firstPart);
+                if (it == this->subnodes_.end())
+                    it = this->subnodes_.insert(this->subnodes_.begin(), std::pair<std::string, NamespaceNode*>(firstPart, new NamespaceNode(firstPart, this)));
+
+                if ((*it).second->isHidden())
+                {
+                    COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl;
+                    nodes.insert(this);
+                }
+                else
+                {
+                    nodes = (*it).second->getNodeRelative(secondPart);
+                }
+            }
+            else
+            {
+                bool bFoundMatchingNamespace = false;
+
+                for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
+                {
+                    if ((*it).first.find(firstPart) == ((*it).first.size() - firstPart.size()))
+                    {
+                        std::set<NamespaceNode*> temp2 = (*it).second->getNodeRelative(secondPart);
+                        nodes.insert(temp2.begin(), temp2.end());
+                        bFoundMatchingNamespace = true;
+                    }
+                }
+
+                if (!bFoundMatchingNamespace)
+                {
+                    COUT(2) << "Warning: No file included with name '" << firstPart.substr(1, std::string::npos) << "' at this part of the level file, using parent namespace instead." << std::endl;
+                    nodes = this->getNodeRelative(secondPart);
+                }
+            }
+        }
+
+        return nodes;
+    }
+
+    bool NamespaceNode::includes(const NamespaceNode* ns) const
+    {
+        if (ns == this)
+        {
+            return true;
+        }
+        else
+        {
+            for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
+                if ((*it).second->includes(ns))
+                    return true;
+        }
+
+        return false;
+    }
+
+    std::string NamespaceNode::toString() const
+    {
+        std::string output = this->name_;
+
+        if (this->subnodes_.size() > 0)
+        {
+            output += " (";
+
+            int i = 0;
+            for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); i++, ++it)
+            {
+                if (i > 0)
+                    output += ", ";
+
+                output += (*it).second->toString();
+            }
+
+            output += ")";
+        }
+
+        return output;
+    }
+
+    std::string NamespaceNode::toString(const std::string& indentation) const
+    {
+        std::string output = (indentation + this->name_ + "\n");
+
+        for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
+            output += (*it).second->toString(indentation + "  ");
+
+        return output;
+    }
+}
Index: code/trunk/src/orxonox/core/NamespaceNode.h
===================================================================
--- code/trunk/src/orxonox/core/NamespaceNode.h	(revision 1052)
+++ code/trunk/src/orxonox/core/NamespaceNode.h	(revision 1052)
@@ -0,0 +1,67 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _NamespaceNode_H__
+#define _NamespaceNode_H__
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class NamespaceNode
+    {
+        public:
+            NamespaceNode(const std::string& name, NamespaceNode* parent = 0);
+            ~NamespaceNode();
+
+            std::set<NamespaceNode*> getNodeRelative(const std::string& name);
+
+            void setRoot(bool bRoot) { this->bRoot_ = bRoot; }
+            void setHidden(bool bHidden) { this->bHidden_ = bHidden; }
+
+            bool isRoot() const { return this->bRoot_; }
+            bool isHidden() const { return this->bHidden_; }
+
+            bool includes(const NamespaceNode*) const;
+
+            std::string toString() const;
+            std::string toString(const std::string& indentation) const;
+
+        private:
+            std::string name_;
+            NamespaceNode* parent_;
+            std::map<std::string, NamespaceNode*> subnodes_;
+            bool bHidden_;
+            bool bRoot_;
+    };
+}
+
+#endif /* _NamespaceNode_H__ */
Index: code/trunk/src/orxonox/core/OrxonoxClass.h
===================================================================
--- code/trunk/src/orxonox/core/OrxonoxClass.h	(revision 1051)
+++ code/trunk/src/orxonox/core/OrxonoxClass.h	(revision 1052)
@@ -37,5 +37,5 @@
 #define _OrxonoxClass_H__
 
-#include <list>
+#include <set>
 #include <string>
 
@@ -67,8 +67,8 @@
 
             /** @brief Returns the list of all parents of the object. @return The list */
-            inline std::list<const Identifier*>* getParents() const { return this->parents_; }
+            inline std::set<const Identifier*>* getParents() const { return this->parents_; }
 
             /** @brief Creates the parents-list. */
-            inline void createParents() { this->parents_ = new std::list<const Identifier*>(); }
+            inline void createParents() { this->parents_ = new std::set<const Identifier*>(); }
 
             /** @brief Returns the MetaObjectList of the object, containing a link to all ObjectLists and ObjectListElements the object is registered in. @return The list */
@@ -157,5 +157,5 @@
         private:
             Identifier* identifier_;                    //!< The Identifier of the object
-            std::list<const Identifier*>* parents_;     //!< List of all parents of the object
+            std::set<const Identifier*>* parents_;     //!< List of all parents of the object
             MetaObjectList metaList_;                   //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
     };
Index: code/trunk/src/orxonox/core/OutputHandler.cc
===================================================================
--- code/trunk/src/orxonox/core/OutputHandler.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/OutputHandler.cc	(revision 1052)
@@ -31,9 +31,12 @@
 */
 
-#include "DebugLevel.h"
+#include "CoreSettings.h"
 #include "OutputHandler.h"
+#include "ConsoleCommand.h"
 
 namespace orxonox
 {
+    ConsoleCommandShortcutGeneric(log, createExecutor(createFunctor(&OutputHandler::log), "log", AccessLevel::None));
+
     /**
         @brief Constructor: Opens the logfile and writes the first line.
@@ -44,5 +47,5 @@
         this->logfilename_ = logfilename;
         this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
-        this->logfile_ << "Started log" << std::endl;
+        this->logfile_ << "Started log at yyyy/mm/dd hh:mm:ss" << std::endl;
         this->logfile_.flush();
     }
@@ -74,5 +77,5 @@
     int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device)
     {
-        return DebugLevel::getSoftDebugLevel(device);
+        return CoreSettings::getSoftDebugLevel(device);
     }
 
Index: code/trunk/src/orxonox/core/OutputHandler.h
===================================================================
--- code/trunk/src/orxonox/core/OutputHandler.h	(revision 1051)
+++ code/trunk/src/orxonox/core/OutputHandler.h	(revision 1052)
@@ -58,4 +58,8 @@
 
             static OutputHandler& getOutStream();
+
+            /** @brief Puts some text on the outstream. @param text The text */
+            static inline std::string log(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Returns a reference to the logfile. @return The logfile */
Index: code/trunk/src/orxonox/core/Tickable.cc
===================================================================
--- code/trunk/src/orxonox/core/Tickable.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/Tickable.cc	(revision 1052)
@@ -27,4 +27,5 @@
 
 #include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
 #include "Tickable.h"
 
Index: code/trunk/src/orxonox/core/XMLPort.cc
===================================================================
--- code/trunk/src/orxonox/core/XMLPort.cc	(revision 1051)
+++ code/trunk/src/orxonox/core/XMLPort.cc	(revision 1052)
@@ -29,62 +29,15 @@
 #include "Language.h"
 #include "Loader.h"
+#include "Namespace.h"
+#include "CoreIncludes.h"
 
 namespace orxonox
 {
-    // ###############################
-    // ###  XMLPortParamContainer  ###
-    // ###############################
-    XMLPortParamContainer::XMLPortParamContainer()
-    {
-        this->bAddedDescription_ = false;
-        this->bAddedDefaultValues_ = false;
-    }
-
-    XMLPortParamContainer& XMLPortParamContainer::description(const std::string description)
-    {
-        if (!this->bAddedDescription_)
-        {
-            this->description_ = std::string("XMLPortParamContainer::" + this->classname_ + "::" + this->paramname_);
-            AddLanguageEntry(this->description_, description);
-            this->bAddedDescription_ = true;
-        }
-
-        return (*this);
-    }
-
-    const std::string& XMLPortParamContainer::getDescription()
-    {
-        return GetLocalisation(this->description_);
-    }
-
-
     // ################################
     // ###  XMLPortObjectContainer  ###
     // ################################
-    XMLPortObjectContainer::XMLPortObjectContainer()
-    {
-        this->bAddedDescription_ = false;
-    }
-
-    XMLPortObjectContainer& XMLPortObjectContainer::description(const std::string description)
-    {
-        if (!this->bAddedDescription_)
-        {
-            this->description_ = std::string("XMLPortObjectContainer::" + this->classname_ + "::" + this->sectionname_);
-            AddLanguageEntry(this->description_, description);
-            this->bAddedDescription_ = true;
-        }
-
-        return (*this);
-    }
-
-    const std::string& XMLPortObjectContainer::getDescription()
-    {
-        return GetLocalisation(this->description_);
-    }
-
     bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier)
     {
-        return Loader::currentMask_s.isIncluded(identifier);
+        return ((!this->bApplyLoaderMask_) || identifier->isA(Class(Namespace)) || Loader::currentMask_s.isIncluded(identifier));
     }
 }
Index: code/trunk/src/orxonox/core/XMLPort.h
===================================================================
--- code/trunk/src/orxonox/core/XMLPort.h	(revision 1051)
+++ code/trunk/src/orxonox/core/XMLPort.h	(revision 1052)
@@ -32,6 +32,5 @@
 #include "util/MultiTypeMath.h"
 #include "util/tinyxml/ticpp.h"
-#include "util/SubString.h"
-#include "Functor.h"
+#include "Executor.h"
 #include "Debug.h"
 #include "CoreIncludes.h"
@@ -41,34 +40,54 @@
 
 
-#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, loading) \
-    orxonox::XMLPortClassParamContainer<classname>* xmlcontainer##loadfunction##savefunction = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \
-    if (!xmlcontainer##loadfunction##savefunction) \
+#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
+    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode)
+#define XMLPortParam_Template(classname, paramname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode) \
+    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode)
+
+#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
+    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
+#define XMLPortParamLoadOnly_Template(classname, paramname, loadtemplate, loadfunction, xmlelement, mode) \
+    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
+
+#define XMLPortParamGeneric(containername, classname, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
+    orxonox::XMLPortClassParamContainer<classname>* containername = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \
+    if (!containername) \
     { \
-        xmlcontainer##loadfunction##savefunction = new orxonox::XMLPortClassParamContainer<classname>(this->getIdentifier()->getName(), std::string(paramname), createFunctor(&classname::loadfunction), createFunctor(&classname::savefunction)); \
-        this->getIdentifier()->addXMLPortParamContainer(paramname, xmlcontainer##loadfunction##savefunction); \
+        containername = new orxonox::XMLPortClassParamContainer<classname>(std::string(paramname), loadexecutor, saveexecutor); \
+        this->getIdentifier()->addXMLPortParamContainer(paramname, containername); \
     } \
-    xmlcontainer##loadfunction##savefunction->port(this, xmlelement, loading)
-
-#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, loading) \
-    orxonox::XMLPortClassParamContainer<classname>* xmlcontainer##loadfunction##savefunction = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \
-    if (!xmlcontainer##loadfunction##savefunction) \
+    containername->port(this, xmlelement, mode)
+
+
+#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
+    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
+#define XMLPortObject_Template(classname, objectclass, sectionname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
+    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
+
+#define XMLPortObjectGeneric(containername, classname, objectclass, sectionname, loadexecutor, saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
+    orxonox::XMLPortClassObjectContainer<classname, objectclass>* containername = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(this->getIdentifier()->getXMLPortObjectContainer(sectionname)); \
+    if (!containername) \
     { \
-        xmlcontainer##loadfunction##savefunction = new orxonox::XMLPortClassParamContainer<classname>(this->getIdentifier()->getName(), std::string(paramname), createFunctor(&classname::loadfunction), 0); \
-        this->getIdentifier()->addXMLPortParamContainer(paramname, xmlcontainer##loadfunction##savefunction); \
+        containername = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(std::string(sectionname), loadexecutor, saveexecutor, bApplyLoaderMask, bLoadBefore); \
+        this->getIdentifier()->addXMLPortObjectContainer(sectionname, containername); \
     } \
-    xmlcontainer##loadfunction##savefunction->port(this, xmlelement, loading)
-
-#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, loading) \
-    orxonox::XMLPortClassObjectContainer<classname, objectclass>* xmlcontainer##loadfunction##savefunction = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(this->getIdentifier()->getXMLPortObjectContainer(sectionname)); \
-    if (!xmlcontainer##loadfunction##savefunction) \
-    { \
-        xmlcontainer##loadfunction##savefunction = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(this->getIdentifier()->getName(), std::string(sectionname), &classname::loadfunction, &classname::savefunction); \
-        this->getIdentifier()->addXMLPortObjectContainer(sectionname, xmlcontainer##loadfunction##savefunction); \
-    } \
-    xmlcontainer##loadfunction##savefunction->port(this, xmlelement, loading)
+    containername->port(this, xmlelement, mode)
 
 
 namespace orxonox
 {
+
+#ifndef _XMLPort_Mode__
+#define _XMLPort_Mode__
+    namespace XMLPort
+    {
+        enum Mode
+        {
+            LoadObject,
+            SaveObject
+        };
+    }
+#endif
+
     // ###############################
     // ###  XMLPortParamContainer  ###
@@ -76,33 +95,33 @@
     class _CoreExport XMLPortParamContainer
     {
+        enum ParseResult
+        {
+            PR_not_started,
+            PR_finished,
+            PR_waiting_for_default_values
+        };
+
         public:
-            XMLPortParamContainer();
+            XMLPortParamContainer()
+                { this->parseResult_ = PR_not_started; }
+            virtual ~XMLPortParamContainer() {}
 
             inline const std::string& getName() const
                 { return this->paramname_; }
 
-            XMLPortParamContainer& description(const std::string description);
-            const std::string& getDescription();
-
-            XMLPortParamContainer& defaultValues(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-            {
-                this->defaultValues_[0] = param1;
-                this->defaultValues_[1] = param2;
-                this->defaultValues_[2] = param3;
-                this->defaultValues_[3] = param4;
-                this->defaultValues_[4] = param5;
-
-                return (*this);
-            }
+            virtual XMLPortParamContainer& description(const std::string description) = 0;
+            virtual const std::string& getDescription() = 0;
+
+            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiTypeMath& param) = 0;
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1) = 0;
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2) = 0;
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) = 0;
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) = 0;
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) = 0;
 
         protected:
-            std::string classname_;
             std::string paramname_;
-            MultiTypeMath defaultValues_[5];
-
-        private:
-            LanguageEntryLabel description_;
-            bool bAddedDescription_;
-            bool bAddedDefaultValues_;
+            ParseResult parseResult_;
+
     };
 
@@ -110,51 +129,37 @@
     class XMLPortClassParamContainer : public XMLPortParamContainer
     {
+        struct ParseParams
+        {
+            T* object;
+            Element* xmlelement;
+            XMLPort::Mode mode;
+        };
+
         public:
-            XMLPortClassParamContainer(const std::string classname, const std::string paramname, FunctorMember<T>* loadfunction, FunctorMember<T>* savefunction)
-            {
-                this->classname_ = classname;
+            XMLPortClassParamContainer(const std::string paramname, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor)
+            {
                 this->paramname_ = paramname;
-                this->loadfunction_ = loadfunction;
-                this->savefunction_ = savefunction;
-            }
-
-            XMLPortParamContainer& port(T* object, Element& xmlelement, bool loading)
-            {
-                if (loading)
+                this->loadexecutor_ = loadexecutor;
+                this->saveexecutor_ = saveexecutor;
+            }
+
+            XMLPortParamContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
+            {
+                this->parseParams_.object = object;
+                this->parseParams_.xmlelement = &xmlelement;
+                this->parseParams_.mode = mode;
+
+                if (mode == XMLPort::LoadObject)
                 {
                     try
                     {
                         std::string attribute = xmlelement.GetAttribute(this->paramname_);
-                        if (attribute.size() > 0)
+                        if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet()))
                         {
-                            SubString tokens(attribute, ",", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
-                            if ((unsigned int)tokens.size() >= (unsigned int)this->loadfunction_->getParamCount())
-                            {
-                                COUT(5) << object->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->classname_ << " (objectname " << object->getName() << ") with ";
-                                if (this->loadfunction_->getParamCount() == 1)
-                                {
-                                    COUT(5) << "1 parameter (using whole string):" << std::endl;
-                                    COUT(5) << object->getLoaderIndentation() << "  " << attribute << std::endl;
-                                    (*this->loadfunction_)(object, MultiTypeMath(attribute));
-                                }
-                                else
-                                {
-                                    COUT(5) << tokens.size() << " parameter (using MultiTypeMath)." << std::endl;
-                                    MultiTypeMath param1 = MT_null, param2 = MT_null, param3 = MT_null, param4 = MT_null, param5 = MT_null;
-                                    if (tokens.size() >= 1) param1 = tokens[0];
-                                    if (tokens.size() >= 2) param2 = tokens[1];
-                                    if (tokens.size() >= 3) param3 = tokens[2];
-                                    if (tokens.size() >= 4) param4 = tokens[3];
-                                    if (tokens.size() >= 5) param5 = tokens[4];
-                                    COUT(5) << object->getLoaderIndentation() << "  " << attribute << std::endl;
-                                    COUT(5) << object->getLoaderIndentation() << "  " << param1 << ", " << param2 << ", " << param3 << ", " << param4 << ", " << param5 << std::endl;
-
-                                    (*this->loadfunction_)(object, param1, param2, param3, param4, param5);
-                                }
-                            }
+                            COUT(5) << object->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << object->getIdentifier()->getName() << " (objectname " << object->getName() << ")." << std::endl << object->getLoaderIndentation();
+                            if (this->loadexecutor_->parse(object, attribute, ","))
+                                this->parseResult_ = PR_finished;
                             else
-                            {
-                                COUT(2) << object->getLoaderIndentation() << "Warning: Parameter \"" << this->paramname_ << "\" in \"" << this->classname_ << "\" (objectname: " << object->getName() << ") is incomplete and couln't be loaded." << std::endl;
-                            }
+                                this->parseResult_ = PR_waiting_for_default_values;
                         }
                     }
@@ -162,5 +167,5 @@
                     {
                         COUT(1) << std::endl;
-                        COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->classname_ << "' (objectname: " << object->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
+                        COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << object->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
                         COUT(1) << ex.what() << std::endl;
                     }
@@ -168,5 +173,5 @@
                 else
                 {
-                    if (this->savefunction_)
+                    if (this->saveexecutor_)
                     {
 //                        xmlelement.SetAttribute(this->paramname_, "...");
@@ -177,7 +182,63 @@
             }
 
+            XMLPortParamContainer& port(const ParseParams& parseParams)
+            {
+                return this->port(parseParams.object, *parseParams.xmlelement, parseParams.mode);
+            }
+
+            XMLPortParamContainer& portIfWaitingForDefaultValues(const ParseResult& result, const ParseParams& params)
+            {
+                if (result == PR_waiting_for_default_values)
+                    return this->port(params);
+                else
+                    return (*this);
+            }
+
+            virtual XMLPortParamContainer& description(const std::string description)
+                { this->loadexecutor_->setDescription(description); return (*this); }
+            virtual const std::string& getDescription()
+                { return this->loadexecutor_->getDescription(); }
+
+            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiTypeMath& param)
+            {
+                if (!this->loadexecutor_->defaultValueSet(index))
+                    this->loadexecutor_->setDefaultValue(index, param);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1)
+            {
+                if (!this->loadexecutor_->defaultValueSet(0))
+                    this->loadexecutor_->setDefaultValues(param1);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
+            {
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)))
+                    this->loadexecutor_->setDefaultValues(param1, param2);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
+            {
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)))
+                    this->loadexecutor_->setDefaultValues(param1, param2, param3);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
+            {
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)))
+                    this->loadexecutor_->setDefaultValues(param1, param2, param3, param4);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+            virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
+            {
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)) || (!this->loadexecutor_->defaultValueSet(4)))
+                    this->loadexecutor_->setDefaultValues(param1, param2, param3, param4, param5);
+                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
+            }
+
         private:
-            FunctorMember<T>* loadfunction_;
-            FunctorMember<T>* savefunction_;
+            ExecutorMember<T>* loadexecutor_;
+            ExecutorMember<T>* saveexecutor_;
+            ParseParams parseParams_;
     };
 
@@ -189,20 +250,20 @@
     {
         public:
-            XMLPortObjectContainer();
+            XMLPortObjectContainer()
+                { this->bApplyLoaderMask_ = false; }
+            virtual ~XMLPortObjectContainer() {}
 
             inline const std::string& getName() const
                 { return this->sectionname_; }
 
-            XMLPortObjectContainer& description(const std::string description);
-            const std::string& getDescription();
-            static bool identifierIsIncludedInLoaderMask(const Identifier* identifier);
+            virtual XMLPortObjectContainer& description(const std::string description) = 0;
+            virtual const std::string& getDescription() = 0;
+
+            bool identifierIsIncludedInLoaderMask(const Identifier* identifier);
 
         protected:
-            std::string classname_;
             std::string sectionname_;
-
-        private:
-            LanguageEntryLabel description_;
-            bool bAddedDescription_;
+            bool bApplyLoaderMask_;
+            bool bLoadBefore_;
     };
 
@@ -211,23 +272,28 @@
     {
         public:
-            XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int))
-            {
-                this->classname_ = classname;
+            XMLPortClassObjectContainer(const std::string sectionname, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
+            {
                 this->sectionname_ = sectionname;
-                this->loadfunction_ = loadfunction;
-                this->savefunction_ = savefunction;
-            }
-
-            XMLPortObjectContainer& port(T* object, Element& xmlelement, bool loading)
-            {
-                if (loading)
+                this->loadexecutor_ = loadexecutor;
+                this->saveexecutor_ = saveexecutor;
+                this->bApplyLoaderMask_ = bApplyLoaderMask;
+                this->bLoadBefore_ = bLoadBefore;
+            }
+
+            XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
+            {
+                if (mode == XMLPort::LoadObject)
                 {
                     try
                     {
-                        Element* xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
+                        Element* xmlsubelement;
+                        if ((this->sectionname_ != "") && (this->sectionname_.size() > 0))
+                            xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
+                        else
+                            xmlsubelement = &xmlelement;
 
                         if (xmlsubelement)
                         {
-                            for ( ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++ )
+                            for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
                             {
                                 Identifier* identifier = ID(child->Value());
@@ -239,11 +305,27 @@
                                         {
                                             COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
+
                                             O* newObject = (O*)identifier->fabricate();
                                             newObject->setLoaderIndentation(object->getLoaderIndentation() + "  ");
                                             newObject->setLevel(object->getLevel());
-                                            newObject->XMLPort(*child, true);
-                                            COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->classname_ << " (objectname " << object->getName() << ")" << std::endl;
-                                            (*object.*this->loadfunction_)(newObject);
-                                            COUT(5) << "  ...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
+                                            newObject->setNamespace(object->getNamespace());
+
+                                            if (this->bLoadBefore_)
+                                            {
+                                                newObject->XMLPort(*child, XMLPort::LoadObject);
+                                                COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << object->getIdentifier()->getName() << " (objectname " << object->getName() << ")" << std::endl;
+                                            }
+                                            else
+                                            {
+                                                COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << object->getIdentifier()->getName() << " (objectname " << object->getName() << ")" << std::endl;
+                                            }
+
+                                            COUT(5) << object->getLoaderIndentation();
+                                            (*this->loadexecutor_)(object, newObject);
+
+                                            if (!this->bLoadBefore_)
+                                                newObject->XMLPort(*child, XMLPort::LoadObject);
+
+                                            COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
                                         }
                                     }
@@ -263,5 +345,5 @@
                     {
                         COUT(1) << std::endl;
-                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->classname_ << "' (objectname: " << object->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
+                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << object->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
                         COUT(1) << ex.what() << std::endl;
                     }
@@ -274,7 +356,12 @@
             }
 
+            virtual XMLPortObjectContainer& description(const std::string description)
+                { this->loadexecutor_->setDescription(description); return (*this); }
+            virtual const std::string& getDescription()
+                { return this->loadexecutor_->getDescription(); }
+
         private:
-            void     (T::*loadfunction_)(O*);
-            const O* (T::*savefunction_)(unsigned int);
+            ExecutorMember<T>* loadexecutor_;
+            ExecutorMember<T>* saveexecutor_;
     };
 }
Index: code/trunk/src/orxonox/objects/Ambient.cc
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/Ambient.cc	(revision 1052)
@@ -42,12 +42,18 @@
 #include "GraphicsEngine.h"
 #include "core/XMLPort.h"
+#include "core/ConsoleCommand.h"
 
 namespace orxonox
 {
+    ConsoleCommand(Ambient, setAmbientLightTest, AccessLevel::Offline, false).setDefaultValues(ColourValue(1, 1, 1, 1));
+
     CreateFactory(Ambient);
+
+    Ambient* Ambient::instance_s;
 
     Ambient::Ambient()
     {
         RegisterObject(Ambient);
+        Ambient::instance_s = this;
     }
 
@@ -84,9 +90,9 @@
         @return The XML-element
     */
-    void Ambient::XMLPort(Element& xmlelement, bool loading)
+    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, loading);
+        BaseObject::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
+        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     }
 }
Index: code/trunk/src/orxonox/objects/Ambient.h
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.h	(revision 1051)
+++ code/trunk/src/orxonox/objects/Ambient.h	(revision 1052)
@@ -43,9 +43,12 @@
 
             void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setAmbientLight(const ColourValue& colour);
 
+            static void setAmbientLightTest(const ColourValue& colour)
+                { Ambient::instance_s->setAmbientLight(colour); }
+
         private:
-
+            static Ambient* instance_s;
 
     };
Index: code/trunk/src/orxonox/objects/Explosion.cc
===================================================================
--- code/trunk/src/orxonox/objects/Explosion.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/Explosion.cc	(revision 1052)
@@ -34,4 +34,6 @@
 
 #include "core/CoreIncludes.h"
+#include "core/Executor.h"
+
 #include "util/Math.h"
 #include "GraphicsEngine.h"
@@ -51,5 +53,5 @@
         if (owner)
         {
-            this->destroyTimer_.setTimer(this->lifetime_, false, this, &Explosion::destroyObject);
+            this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Explosion::destroyObject)));
 
             Vector3 position = owner->getNode()->getWorldPosition();
Index: code/trunk/src/orxonox/objects/Model.cc
===================================================================
--- code/trunk/src/orxonox/objects/Model.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/Model.cc	(revision 1052)
@@ -68,9 +68,9 @@
         @return The XML-element
     */
-    void Model::XMLPort(Element& xmlelement, bool loading)
+    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        WorldEntity::XMLPort(xmlelement, loading);
+        WorldEntity::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, loading);
+        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
 
         create();
@@ -84,5 +84,6 @@
     bool Model::create(){
       WorldEntity::create();
-      if(meshSrc_.compare("")!=0){
+      if ((this->meshSrc_ != "") && (this->meshSrc_.size() > 0))
+      {
         this->mesh_.setMesh(meshSrc_);
         this->attachObject(this->mesh_.getEntity());
Index: code/trunk/src/orxonox/objects/Model.h
===================================================================
--- code/trunk/src/orxonox/objects/Model.h	(revision 1051)
+++ code/trunk/src/orxonox/objects/Model.h	(revision 1052)
@@ -43,5 +43,5 @@
             virtual ~Model();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setMesh(const std::string& meshname);
             bool create();
Index: code/trunk/src/orxonox/objects/Projectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/Projectile.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/Projectile.cc	(revision 1052)
@@ -29,5 +29,8 @@
 #include "Projectile.h"
 
-#include "../core/CoreIncludes.h"
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "core/ConfigValueIncludes.h"
+
 #include "SpaceShip.h"
 #include "Explosion.h"
@@ -59,5 +62,5 @@
         }
 
-        this->destroyTimer_.setTimer(this->lifetime_, false, this, &Projectile::destroyObject);
+        this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
     }
 
@@ -70,4 +73,6 @@
         SetConfigValue(lifetime_, 10.0).description("The time in seconds a projectile stays alive");
         SetConfigValue(speed_, 2000.0).description("The speed of a projectile in units per second");
+
+        this->setVelocity(Vector3(1, 0, 0) * this->speed_);
     }
 
Index: code/trunk/src/orxonox/objects/Skybox.cc
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/Skybox.cc	(revision 1052)
@@ -76,9 +76,9 @@
         @return The XML-element
     */
-    void Skybox::XMLPort(Element& xmlelement, bool loading)
+    void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, loading);
+        BaseObject::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading);
+        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, mode);
     }
 }
Index: code/trunk/src/orxonox/objects/Skybox.h
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.h	(revision 1051)
+++ code/trunk/src/orxonox/objects/Skybox.h	(revision 1052)
@@ -15,5 +15,5 @@
 
             void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setSkybox(const std::string& skyboxname);
 
Index: code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1052)
@@ -41,4 +41,5 @@
 #include "util/Math.h"
 #include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
 #include "GraphicsEngine.h"
@@ -47,8 +48,16 @@
 #include "Projectile.h"
 #include "core/XMLPort.h"
+#include "core/ConsoleCommand.h"
 
 namespace orxonox
 {
+    ConsoleCommand(SpaceShip, setMaxSpeedTest, AccessLevel::Debug, false);
+    ConsoleCommandGeneric(test1, SpaceShip, createExecutor(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxSpeed", AccessLevel::Debug), false);
+    ConsoleCommandGeneric(test2, SpaceShip, createExecutor(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxBlubber", AccessLevel::Debug), false);
+    ConsoleCommandGeneric(test3, SpaceShip, createExecutor(createFunctor(&SpaceShip::setMaxSpeedTest), "setRofl", AccessLevel::Debug), false);
+
     CreateFactory(SpaceShip);
+
+    SpaceShip* SpaceShip::instance_s;
 
     SpaceShip::SpaceShip()
@@ -56,4 +65,6 @@
         RegisterObject(SpaceShip);
         this->registerAllVariables();
+
+        SpaceShip::instance_s = this;
 
         this->setConfigValues();
@@ -309,16 +320,16 @@
         @return The XML-element
     */
-    void SpaceShip::XMLPort(Element& xmlelement, bool loading)
-    {
-        Model::XMLPort(xmlelement, loading);
-
-        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, loading);
+    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        Model::XMLPort(xmlelement, mode);
+
+        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
     }
 
Index: code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1051)
+++ code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1052)
@@ -49,5 +49,5 @@
             void setConfigValues();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
 
@@ -61,4 +61,7 @@
             void setRotDamp(float value);
 
+            static void setMaxSpeedTest(float value)
+                { SpaceShip::instance_s->setMaxSpeed(value); }
+
             bool mouseMoved(const OIS::MouseEvent &e);
             bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
@@ -67,4 +70,6 @@
 
         private:
+            static SpaceShip* instance_s;
+
             Vector3 testvector_;
             bool bInvertYAxis_;
Index: code/trunk/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1051)
+++ code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1052)
@@ -176,16 +176,16 @@
         @return The XML-element
     */
-    void WorldEntity::XMLPort(Element& xmlelement, bool loading)
-    {
-        BaseObject::XMLPort(xmlelement, loading);
-
-        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading);
-        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading);
-        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading);
-        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading);
-        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading);
-        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading);
-
-        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading);
+    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlelement, mode);
+
+        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
+        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, mode);
+        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);
+        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
+
+        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true);
     }
 
@@ -219,5 +219,5 @@
     }
 
-    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index)
+    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index) const
     {
         if (index < this->attachedWorldEntities_.size())
Index: code/trunk/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1051)
+++ code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1052)
@@ -51,9 +51,9 @@
             virtual void tick(float dt);
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             inline bool create(){ return true; }
 
             void attachWorldEntity(WorldEntity* entity);
-            const WorldEntity* getAttachedWorldEntity(unsigned int index);
+            const WorldEntity* getAttachedWorldEntity(unsigned int index) const;
 
             inline Ogre::SceneNode* getNode()
Index: code/trunk/src/orxonox/tools/Timer.cc
===================================================================
--- code/trunk/src/orxonox/tools/Timer.cc	(revision 1051)
+++ code/trunk/src/orxonox/tools/Timer.cc	(revision 1052)
@@ -27,10 +27,38 @@
 
 #include "OrxonoxStableHeaders.h"
+#include "core/Executor.h"
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/CommandExecutor.h"
 #include "Timer.h"
-
-#include "core/CoreIncludes.h"
 
 namespace orxonox
 {
+    ConsoleCommandShortcutExtern(delay, AccessLevel::None);
+
+    /**
+        @brief Calls a console command after 'delay' seconds.
+        @param delay The delay in seconds
+        @param command The console command
+    */
+    void delay(float delay, const std::string& command)
+    {
+        StaticTimer *delaytimer = new StaticTimer();
+        ExecutorStatic* delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
+        delayexecutor->setDefaultValues(delaytimer, command);
+        delaytimer->setTimer(delay, false, delayexecutor);
+    }
+
+    /**
+        @brief Executes the command.
+        @param timer The timer to destroy after the command-execution
+        @param command The command to execute
+    */
+    void executeDelayedCommand(StaticTimer* timer, const std::string& command)
+    {
+        CommandExecutor::execute(command);
+        delete timer;
+    }
+
     /**
         @brief Constructor: Sets the default-values.
@@ -40,4 +68,5 @@
         RegisterRootObject(TimerBase);
 
+        this->executor_ = 0;
         this->interval_ = 0;
         this->bLoop_ = false;
@@ -45,4 +74,20 @@
 
         this->time_ = 0;
+    }
+
+    /**
+        @brief Deletes the executor.
+    */
+    TimerBase::~TimerBase()
+    {
+        delete this->executor_;
+    }
+
+    /**
+        @brief Executes the executor.
+    */
+    void TimerBase::run() const
+    {
+        (*this->executor_)();
     }
 
Index: code/trunk/src/orxonox/tools/Timer.h
===================================================================
--- code/trunk/src/orxonox/tools/Timer.h	(revision 1051)
+++ code/trunk/src/orxonox/tools/Timer.h	(revision 1052)
@@ -43,7 +43,9 @@
 
     source.cc:
+        include "core/Executor.h"
+
         ClassName::ClassName()
         {
-            myTimer.setTimer(interval_in_seconds, bLoop, this, &ClassName::functionName);
+            myTimer.setTimer(interval_in_seconds, bLoop, this, createExecutor(createFunctor(&ClassName::functionName)));
         }
 
@@ -59,36 +61,61 @@
 
 #include "OrxonoxPrereqs.h"
-
+#include "core/CorePrereqs.h"
 #include "core/Tickable.h"
 
 namespace orxonox
 {
+    class StaticTimer;
+    void delay(float delay, const std::string& command);
+    void executeDelayedCommand(StaticTimer* timer, const std::string& command);
+
     //! TimerBase is the parent of the Timer class.
     class _OrxonoxExport TimerBase : public Tickable
     {
         public:
-            TimerBase();
+            ~TimerBase();
 
-            virtual void run() const = 0;
+            void run() const;
 
             /** @brief Starts the Timer: Function-call after 'interval' seconds. */
-            inline void startTimer() { this->bActive_ = true; this->time_ = this->interval_; }
+            inline void startTimer()
+                { this->bActive_ = true; this->time_ = this->interval_; }
             /** @brief Stops the Timer. */
-            inline void stopTimer() { this->bActive_ = false; this->time_ = this->interval_; }
+            inline void stopTimer()
+                { this->bActive_ = false; this->time_ = this->interval_; }
             /** @brief Pauses the Timer - it will continue with the actual state if you unpause it. */
-            inline void pauseTimer() { this->bActive_ = false; }
+            inline void pauseTimer()
+                { this->bActive_ = false; }
             /** @brief Unpauses the Timer - continues with the given state. */
-            inline void unpauseTimer() { this->bActive_ = true; }
+            inline void unpauseTimer()
+                { this->bActive_ = true; }
             /** @brief Returns true if the Timer is active (= not stoped, not paused). @return True = Time is active */
-            inline bool isActive() const { return this->bActive_; }
+            inline bool isActive() const
+                { return this->bActive_; }
+            /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
+            inline void addTime(float time)
+                { this->time_ += time; }
+            /** @brief Decreases the remaining time of the Timer. @param time The amount of time to remove */
+            inline void removeTime(float time)
+                { this->time_ -= time; }
+            /** @brief Sets the interval of the Timer. @param interval The interval */
+            inline void setInterval(float interval)
+                { this->interval_ = interval; }
+            /** @brief Sets bLoop to a given value. @param bLoop True = loop */
+            inline void setLoop(bool bLoop)
+                { this->bLoop_ = bLoop; }
 
             void tick(float dt);
 
         protected:
-            float interval_;    //!< The time-interval in seconds
-            bool bLoop_;        //!< If true, the function gets called every 'interval' seconds
-            bool bActive_;      //!< If true, the Timer ticks and calls the function if the time's up
+            TimerBase();
 
-            float time_;        //!< Internal variable, counting the time till the next function-call
+            Executor* executor_; //!< The executor of the function that should be called when the time expires
+
+            float interval_;     //!< The time-interval in seconds
+            bool bLoop_;         //!< If true, the function gets called every 'interval' seconds
+            bool bActive_;       //!< If true, the Timer ticks and calls the function if the time's up
+
+            float time_;         //!< Internal variable, counting the time till the next function-call
     };
 
@@ -98,10 +125,5 @@
     {
         public:
-            /** @brief Constructor: Sets the default-values. */
-            Timer()
-            {
-                this->timerFunction_ = 0;
-                this->object_ = 0;
-            }
+            Timer() {}
 
             /**
@@ -110,9 +132,9 @@
                 @param bLoop If true, the function gets called every 'interval' seconds
                 @param object The object owning the timer and the function
-                @param timerFunction A function pointer to the function to call
+                @param exeuctor A executor of the function to call
             */
-            Timer(float interval, bool bLoop, T* object, void (T::*timerFunction)())
+            Timer(float interval, bool bLoop, T* object, ExecutorMember<T>* exeuctor)
             {
-                this->setTimer(interval, bLoop, timerFunction, object);
+                this->setTimer(interval, bLoop, object, exeuctor);
             }
 
@@ -122,26 +144,51 @@
                 @param bLoop If true, the function gets called every 'interval' seconds
                 @param object The object owning the timer and the function
-                @param timerFunction A function pointer to the function to call
+                @param exeuctor A executor of the function to call
             */
-            void setTimer(float interval, bool bLoop, T* object, void (T::*timerFunction)())
+            void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor)
             {
                 this->interval_ = interval;
                 this->bLoop_ = bLoop;
-                this->timerFunction_ = timerFunction;
-                this->object_ = object;
+                executor->setObject(object);
+                this->executor_ = (Executor*)executor;
                 this->bActive_ = true;
 
                 this->time_ = interval;
             }
+    };
 
-            /** @brief Calls the given function of the given object. */
-            void run() const
+    //! The StaticTimer is a callback-object, calling a static function after a given time-interval.
+    class StaticTimer : public TimerBase
+    {
+        public:
+            StaticTimer() {}
+
+            /**
+                @brief Constructor: Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param exeuctor A executor of the function to call
+            */
+            StaticTimer(float interval, bool bLoop, ExecutorStatic* executor)
             {
-                ((*this->object_).*timerFunction_)();
+                this->setTimer(interval, bLoop, executor);
             }
 
-        private:
-            void (T::*timerFunction_)();
-            T* object_;
+            /**
+                @brief Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param object The object owning the timer and the function
+                @param executor A executor of the function to call
+            */
+            void setTimer(float interval, bool bLoop, ExecutorStatic* executor)
+            {
+                this->interval_ = interval;
+                this->bLoop_ = bLoop;
+                this->executor_ = (Executor*)executor;
+                this->bActive_ = true;
+
+                this->time_ = interval;
+            }
     };
 
Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 1051)
+++ code/trunk/src/util/CMakeLists.txt	(revision 1052)
@@ -8,4 +8,5 @@
   Math.cc
   String.cc
+  Clipboard.cc
   SubString.cc
   MultiTypePrimitive.cc
Index: code/trunk/src/util/Clipboard.cc
===================================================================
--- code/trunk/src/util/Clipboard.cc	(revision 1052)
+++ code/trunk/src/util/Clipboard.cc	(revision 1052)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ *   Windows version inspired by "Copy Text To Clipboard" by Laszlo Szathmary, 2007
+ *      http://www.loria.fr/~szathmar/off/projects/C/CopyTextToClipboard/index.php
+ */
+
+#include "Clipboard.h"
+
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+    #include <windows.h>
+
+    bool toClipboard(std::string text)
+    {
+        try
+        {
+            if (OpenClipboard(0))
+            {
+                EmptyClipboard();
+                HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, text.size() + 1);
+                char* buffer = (char*)GlobalLock(clipbuffer);
+                strcpy(buffer, text.c_str());
+                GlobalUnlock(clipbuffer);
+                SetClipboardData(CF_TEXT, clipbuffer);
+                CloseClipboard();
+
+                return true;
+            }
+        }
+        catch (...)
+        {
+        }
+        return false;
+    }
+
+    std::string fromClipboard()
+    {
+        try
+        {
+            if (OpenClipboard(0))
+            {
+                HANDLE hData = GetClipboardData(CF_TEXT);
+                std::string output = (char*)GlobalLock(hData);
+                GlobalUnlock(hData);
+                CloseClipboard();
+
+                return output;
+            }
+        }
+        catch (...)
+        {
+        }
+        return "";
+    }
+#else
+    std::string clipboard = "";
+
+    bool toClipboard(std::string text)
+    {
+        clipboard = text;
+        return true;
+    }
+
+    std::string fromClipboard()
+    {
+        return clipboard;
+    }
+#endif
Index: code/trunk/src/util/Clipboard.h
===================================================================
--- code/trunk/src/util/Clipboard.h	(revision 1052)
+++ code/trunk/src/util/Clipboard.h	(revision 1052)
@@ -0,0 +1,41 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Clipboard_H__
+#define _Clipboard_H__
+
+#include <string>
+
+#include "UtilPrereqs.h"
+
+
+_UtilExport bool toClipboard(std::string text);
+_UtilExport std::string fromClipboard();
+
+
+#endif /* _Clipboard_H__ */
+
Index: code/trunk/src/util/Convert.h
===================================================================
--- code/trunk/src/util/Convert.h	(revision 1051)
+++ code/trunk/src/util/Convert.h	(revision 1052)
@@ -21,6 +21,7 @@
  *   Author:
  *      Benjamin Grauer
+ *      Fabian 'x3n' Landau
  *   Co-authors:
- *      Fabian 'x3n' Landau
+ *      ...
  */
 
@@ -42,101 +43,267 @@
 
 
-// DEFAULT CLASS
-template <typename FromType, typename ToType>
-class Converter
-{
-  public:
-    bool operator()(ToType* output, const FromType& input) const
-    {
-      return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT TO STRINGS
-template<typename FromType>
-class Converter<FromType, std::string>
-{
-  public:
-    bool operator()(std::string* output, const FromType& input) const
-    {
-      std::ostringstream oss;
-      if (oss << input)
-      {
-        (*output) = oss.str();
+//////////
+// MAIN //
+//////////
+
+// Enum to declare the wanted conversion preference in case of equal type-levels
+enum ConversionPreference
+{
+    CP_PreferToType,
+    CP_PreferFromType,
+};
+
+// Helper classes to determine the preferred partial template specialization
+class _ToType_   {};
+class _FromType_ {};
+class _Explicit_ {};
+
+
+// The default convert functions
+template <class FromType, class ToType, class Type>
+struct ConverterSpecialized
+{
+    enum { specialized = false };
+    static bool convert(ToType* output, const FromType& input)
+    { return false; }
+};
+
+
+// The default convert function if both types are the same
+template <class BothTypes>
+struct ConverterSpecialized<BothTypes, BothTypes, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(BothTypes* output, const BothTypes& input)
+    { (*output) = input; return true; }
+};
+
+
+// The possible levels
+#define __low__  0 // Everything that is or behaves like a primitive type (an can be converted with a typecast to every other low-level type)
+#define __mid__  1 // Everything that has overloaded << and >> operators to operate on a std::stream
+#define __high__ 2 // Everything that doesn't fullfill the lowerlevel-requirements and therefore needs specialized conversions
+
+// Defines the levels of all types: Default is __high__ so you don't have to define every high-level type
+template <class T> struct ConverterLevel           { enum { level = __high__ }; };
+template <> struct ConverterLevel<std::string>     { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Radian> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Degree> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<int>             { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned int>    { enum { level = __low__ }; };
+template <> struct ConverterLevel<char>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned char>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<short>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned short>  { enum { level = __low__ }; };
+template <> struct ConverterLevel<long>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned long>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<float>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<double>          { enum { level = __low__ }; };
+template <> struct ConverterLevel<long double>     { enum { level = __low__ }; };
+template <> struct ConverterLevel<bool>            { enum { level = __low__ }; };
+
+
+// Calculates the preference based on the levels of FromType and ToType
+template <int from, int to>
+struct ConverterPreference
+{
+    enum
+    {
+        // The maximum of both levels: element of {0, 1, 2}
+        // max 0: Both types are primitives or have a similar behaviour
+        // max 1: At least one type is not a primitive, but both can be put on a std::stream
+        // max 2: There is at least one generic type that needs specialized conversions
+        max = (from > to) ? from : to,
+
+        // The difference between both levels limited to +-1: element of {-1, 0, 1}
+        // diff -1: The FromType has higher level than the ToType
+        // diff  0: Both types have the same level
+        // diff  1: The ToType has higher level than the FromType
+        diff = ((to - from) > 1) ? 1 : (((to - from) < -1) ? -1 : to - from)
+    };
+};
+
+
+// The default conversion: This usually does nothing
+template <int max, class FromType, class ToType>
+struct ConverterDefault
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// The default conversion for primitives: A typecast (defined over two partial specialized templates to exclude all non-primitive types and classes)    template <int max, class FromType, class ToType>
+template <class FromType, class ToType>
+struct ConverterDefault<0, FromType, ToType>
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        (*output) = (ToType)input;
         return true;
-      }
-      else
-        return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM STRING
-template<typename ToType>
-class Converter<std::string, ToType>
-{
-  public:
-    bool operator()(ToType* output, const std::string& input) const
-    {
-      std::istringstream iss(input);
-      if (iss >> (*output))
+    }
+};
+
+
+// Converter: Converts input of FromType into output of ToType
+template <int diff, int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// Converter: level{FromType} > level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<-1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} < level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} = level{ToType}
+// CP_PreferToType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferToType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// CP_PreferFromType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferFromType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+
+
+// Calls the Converter::convertValue function with the correct template type parameters calculated by ConverterPreference
+template <class FromType, class ToType>
+static bool convertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return (preference == CP_PreferToType) ?
+           Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferToType>::convert(output, input)
+         : Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferFromType>::convert(output, input);
+}
+
+
+//////////////////////
+// HELPER FUNCTIONS //
+//////////////////////
+
+// Helper function: Calls convertValue with and without default value and returns true if the conversion was successful
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return convertValue(output, input, preference);
+}
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    if (convertValue(output, input, preference))
         return true;
-      else
-        return false;
-    }
-};
-
-// FUNCTION SO WE DO NOT HAVE TO TELL THE COMPILER ABOUT THE TYPE
-template<typename FromType, typename ToType>
-static bool ConvertValue(ToType* output, const FromType& input)
-{
-  Converter<FromType, ToType> converter;
-  return converter(output, input);
+
+    (*output) = fallback;
+    return false;
 }
 
-// THE SAME, BUT WITH DEFAULT VALUE
-template<typename FromType, typename ToType>
-static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
-{
-  Converter<FromType, ToType> converter;
-  if (converter(output, input))
-    return true;
-
-  (*output) = fallback;
-  return false;
+// Helper function: Calls convertValue with and without default value and returns the converted value
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = ToType();
+    ConvertValue(&output, input, preference);
+    return output;
 }
-
-// THE SAME LIKE BEFORE, BUT NEEDS NO POINTER TO THE OUTPUT
-template<typename FromType, typename ToType>
-static ToType ConvertValueAndReturn(const FromType& input)
-{
-  ToType output;
-  ConvertValue(&output, input);
-  return output;
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = fallback;
+    ConvertValue(&output, input, fallback, preference);
+    return output;
 }
 
-// THE SAME, BUT WITH DEFAULT VALUE
-template<typename FromType, typename ToType>
-static ToType ConvertValueAndReturn(const FromType& input, const FromType& fallback)
-{
-  ToType output;
-  ConvertValue(&output, input, fallback);
-  return output;
-}
-
-//////////////////////////
-// MORE SPECIALISATIONS //
-//////////////////////////
-
-// STRING TO STRING
-template<>
-class Converter<std::string, std::string>
-{
-  public:
-    bool operator()(std::string* output, const std::string& input) const
-    {
-        (*output) = std::string(input);
-        return true;
-    }
-};
+
+/////////////////////
+// SPECIALIZATIONS //
+/////////////////////
+
+/////////////
+// SAMPLES //
+/////////////
+/*
+// convert everything to xyz
+template <class FromType>
+struct ConverterSpecialized<FromType, xyz, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const FromType& input)
+    { return ...; }
+};
+
+// convert xyz to everything
+template <class ToType>
+struct ConverterSpecialized<xyz, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const xyz& input)
+    { return ...; }
+};
+
+// convert abc to xyz
+template <>
+struct ConverterSpecialized<abc, xyz, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const abc& input)
+    { return ...; }
+};
+*/
+
+////////////
+// STRING //
+////////////
+
+// convert to string
+template <class FromType>
+struct ConverterSpecialized<FromType, std::string, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const FromType& input)
+    {
+        std::ostringstream oss;
+        if (oss << input)
+        {
+            (*output) = oss.str();
+            return true;
+        }
+        else
+            return false;
+    }
+};
+
+// convert from string
+template <class ToType>
+struct ConverterSpecialized<std::string, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const std::string& input)
+    {
+        std::istringstream iss(input);
+        if (iss >> (*output))
+            return true;
+        else
+            return false;
+    }
+};
+
 
 ////////////////
@@ -144,147 +311,79 @@
 ////////////////
 
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPEPRIMITIVE
-template<typename ToType>
-class Converter<MultiTypePrimitive, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypePrimitive& input) const
-    {
-      if (input.getType() == MT_int)
-        return ConvertValue(output, input.getInt());
-      else if (input.getType() == MT_uint)
-        return ConvertValue(output, input.getUnsignedInt());
-      else if (input.getType() == MT_char)
-        return ConvertValue(output, input.getChar());
-      else if (input.getType() == MT_uchar)
-        return ConvertValue(output, input.getUnsignedChar());
-      else if (input.getType() == MT_short)
-        return ConvertValue(output, input.getShort());
-      else if (input.getType() == MT_ushort)
-        return ConvertValue(output, input.getUnsignedShort());
-      else if (input.getType() == MT_long)
-        return ConvertValue(output, input.getLong());
-      else if (input.getType() == MT_ulong)
-        return ConvertValue(output, input.getUnsignedLong());
-      else if (input.getType() == MT_float)
-        return ConvertValue(output, input.getFloat());
-      else if (input.getType() == MT_double)
-        return ConvertValue(output, input.getDouble());
-      else if (input.getType() == MT_longdouble)
-        return ConvertValue(output, input.getLongDouble());
-      else if (input.getType() == MT_bool)
-        return ConvertValue(output, input.getBool());
-      else
-        return false;
-    }
-};
-template<>
-class Converter<MultiTypePrimitive, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypePrimitive& input) const
-    {
-      if (input.getType() == MT_int)
-        return ConvertValue(output, input.getInt());
-      else if (input.getType() == MT_uint)
-        return ConvertValue(output, input.getUnsignedInt());
-      else if (input.getType() == MT_char)
-        return ConvertValue(output, input.getChar());
-      else if (input.getType() == MT_uchar)
-        return ConvertValue(output, input.getUnsignedChar());
-      else if (input.getType() == MT_short)
-        return ConvertValue(output, input.getShort());
-      else if (input.getType() == MT_ushort)
-        return ConvertValue(output, input.getUnsignedShort());
-      else if (input.getType() == MT_long)
-        return ConvertValue(output, input.getLong());
-      else if (input.getType() == MT_ulong)
-        return ConvertValue(output, input.getUnsignedLong());
-      else if (input.getType() == MT_float)
-        return ConvertValue(output, input.getFloat());
-      else if (input.getType() == MT_double)
-        return ConvertValue(output, input.getDouble());
-      else if (input.getType() == MT_longdouble)
-        return ConvertValue(output, input.getLongDouble());
-      else if (input.getType() == MT_bool)
-        return ConvertValue(output, input.getBool());
-      else
-        return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPESTRING
-template<typename ToType>
-class Converter<MultiTypeString, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypeString& input) const
-    {
-      if (input.getType() == MT_constchar)
-        return ConvertValue(output, input.getConstChar());
-      else if (input.getType() == MT_string)
-        return ConvertValue(output, input.getString());
-      else
-        return ConvertValue(output, (MultiTypePrimitive)input);
-    }
-};
-template<>
-class Converter<MultiTypeString, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypeString& input) const
-    {
-      if (input.getType() == MT_constchar)
-        return ConvertValue(output, input.getConstChar());
-      else if (input.getType() == MT_string)
-        return ConvertValue(output, input.getString());
-      else
-        return ConvertValue(output, (MultiTypePrimitive)input);
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPEMATH
-template<typename ToType>
-class Converter<MultiTypeMath, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypeMath& input) const
-    {
-      if (input.getType() == MT_vector2)
-        return ConvertValue(output, input.getVector2());
-      else if (input.getType() == MT_vector3)
-        return ConvertValue(output, input.getVector3());
-      else if (input.getType() == MT_quaternion)
-        return ConvertValue(output, input.getQuaternion());
-      else if (input.getType() == MT_colourvalue)
-        return ConvertValue(output, input.getColourValue());
-      else if (input.getType() == MT_radian)
-        return ConvertValue(output, input.getRadian());
-      else if (input.getType() == MT_degree)
-        return ConvertValue(output, input.getDegree());
-      else
-        return ConvertValue(output, (MultiTypeString)input);
-    }
-};
-template<>
-class Converter<MultiTypeMath, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypeMath& input) const
-    {
-      if (input.getType() == MT_vector2)
-        return ConvertValue(output, input.getVector2());
-      else if (input.getType() == MT_vector3)
-        return ConvertValue(output, input.getVector3());
-      else if (input.getType() == MT_quaternion)
-        return ConvertValue(output, input.getQuaternion());
-      else if (input.getType() == MT_colourvalue)
-        return ConvertValue(output, input.getColourValue());
-      else if (input.getType() == MT_radian)
-        return ConvertValue(output, input.getRadian());
-      else if (input.getType() == MT_degree)
-        return ConvertValue(output, input.getDegree());
-      else
-        return ConvertValue(output, (MultiTypeString)input);
+// convert from MultiTypePrimitive
+template <class ToType>
+struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypePrimitive& input)
+    {
+        if (input.getType() == MT_void)
+            return ConvertValue(output, input.getVoid());
+        else if (input.getType() == MT_int)
+            return ConvertValue(output, input.getInt());
+        else if (input.getType() == MT_uint)
+            return ConvertValue(output, input.getUnsignedInt());
+        else if (input.getType() == MT_char)
+            return ConvertValue(output, input.getChar());
+        else if (input.getType() == MT_uchar)
+            return ConvertValue(output, input.getUnsignedChar());
+        else if (input.getType() == MT_short)
+            return ConvertValue(output, input.getShort());
+        else if (input.getType() == MT_ushort)
+            return ConvertValue(output, input.getUnsignedShort());
+        else if (input.getType() == MT_long)
+            return ConvertValue(output, input.getLong());
+        else if (input.getType() == MT_ulong)
+            return ConvertValue(output, input.getUnsignedLong());
+        else if (input.getType() == MT_float)
+            return ConvertValue(output, input.getFloat());
+        else if (input.getType() == MT_double)
+            return ConvertValue(output, input.getDouble());
+        else if (input.getType() == MT_longdouble)
+            return ConvertValue(output, input.getLongDouble());
+        else if (input.getType() == MT_bool)
+            return ConvertValue(output, input.getBool());
+        else
+            return false;
+    }
+};
+
+// convert from MultiTypeString
+template <class ToType>
+struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeString& input)
+    {
+        if (input.getType() == MT_constchar)
+            return ConvertValue(output, input.getConstChar());
+        else if (input.getType() == MT_string)
+            return ConvertValue(output, input.getString());
+        else
+            return ConvertValue(output, (MultiTypePrimitive)input);
+    }
+};
+
+// convert from MultiTypeMath
+template <class ToType>
+struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeMath& input)
+    {
+        if (input.getType() == MT_vector2)
+            return ConvertValue(output, input.getVector2());
+        else if (input.getType() == MT_vector3)
+            return ConvertValue(output, input.getVector3());
+        else if (input.getType() == MT_quaternion)
+            return ConvertValue(output, input.getQuaternion());
+        else if (input.getType() == MT_colourvalue)
+            return ConvertValue(output, input.getColourValue());
+        else if (input.getType() == MT_radian)
+            return ConvertValue(output, input.getRadian());
+        else if (input.getType() == MT_degree)
+            return ConvertValue(output, input.getDegree());
+        else
+            return ConvertValue(output, (MultiTypeString)input);
     }
 };
@@ -297,17 +396,16 @@
 // Vector2 to std::string
 template <>
-class Converter<orxonox::Vector2, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector2& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector2, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector2& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -315,17 +413,16 @@
 // Vector3 to std::string
 template <>
-class Converter<orxonox::Vector3, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector3& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y << "," << input.z)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector3, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector3& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -333,17 +430,16 @@
 // Vector4 to std::string
 template <>
-class Converter<orxonox::Vector4, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector4& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector4, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector4& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -351,17 +447,16 @@
 // Quaternion to std::string
 template <>
-class Converter<orxonox::Quaternion, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Quaternion& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Quaternion, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Quaternion& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -369,17 +464,16 @@
 // ColourValue to std::string
 template <>
-class Converter<orxonox::ColourValue, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::ColourValue& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::ColourValue, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::ColourValue& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -392,25 +486,23 @@
 // std::string to Vector2
 template <>
-class Converter<std::string, orxonox::Vector2>
-{
-  public:
-    bool operator()(orxonox::Vector2* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 2)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector2, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector2* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 2)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -418,27 +510,25 @@
 // std::string to Vector3
 template <>
-class Converter<std::string, orxonox::Vector3>
-{
-  public:
-    bool operator()(orxonox::Vector3* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 3)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector3, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector3* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 3)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -446,29 +536,27 @@
 // std::string to Vector4
 template <>
-class Converter<std::string, orxonox::Vector4>
-{
-  public:
-    bool operator()(orxonox::Vector4* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->w), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector4, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector4* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->w), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -476,29 +564,27 @@
 // std::string to Quaternion
 template <>
-class Converter<std::string, orxonox::Quaternion>
-{
-  public:
-    bool operator()(orxonox::Quaternion* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->w), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->x), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Quaternion, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Quaternion* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->w), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->x), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -506,29 +592,27 @@
 // std::string to ColourValue
 template <>
-class Converter<std::string, orxonox::ColourValue>
-{
-  public:
-    bool operator()(orxonox::ColourValue* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->r), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->g), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->b), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->a), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::ColourValue, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::ColourValue* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->r), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->g), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->b), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->a), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
Index: code/trunk/src/util/Math.h
===================================================================
--- code/trunk/src/util/Math.h	(revision 1051)
+++ code/trunk/src/util/Math.h	(revision 1052)
@@ -26,6 +26,6 @@
  */
 
-#ifndef _Math_H__
-#define _Math_H__
+#ifndef _Util_Math_H__
+#define _Util_Math_H__
 
 #include <ostream>
@@ -146,4 +146,3 @@
 }
 
-#endif /* _Math_H__ */
-
+#endif /* _Util_Math_H__ */
Index: code/trunk/src/util/MultiType.h
===================================================================
--- code/trunk/src/util/MultiType.h	(revision 1051)
+++ code/trunk/src/util/MultiType.h	(revision 1052)
@@ -35,4 +35,5 @@
 {
     MT_null,
+    MT_void,
     MT_int,
     MT_uint,
@@ -49,4 +50,5 @@
     MT_constchar,
     MT_string,
+    MT_xmlelement,
     MT_vector2,
     MT_vector3,
@@ -59,4 +61,5 @@
 union _UtilExport MultiTypeValue
 {
+    void*           void_;
     int             int_;
     unsigned int    uint_;
Index: code/trunk/src/util/MultiTypeMath.cc
===================================================================
--- code/trunk/src/util/MultiTypeMath.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypeMath.cc	(revision 1052)
@@ -88,44 +88,46 @@
 }
 
+MultiTypeMath::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypeMath, void*>(*this, 0); }
 MultiTypeMath::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeMath, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypeMath, int>(*this, 0); }
 MultiTypeMath::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeMath, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypeMath, unsigned int>(*this, 0); }
 MultiTypeMath::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeMath, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypeMath, char>(*this, 0); }
 MultiTypeMath::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeMath, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypeMath, unsigned char>(*this, 0); }
 MultiTypeMath::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeMath, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypeMath, short>(*this, 0); }
 MultiTypeMath::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeMath, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypeMath, unsigned short>(*this, 0); }
 MultiTypeMath::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeMath, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypeMath, long>(*this, 0); }
 MultiTypeMath::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeMath, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypeMath, unsigned long>(*this, 0); }
 MultiTypeMath::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeMath, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypeMath, float>(*this, 0); }
 MultiTypeMath::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeMath, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypeMath, double>(*this, 0); }
 MultiTypeMath::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeMath, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypeMath, long double>(*this, 0); }
 MultiTypeMath::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeMath, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypeMath, bool>(*this, 0); }
 MultiTypeMath::operator std::string() const
-{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this); }
+{ return (this->type_ == MT_string) ? this->string_ : getConvertedValue<MultiTypeMath, std::string>(*this); }
 MultiTypeMath::operator const char*() const
-{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this)).c_str(); }
+{ return ((this->type_ == MT_constchar) ? this->string_ : getConvertedValue<MultiTypeMath, std::string>(*this)).c_str(); }
 MultiTypeMath::operator orxonox::Vector2() const
-{ return (this->type_ == MT_vector2) ? this->vector2_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector2>(*this); }
+{ return (this->type_ == MT_vector2) ? this->vector2_ : getConvertedValue<MultiTypeMath, orxonox::Vector2>(*this); }
 MultiTypeMath::operator orxonox::Vector3() const
-{ return (this->type_ == MT_vector3) ? this->vector3_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector3>(*this); }
+{ return (this->type_ == MT_vector3) ? this->vector3_ : getConvertedValue<MultiTypeMath, orxonox::Vector3>(*this); }
 MultiTypeMath::operator orxonox::Quaternion() const
-{ return (this->type_ == MT_quaternion) ? this->quaternion_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Quaternion>(*this); }
+{ return (this->type_ == MT_quaternion) ? this->quaternion_ : getConvertedValue<MultiTypeMath, orxonox::Quaternion>(*this); }
 MultiTypeMath::operator orxonox::ColourValue() const
-{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : ConvertValueAndReturn<MultiTypeMath, orxonox::ColourValue>(*this); }
+{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : getConvertedValue<MultiTypeMath, orxonox::ColourValue>(*this); }
 MultiTypeMath::operator orxonox::Radian() const
-{ return (this->type_ == MT_radian) ? this->radian_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Radian>(*this); }
+{ return (this->type_ == MT_radian) ? this->radian_ : getConvertedValue<MultiTypeMath, orxonox::Radian>(*this); }
 MultiTypeMath::operator orxonox::Degree() const
-{ return (this->type_ == MT_degree) ? this->degree_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Degree>(*this); }
+{ return (this->type_ == MT_degree) ? this->degree_ : getConvertedValue<MultiTypeMath, orxonox::Degree>(*this); }
 
 void MultiTypeMath::setValue(const MultiTypeMath& mtm)
@@ -138,4 +140,22 @@
     this->radian_ = mtm.radian_;
     this->degree_ = mtm.degree_;
+}
+
+std::string MultiTypeMath::getTypename() const
+{
+    if (this->type_ == MT_vector2)
+        return "Vector2";
+    else if (this->type_ == MT_vector3)
+        return "Vector3";
+    else if (this->type_ == MT_colourvalue)
+        return "ColourValue";
+    else if (this->type_ == MT_quaternion)
+        return "Quaternion";
+    else if (this->type_ == MT_radian)
+        return "Radian";
+    else if (this->type_ == MT_degree)
+        return "Degree";
+    else
+        return MultiTypeString::getTypename();
 }
 
Index: code/trunk/src/util/MultiTypeMath.h
===================================================================
--- code/trunk/src/util/MultiTypeMath.h	(revision 1051)
+++ code/trunk/src/util/MultiTypeMath.h	(revision 1052)
@@ -38,5 +38,6 @@
 {
     public:
-        MultiTypeMath(MultiType      type = MT_null);
+        MultiTypeMath(MultiType type = MT_null);
+        inline MultiTypeMath(void*          value) : MultiTypeString(value) {}
         inline MultiTypeMath(int            value) : MultiTypeString(value) {}
         inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
@@ -51,6 +52,6 @@
         inline MultiTypeMath(long double    value) : MultiTypeString(value) {}
         inline MultiTypeMath(bool           value) : MultiTypeString(value) {}
-        inline MultiTypeMath(const char*        value) : MultiTypeString(value) {}
-        inline MultiTypeMath(const std::string& value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const char*             value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const std::string&      value) : MultiTypeString(value) {}
         inline MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }
         inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
@@ -89,4 +90,5 @@
         bool operator!=(const MultiTypeMath& mtm) const;
 
+        virtual operator void*()                const;
         virtual operator int()                  const;
         virtual operator unsigned int()         const;
@@ -141,4 +143,6 @@
         inline void getValue(orxonox::Degree*      variable) const { (*variable) = orxonox::Degree      (this->degree_);      }
 
+        virtual std::string getTypename() const;
+
         virtual std::string toString() const;
         virtual bool fromString(const std::string value);
Index: code/trunk/src/util/MultiTypePrimitive.cc
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypePrimitive.cc	(revision 1052)
@@ -34,5 +34,7 @@
     this->type_ = type;
 
-    if (type == MT_int)
+    if (type == MT_void)
+        this->value_.void_ = 0;
+    else if (type == MT_int)
         this->value_.int_ = 0;
     else if (type == MT_uint)
@@ -59,5 +61,5 @@
         this->value_.bool_ = false;
     else
-        this->value_.int_ = 0;
+        this->value_.void_ = 0;
 }
 
@@ -66,5 +68,7 @@
     if (this->type_ == mtp.type_)
     {
-        if (this->type_ == MT_int)
+        if (this->type_ == MT_void)
+            return (this->value_.void_ == mtp.value_.void_);
+        else if (this->type_ == MT_int)
             return (this->value_.int_ == mtp.value_.int_);
         else if (this->type_ == MT_uint)
@@ -99,5 +103,7 @@
     if (this->type_ == mtp.type_)
     {
-        if (this->type_ == MT_int)
+        if (this->type_ == MT_void)
+            return (this->value_.void_ != mtp.value_.void_);
+        else if (this->type_ == MT_int)
             return (this->value_.int_ != mtp.value_.int_);
         else if (this->type_ == MT_uint)
@@ -128,28 +134,30 @@
 }
 
+MultiTypePrimitive::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypePrimitive, void*>(*this, 0); }
 MultiTypePrimitive::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypePrimitive, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypePrimitive, int>(*this, 0); }
 MultiTypePrimitive::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypePrimitive, unsigned int>(*this, 0); }
 MultiTypePrimitive::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypePrimitive, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypePrimitive, char>(*this, 0); }
 MultiTypePrimitive::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypePrimitive, unsigned char>(*this, 0); }
 MultiTypePrimitive::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypePrimitive, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypePrimitive, short>(*this, 0); }
 MultiTypePrimitive::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypePrimitive, unsigned short>(*this, 0); }
 MultiTypePrimitive::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypePrimitive, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypePrimitive, long>(*this, 0); }
 MultiTypePrimitive::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypePrimitive, unsigned long>(*this, 0); }
 MultiTypePrimitive::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypePrimitive, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypePrimitive, float>(*this, 0); }
 MultiTypePrimitive::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypePrimitive, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypePrimitive, double>(*this, 0); }
 MultiTypePrimitive::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypePrimitive, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypePrimitive, long double>(*this, 0); }
 MultiTypePrimitive::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypePrimitive, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypePrimitive, bool>(*this, 0); }
 
 void MultiTypePrimitive::setValue(const MultiTypePrimitive& mtp)
@@ -159,9 +167,43 @@
 }
 
+std::string MultiTypePrimitive::getTypename() const
+{
+    if (this->type_ == MT_void)
+        return "pointer";
+    else if (this->type_ == MT_int)
+        return "int";
+    else if (this->type_ == MT_uint)
+        return "unsigned int";
+    else if (this->type_ == MT_char)
+        return "char";
+    else if (this->type_ == MT_uchar)
+        return "unsigned char";
+    else if (this->type_ == MT_short)
+        return "short";
+    else if (this->type_ == MT_ushort)
+        return "unsigned short";
+    else if (this->type_ == MT_long)
+        return "long";
+    else if (this->type_ == MT_ulong)
+        return "unsigned long";
+    else if (this->type_ == MT_float)
+        return "float";
+    else if (this->type_ == MT_double)
+        return "double";
+    else if (this->type_ == MT_longdouble)
+        return "long double";
+    else if (this->type_ == MT_bool)
+        return "bool";
+    else
+        return "unknown";
+}
+
 std::string MultiTypePrimitive::toString() const
 {
     std::string output;
 
-    if (this->type_ == MT_int)
+    if (this->type_ == MT_void)
+        ConvertValue(&output, this->value_.void_);
+    else if (this->type_ == MT_int)
         ConvertValue(&output, this->value_.int_);
     else if (this->type_ == MT_uint)
@@ -193,5 +235,7 @@
 bool MultiTypePrimitive::fromString(const std::string value)
 {
-    if (this->type_ == MT_int)
+    if (this->type_ == MT_void)
+        return ConvertValue(&this->value_.void_, value, (void*)0);
+    else if (this->type_ == MT_int)
         return ConvertValue(&this->value_.int_, value, (int)0);
     else if (this->type_ == MT_uint)
Index: code/trunk/src/util/MultiTypePrimitive.h
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.h	(revision 1051)
+++ code/trunk/src/util/MultiTypePrimitive.h	(revision 1052)
@@ -36,8 +36,13 @@
 #include "MultiType.h"
 
+namespace orxonox
+{
+    class BaseObject;
+}
 class _UtilExport MultiTypePrimitive
 {
     public:
-        MultiTypePrimitive(MultiType      type = MT_null);
+        MultiTypePrimitive(MultiType type = MT_null);
+        inline MultiTypePrimitive(void*          value) { this->setValue(value); }
         inline MultiTypePrimitive(int            value) { this->setValue(value); }
         inline MultiTypePrimitive(unsigned int   value) { this->setValue(value); }
@@ -56,4 +61,5 @@
 
         inline MultiTypePrimitive& operator=(MultiType      value) { this->type_ = MT_null; return *this; }
+        inline MultiTypePrimitive& operator=(void*          value) { this->setValue(value); return *this; }
         inline MultiTypePrimitive& operator=(int            value) { this->setValue(value); return *this; }
         inline MultiTypePrimitive& operator=(unsigned int   value) { this->setValue(value); return *this; }
@@ -70,4 +76,5 @@
         inline MultiTypePrimitive& operator=(const MultiTypePrimitive& mtp) { this->setValue(mtp); return *this; }
 
+        inline bool operator==(void*          value) const { return (this->value_.void_       == value); }
         inline bool operator==(int            value) const { return (this->value_.int_        == value); }
         inline bool operator==(unsigned int   value) const { return (this->value_.uint_       == value); }
@@ -84,5 +91,5 @@
         bool operator==(const MultiTypePrimitive& mtp) const;
 
-        inline bool operator!=(int            value) const { return (this->value_.int_        != value); }
+        inline bool operator!=(void*          value) const { return (this->value_.void_       != value); }
         inline bool operator!=(unsigned int   value) const { return (this->value_.uint_       != value); }
         inline bool operator!=(char           value) const { return (this->value_.char_       != value); }
@@ -98,4 +105,8 @@
         bool operator!=(const MultiTypePrimitive& mtp) const;
 
+        template <class T>
+        operator T*()                     const
+        { return ((T*)this->value_.void_); }
+        virtual operator void*()          const;
         virtual operator int()            const;
         virtual operator unsigned int()   const;
@@ -111,4 +122,5 @@
         virtual operator bool()           const;
 
+        inline void setValue(void*          value) { this->type_ = MT_void;       this->value_.void_       = value; }
         inline void setValue(int            value) { this->type_ = MT_int;        this->value_.int_        = value; }
         inline void setValue(unsigned int   value) { this->type_ = MT_uint;       this->value_.uint_       = value; }
@@ -125,4 +137,5 @@
         void setValue(const MultiTypePrimitive& mtp);
 
+        inline void*          getVoid()          const { return this->value_.void_;        }
         inline int            getInt()           const { return this->value_.int_;        }
         inline unsigned int   getUnsignedInt()   const { return this->value_.uint_;       }
@@ -151,4 +164,5 @@
         inline bool&           getBool()          { return this->value_.bool_;       }
 
+        inline void getValue(void*           variable) const { variable    = this->value_.void_;       }
         inline void getValue(int*            variable) const { (*variable) = this->value_.int_;        }
         inline void getValue(unsigned int*   variable) const { (*variable) = this->value_.uint_;       }
@@ -167,4 +181,6 @@
         inline bool      isA(MultiType type) const { return (this->type_ == type); }
 
+        virtual std::string getTypename() const;
+
         virtual std::string toString() const;
         virtual bool fromString(const std::string value);
Index: code/trunk/src/util/MultiTypeString.cc
===================================================================
--- code/trunk/src/util/MultiTypeString.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypeString.cc	(revision 1052)
@@ -32,8 +32,5 @@
 MultiTypeString::MultiTypeString(MultiType type) : MultiTypePrimitive(type)
 {
-    if (type == MT_constchar)
-        this->string_ = std::string("");
-    else if (type == MT_string)
-        this->string_ = std::string("");
+    // Nothing to do for string and xml-element
 }
 
@@ -64,32 +61,34 @@
 }
 
+MultiTypeString::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypeString, void*>(*this, 0); }
 MultiTypeString::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeString, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypeString, int>(*this, 0); }
 MultiTypeString::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeString, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypeString, unsigned int>(*this, 0); }
 MultiTypeString::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeString, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypeString, char>(*this, 0); }
 MultiTypeString::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeString, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypeString, unsigned char>(*this, 0); }
 MultiTypeString::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeString, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypeString, short>(*this, 0); }
 MultiTypeString::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeString, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypeString, unsigned short>(*this, 0); }
 MultiTypeString::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeString, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypeString, long>(*this, 0); }
 MultiTypeString::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeString, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypeString, unsigned long>(*this, 0); }
 MultiTypeString::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeString, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypeString, float>(*this, 0); }
 MultiTypeString::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeString, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypeString, double>(*this, 0); }
 MultiTypeString::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeString, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypeString, long double>(*this, 0); }
 MultiTypeString::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeString, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypeString, bool>(*this, 0); }
 MultiTypeString::operator std::string() const
-{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this); }
+{ return (this->type_ == MT_string) ? this->string_ : getConvertedValue<MultiTypeString, std::string>(*this); }
 MultiTypeString::operator const char*() const
-{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this)).c_str(); }
+{ return ((this->type_ == MT_constchar) ? this->string_ : getConvertedValue<MultiTypeString, std::string>(*this)).c_str(); }
 
 void MultiTypeString::setValue(const MultiTypeString& mts)
@@ -99,6 +98,18 @@
 }
 
+std::string MultiTypeString::getTypename() const
+{
+    if (this->type_ == MT_constchar)
+        return "string";
+    else if (this->type_ == MT_string)
+        return "string";
+    else
+        return MultiTypePrimitive::getTypename();
+}
+
 std::string MultiTypeString::toString() const
 {
+    std::string output;
+
     if (this->type_ == MT_constchar)
         return this->string_;
@@ -107,4 +118,6 @@
     else
         return MultiTypePrimitive::toString();
+
+    return output;
 }
 
Index: code/trunk/src/util/MultiTypeString.h
===================================================================
--- code/trunk/src/util/MultiTypeString.h	(revision 1051)
+++ code/trunk/src/util/MultiTypeString.h	(revision 1052)
@@ -39,5 +39,6 @@
 {
     public:
-        MultiTypeString(MultiType      type = MT_null);
+        MultiTypeString(MultiType type = MT_null);
+        inline MultiTypeString(void*          value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
@@ -52,53 +53,56 @@
         inline MultiTypeString(long double    value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(bool           value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(const char*        value)   { this->setValue(value); }
-        inline MultiTypeString(const std::string& value)   { this->setValue(value); }
-        inline MultiTypeString(const MultiTypeString& mts) { this->setValue(mts);   }
+        inline MultiTypeString(const char*           value)   { this->setValue(value); }
+        inline MultiTypeString(const std::string&    value)   { this->setValue(value); }
+        inline MultiTypeString(const MultiTypeString& mts)    { this->setValue(mts);   }
         virtual inline ~MultiTypeString() {}
 
         using MultiTypePrimitive::operator=;
-        inline MultiTypeString& operator=(const char*        value)   { this->setValue(value); return *this; }
-        inline MultiTypeString& operator=(const std::string& value)   { this->setValue(value); return *this; }
-        inline MultiTypeString& operator=(const MultiTypeString& mts) { this->setValue(mts);   return *this; }
+        inline MultiTypeString& operator=(const char*             value)   { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const std::string&      value)   { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const MultiTypeString& mts)      { this->setValue(mts);   return *this; }
 
         using MultiTypePrimitive::operator==;
-        inline bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }
-        inline bool operator==(const std::string& value) const { return (this->string_ == value);              }
+        inline bool operator==(const char*             value) const { return (this->string_      == std::string(value)); }
+        inline bool operator==(const std::string&      value) const { return (this->string_      == value);              }
         bool operator==(const MultiTypeString& mts) const;
 
         using MultiTypePrimitive::operator!=;
-        inline bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }
-        inline bool operator!=(const std::string& value) const { return (this->string_ != value);              }
+        inline bool operator!=(const char*             value) const { return (this->string_      != std::string(value)); }
+        inline bool operator!=(const std::string&      value) const { return (this->string_      != value);              }
         bool operator!=(const MultiTypeString& mts) const;
 
-        virtual operator int()            const;
-        virtual operator unsigned int()   const;
-        virtual operator char()           const;
-        virtual operator unsigned char()  const;
-        virtual operator short()          const;
-        virtual operator unsigned short() const;
-        virtual operator long()           const;
-        virtual operator unsigned long()  const;
-        virtual operator float ()         const;
-        virtual operator double ()        const;
-        virtual operator long double()    const;
-        virtual operator bool()           const;
-        virtual operator std::string()    const;
-        virtual operator const char*()    const;
+        virtual operator void*()                const;
+        virtual operator int()                  const;
+        virtual operator unsigned int()         const;
+        virtual operator char()                 const;
+        virtual operator unsigned char()        const;
+        virtual operator short()                const;
+        virtual operator unsigned short()       const;
+        virtual operator long()                 const;
+        virtual operator unsigned long()        const;
+        virtual operator float ()               const;
+        virtual operator double ()              const;
+        virtual operator long double()          const;
+        virtual operator bool()                 const;
+        virtual operator std::string()          const;
+        virtual operator const char*()          const;
 
         using MultiTypePrimitive::setValue;
-        inline void setValue(const char*        value) { this->type_ = MT_string; this->string_ = std::string(value); }
-        inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value;              }
+        inline void setValue(const char*             value) { this->type_ = MT_string;     this->string_     = std::string(value); }
+        inline void setValue(const std::string&      value) { this->type_ = MT_string;     this->string_     = value;              }
         void setValue(const MultiTypeString& mts);
 
-        inline const std::string getString() const { return this->string_;         }
-        inline const char*  getConstChar()   const { return this->string_.c_str(); }
+        inline std::string getString()          const { return this->string_;         }
+        inline const char*  getConstChar()      const { return this->string_.c_str(); }
 
-        inline const std::string& getString() { return this->string_;         }
-        inline const char*  getConstChar()    { return this->string_.c_str(); }
+        inline std::string& getString()          { return this->string_;         }
+        inline const char*  getConstChar()       { return this->string_.c_str(); }
 
         using MultiTypePrimitive::getValue;
-        inline void getValue(std::string* variable) const { (*variable) = this->string_;         }
-        inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); }
+        inline void getValue(std::string*      variable) const { (*variable) = this->string_;         }
+        inline void getValue(const char**      variable) const { (*variable) = this->string_.c_str(); }
+
+        virtual std::string getTypename() const;
 
         virtual std::string toString() const;
@@ -106,5 +110,5 @@
 
     protected:
-        std::string string_;
+        std::string      string_;
 };
 
Index: code/trunk/src/util/String.cc
===================================================================
--- code/trunk/src/util/String.cc	(revision 1051)
+++ code/trunk/src/util/String.cc	(revision 1052)
@@ -26,4 +26,6 @@
  */
 
+#include <cctype>
+#include <iostream>
 #include "String.h"
 
@@ -54,4 +56,134 @@
 
 /**
+    @brief Returns a copy of a string without trailing whitespaces.
+    @param str The string
+    @return The modified copy
+*/
+std::string removeTrailingWhitespaces(const std::string& str)
+{
+    unsigned int pos1 = 0;
+    unsigned int pos2 = str.size() - 1;
+    for (; pos1 < str.size() && (str[pos1] == ' ' || str[pos1] == '\t' || str[pos1] == '\n'); pos1++);
+    for (; pos2 >= 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
+    return str.substr(pos1, pos2 - pos1 + 1);
+}
+
+/**
+    @brief Returns the position of the next quote in the string, starting with start.
+    @param str The string
+    @param start The startposition
+    @return The position of the next quote (std::string::npos if there is no next quote)
+*/
+unsigned int getNextQuote(const std::string& str, unsigned int start)
+{
+    unsigned int quote = start - 1;
+
+    while ((quote = str.find('\"', quote + 1)) != std::string::npos)
+    {
+        unsigned int backslash = quote;
+        unsigned int numbackslashes = 0;
+        for (; backslash > 0; backslash--, numbackslashes++)
+            if (str[backslash - 1] != '\\')
+                break;
+
+        if (numbackslashes % 2 == 0)
+            break;
+    }
+
+    return quote;
+}
+
+/**
+    @brief Returns true if pos is between two quotes.
+    @param str The string
+    @param pos The position to check
+    @return True if pos is between two quotes
+*/
+bool isBetweenQuotes(const std::string& str, unsigned int pos)
+{
+    if (pos == std::string::npos)
+        return false;
+
+    unsigned int quotecount = 0;
+    unsigned int quote = 0;
+    while ((quote = getNextQuote(str, quote)) < pos)
+    {
+        quotecount++;
+    }
+
+    if (quote == std::string::npos)
+        return false;
+
+    return ((quotecount % 2) == 1);
+}
+
+/**
+    @brief Returns true if the string contains something like '..."between quotes"...'
+    @param The string
+    @return True if there is something between quotes
+*/
+bool hasStringBetweenQuotes(const std::string& str)
+{
+    unsigned int pos1 = getNextQuote(str, 0);
+    unsigned int pos2 = getNextQuote(str, pos1 + 1);
+    return (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1);
+}
+
+/**
+    @brief If the string contains something like '..."between quotes"...' then 'between quotes' gets returned (without quotes).
+    @param The string
+    @param The string between the quotes
+*/
+std::string getStringBetweenQuotes(const std::string& str)
+{
+    unsigned int pos1 = getNextQuote(str, 0);
+    unsigned int pos2 = getNextQuote(str, pos1 + 1);
+    if (pos1 != std::string::npos && pos2 != std::string::npos)
+        return str.substr(pos1, pos2 - pos1 + 1);
+    else
+        return "";
+}
+
+/**
+    @brief Removes enclosing quotes if available.
+    @brief str The string to strip
+    @return The string with removed quotes
+*/
+std::string stripEnclosingQuotes(const std::string& str)
+{
+    unsigned int start = std::string::npos;
+    unsigned int end = 0;
+
+    for (unsigned int pos = 0; (pos < str.size()) && (pos < std::string::npos); pos++)
+    {
+        if (str[pos] == '"')
+        {
+            start = pos;
+            break;
+        }
+
+        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+            return str;
+    }
+
+    for (unsigned int pos = str.size() - 1; pos < std::string::npos; pos--)
+    {
+        if (str[pos] == '"')
+        {
+            end = pos;
+            break;
+        }
+
+        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+            return str;
+    }
+
+    if ((start != std::string::npos) && (end != 0))
+        return str.substr(start + 1, end - start - 1);
+    else
+        return str;
+}
+
+/**
     @brief Determines if a string in is a comment.
     @param str The string to check
@@ -70,6 +202,14 @@
     //  3) ;comment in unreal tournament config-file style
     //  4) //comment in code style
-    if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[0] == '/'))
-        return true;
+    if (teststring.size() >= 2)
+    {
+        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[1] == '/'))
+            return true;
+    }
+    else if (teststring.size() == 1)
+    {
+        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';')
+            return true;
+    }
 
     return false;
@@ -83,5 +223,6 @@
 bool isEmpty(const std::string& str)
 {
-    return getStripped(str) == "";
+    std::string temp = getStripped(str);
+    return ((temp == "") || (temp.size() == 0));
 }
 
@@ -109,4 +250,52 @@
 }
 
+std::string addSlashes(const std::string& str)
+{
+    std::string output = str;
+
+    for (unsigned int pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\\"); }
+    for (unsigned int pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\n"); }
+    for (unsigned int pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\t"); }
+    for (unsigned int pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\v"); }
+    for (unsigned int pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\b"); }
+    for (unsigned int pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\r"); }
+    for (unsigned int pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\f"); }
+    for (unsigned int pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\a"); }
+    for (unsigned int pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\""); }
+    for (unsigned int pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\0"); }
+
+    return output;
+}
+
+std::string removeSlashes(const std::string& str)
+{
+    if (str.size() == 0)
+        return str;
+
+    std::string output = "";
+    for (unsigned int pos = 0; pos < str.size() - 1; )
+    {
+        if (str[pos] == '\\')
+        {
+            if (str[pos + 1] == '\\') { output += '\\'; pos += 2; continue; }
+            else if (str[pos + 1] == 'n') { output += '\n'; pos += 2; continue; }
+            else if (str[pos + 1] == 't') { output += '\t'; pos += 2; continue; }
+            else if (str[pos + 1] == 'v') { output += '\v'; pos += 2; continue; }
+            else if (str[pos + 1] == 'b') { output += '\b'; pos += 2; continue; }
+            else if (str[pos + 1] == 'r') { output += '\r'; pos += 2; continue; }
+            else if (str[pos + 1] == 'f') { output += '\f'; pos += 2; continue; }
+            else if (str[pos + 1] == 'a') { output += '\a'; pos += 2; continue; }
+            else if (str[pos + 1] == '"') { output += '"'; pos += 2; continue; }
+            else if (str[pos + 1] == '0') { output += '\0'; pos += 2; continue; }
+        }
+        output += str[pos];
+        pos++;
+        if (pos == str.size() - 1)
+            output += str[pos];
+    }
+
+    return output;
+}
+
 /**
     @brief Replaces each char between A and Z with its lowercase equivalent.
@@ -115,9 +304,8 @@
 void lowercase(std::string* str)
 {
-    static unsigned const char difference_between_A_and_a = 'A' - 'a';
-
-    for (std::string::iterator it = (*str).begin(); it != (*str).end(); ++it)
-        if ((*it) >= 'A' && (*it) <= 'Z')
-            (*it) -= difference_between_A_and_a;
+    for (unsigned int i = 0; i < str->size(); ++i)
+    {
+        (*str)[i] = tolower((*str)[i]);
+    }
 }
 
@@ -140,9 +328,8 @@
 void uppercase(std::string* str)
 {
-    static unsigned const char difference_between_A_and_a = 'A' - 'a';
-
-    for (std::string::iterator it = (*str).begin(); it != (*str).end(); ++it)
-        if ((*it) >= 'a' && (*it) <= 'z')
-            (*it) += difference_between_A_and_a;
+    for (unsigned int i = 0; i < str->size(); ++i)
+    {
+        (*str)[i] = toupper((*str)[i]);
+    }
 }
 
@@ -160,8 +347,8 @@
 
 /**
- * @brief compares two strings without ignoring the case
- * @param s1 first string
- * @param s2 second string
- */
+    @brief compares two strings without ignoring the case
+    @param s1 first string
+    @param s2 second string
+*/
 int nocaseCmp(const std::string& s1, const std::string& s2)
 {
@@ -188,9 +375,9 @@
 
 /**
- * @brief compares two strings without ignoring the case
- * @param s1 first string
- * @param s2 second string
- * @param len how far from the beginning to start.
- */
+    @brief compares two strings without ignoring the case
+    @param s1 first string
+    @param s2 second string
+    @param len how far from the beginning to start.
+*/
 int nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len)
 {
@@ -212,2 +399,47 @@
     return 0;
 }
+
+/**
+    @brief Returns true if the string contains a comment, introduced by #, %, ; or //.
+    @param str The string
+    @return True if the string contains a comment
+*/
+bool hasComment(const std::string& str)
+{
+    return (getCommentPosition(str) != std::string::npos);
+}
+
+/**
+    @brief If the string contains a comment, the comment gets returned (including the comment symbol), an empty string otherwise.
+    @param str The string
+    @return The comment
+*/
+std::string getComment(const std::string& str)
+{
+    return str.substr(getCommentPosition(str));
+}
+
+/**
+    @brief If the string contains a comment, the position of the comment-symbol gets returned, std::string::npos otherwise.
+    @param str The string
+    @return The position
+*/
+unsigned int getCommentPosition(const std::string& str)
+{
+    return getNextCommentPosition(str, 0);
+}
+
+/**
+    @brief Returns the position of the next comment-symbol, starting with start.
+    @param str The string
+    @param start The startposition
+    @return The position
+*/
+unsigned int getNextCommentPosition(const std::string& str, unsigned int start)
+{
+    for (unsigned int i = start; i < str.size(); i++)
+        if (isComment(str.substr(i)))
+            return i;
+
+    return std::string::npos;
+}
Index: code/trunk/src/util/String.h
===================================================================
--- code/trunk/src/util/String.h	(revision 1051)
+++ code/trunk/src/util/String.h	(revision 1052)
@@ -26,6 +26,6 @@
  */
 
-#ifndef _String_H__
-#define _String_H__
+#ifndef _Util_String_H__
+#define _Util_String_H__
 
 #include <string>
@@ -34,19 +34,37 @@
 #include "UtilPrereqs.h"
 
-_UtilExport void        strip(std::string* str);
-_UtilExport std::string getStripped(const std::string& str);
+_UtilExport void         strip(std::string* str);
+_UtilExport std::string  getStripped(const std::string& str);
 
-_UtilExport bool        isEmpty(const std::string& str);
-_UtilExport bool        isComment(const std::string& str);
-_UtilExport bool        isNumeric(const std::string& str);
+_UtilExport std::string  removeTrailingWhitespaces(const std::string& str);
 
-_UtilExport void        lowercase(std::string* str);
-_UtilExport std::string getLowercase(const std::string& str);
+_UtilExport unsigned int getNextQuote(const std::string& str, unsigned int start);
+_UtilExport bool         isBetweenQuotes(const std::string& str, unsigned int pos);
 
-_UtilExport void        uppercase(std::string* str);
-_UtilExport std::string getUppercase(const std::string& str);
+_UtilExport bool         hasStringBetweenQuotes(const std::string& str);
+_UtilExport std::string  getStringBetweenQuotes(const std::string& str);
 
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len);
+_UtilExport std::string  stripEnclosingQuotes(const std::string& str);
+
+_UtilExport bool         isEmpty(const std::string& str);
+_UtilExport bool         isComment(const std::string& str);
+_UtilExport bool         isNumeric(const std::string& str);
+
+_UtilExport std::string  addSlashes(const std::string& str);
+_UtilExport std::string  removeSlashes(const std::string& str);
+
+_UtilExport void         lowercase(std::string* str);
+_UtilExport std::string  getLowercase(const std::string& str);
+
+_UtilExport void         uppercase(std::string* str);
+_UtilExport std::string  getUppercase(const std::string& str);
+
+_UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2);
+_UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len);
+
+_UtilExport bool         hasComment(const std::string& str);
+_UtilExport std::string  getComment(const std::string& str);
+_UtilExport unsigned int getCommentPosition(const std::string& str);
+_UtilExport unsigned int getNextCommentPosition(const std::string& str, unsigned int start = 0);
 
 //! The Convert class has some static member functions to convert strings to values and values to strings.
@@ -144,3 +162,3 @@
 };
 
-#endif /* _String_H__ */
+#endif /* _Util_String_H__ */
Index: code/trunk/src/util/SubString.cc
===================================================================
--- code/trunk/src/util/SubString.cc	(revision 1051)
+++ code/trunk/src/util/SubString.cc	(revision 1052)
@@ -66,7 +66,8 @@
 SubString::SubString(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
-{
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+                     char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+{
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
 }
 
@@ -79,5 +80,8 @@
 {
   for (unsigned int i = subSetBegin; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -91,6 +95,9 @@
 SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
 {
-  for (unsigned int i = subSetBegin; i < subString.size() || i < subSetEnd; i++)
+  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -103,5 +110,8 @@
 {
   for(unsigned int i = 0; i < argc; ++i)
+  {
     this->strings.push_back(std::string(argv[i]));
+    this->bInSafemode.push_back(false);
+  }
 }
 
@@ -129,4 +139,5 @@
 {
   this->strings = subString.strings;
+  this->bInSafemode = subString.bInSafemode;
   return *this;
 }
@@ -140,5 +151,5 @@
 bool SubString::operator==(const SubString& subString) const
 {
-  return (this->strings == subString.strings);
+  return ((this->strings == subString.strings) && (this->bInSafemode == subString.bInSafemode));
 }
 
@@ -165,5 +176,5 @@
 
   for (unsigned int i = 0; i < length; i++)
-    if (this->strings[i] != subString.strings[i])
+    if ((this->strings[i] != subString.strings[i]) || (this->bInSafemode[i] != subString.bInSafemode[i]))
       return false;
   return true;
@@ -190,5 +201,8 @@
 {
   for (unsigned int i = 0; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
   return *this;
 }
@@ -203,8 +217,9 @@
 {
   this->strings.clear();
+  this->bInSafemode.clear();
   char split[2];
   split[0] = splitter;
   split[1] = '\0';
-  SubString::splitLine(this->strings, string, split);
+  SubString::splitLine(this->strings, this->bInSafemode, string, split);
   return strings.size();
 }
@@ -223,8 +238,10 @@
 unsigned int SubString::split(const std::string& string,
                               const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                              char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
+                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
 {
   this->strings.clear();
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+  this->bInSafemode.clear();
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
   return this->strings.size();
 }
@@ -292,7 +309,11 @@
  * @param escape_char: Escape carater (escapes splitters)
  * @param safemode_char: the beginning of the safemode is marked with this
+ * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
+ * @param openparenthesis_char the beginning of a safemode is marked with this
+ * @param closeparenthesis_char the ending of a safemode is marked with this
+ * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
  * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
  * @param start_state: the Initial state on how to parse the String.
- * @returns SPLIT_LINE_STATE the parser was in when returning
+ * @return SPLIT_LINE_STATE the parser was in when returning
  *
  * This is the Actual Splitting Algorithm from Clemens Wacha
@@ -302,4 +323,5 @@
 SubString::SPLIT_LINE_STATE
 SubString::splitLine(std::vector<std::string>& ret,
+                     std::vector<bool>& bInSafemode,
                      const std::string& line,
                      const std::string& delimiters,
@@ -307,7 +329,10 @@
                      bool emptyEntries,
                      char escape_char,
+                     bool removeExcapeChar,
                      char safemode_char,
+                     bool removeSafemodeChar,
                      char openparenthesis_char,
                      char closeparenthesis_char,
+                     bool removeParenthesisChars,
                      char comment_char,
                      SPLIT_LINE_STATE start_state)
@@ -318,4 +343,5 @@
 
   std::string token;
+  bool inSafemode = false;
 
   if(start_state != SL_NORMAL && ret.size() > 0)
@@ -323,4 +349,9 @@
     token = ret[ret.size()-1];
     ret.pop_back();
+  }
+  if(start_state != SL_NORMAL && bInSafemode.size() > 0)
+  {
+    inSafemode = bInSafemode[bInSafemode.size()-1];
+    bInSafemode.pop_back();
   }
 
@@ -333,12 +364,20 @@
         {
           state = SL_ESCAPE;
+          if (!removeExcapeChar)
+            token += line[i];
         }
         else if(line[i] == safemode_char)
         {
           state = SL_SAFEMODE;
+          inSafemode = true;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == openparenthesis_char)
         {
           state = SL_PARENTHESES;
+          inSafemode = true;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == comment_char)
@@ -351,4 +390,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           token += line[i];       // EAT
@@ -365,4 +406,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -386,13 +429,18 @@
         break;
       case SL_ESCAPE:
-        if(line[i] == 'n') token += '\n';
-        else if(line[i] == 't') token += '\t';
-        else if(line[i] == 'v') token += '\v';
-        else if(line[i] == 'b') token += '\b';
-        else if(line[i] == 'r') token += '\r';
-        else if(line[i] == 'f') token += '\f';
-        else if(line[i] == 'a') token += '\a';
-        else if(line[i] == '?') token += '\?';
-        else token += line[i];  // EAT
+        if (!removeSafemodeChar)
+          token += line[i];
+        else
+        {
+          if(line[i] == 'n') token += '\n';
+          else if(line[i] == 't') token += '\t';
+          else if(line[i] == 'v') token += '\v';
+          else if(line[i] == 'b') token += '\b';
+          else if(line[i] == 'r') token += '\r';
+          else if(line[i] == 'f') token += '\f';
+          else if(line[i] == 'a') token += '\a';
+          else if(line[i] == '?') token += '\?';
+          else token += line[i];  // EAT
+        }
         state = SL_NORMAL;
         break;
@@ -401,4 +449,6 @@
         {
           state = SL_NORMAL;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -429,4 +479,6 @@
         {
           state = SL_NORMAL;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -461,4 +513,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -484,4 +538,6 @@
     ret.push_back(token);
     token.clear();
+    bInSafemode.push_back(inSafemode);
+    inSafemode = false;
   }
   return(state);
Index: code/trunk/src/util/SubString.h
===================================================================
--- code/trunk/src/util/SubString.h	(revision 1051)
+++ code/trunk/src/util/SubString.h	(revision 1052)
@@ -88,5 +88,6 @@
   SubString(const std::string& string,
             const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   SubString(unsigned int argc, const char** argv);
   /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
@@ -111,5 +112,6 @@
   unsigned int split(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
-                     char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   std::string join(const std::string& delimiter = " ") const;
   ////////////////////////////////////////
@@ -120,21 +122,24 @@
 
   // retrieve Information from within
-  /** @returns true if the SubString is empty */
+  /** @brief Returns true if the SubString is empty */
   inline bool empty() const { return this->strings.empty(); };
-  /** @returns the count of Strings stored in this substring */
+  /** @brief Returns the count of Strings stored in this substring */
   inline unsigned int size() const { return this->strings.size(); };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
-  /** @returns the front of the StringList. */
+  /** @brief Returns true if the token is in safemode. @param i the i'th token */
+  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
+  /** @brief Returns the front of the StringList. */
   inline const std::string& front() const { return this->strings.front(); };
-  /** @returns the back of the StringList. */
+  /** @brief Returns the back of the StringList. */
   inline const std::string& back() const { return this->strings.back(); };
   /** @brief removes the back of the strings list. */
-  inline void pop_back() { this->strings.pop_back(); };
+  inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
 
   // the almighty algorithm.
   static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
+                                    std::vector<bool>& bInSafemode,
                                     const std::string& line,
                                     const std::string& delimiters = SubString::WhiteSpaces,
@@ -142,7 +147,10 @@
                                     bool emptyEntries = false,
                                     char escape_char = '\\',
+                                    bool removeExcapeChar = true,
                                     char safemode_char = '"',
+                                    bool removeSafemodeChar = true,
                                     char openparenthesis_char = '(',
                                     char closeparenthesis_char = ')',
+                                    bool removeParenthesisChars = true,
                                     char comment_char = '\0',
                                     SPLIT_LINE_STATE start_state = SL_NORMAL);
@@ -157,4 +165,5 @@
 private:
   std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
+  std::vector<bool>         bInSafemode;
 };
 
Index: code/trunk/src/util/UtilPrereqs.h
===================================================================
--- code/trunk/src/util/UtilPrereqs.h	(revision 1051)
+++ code/trunk/src/util/UtilPrereqs.h	(revision 1052)
@@ -61,6 +61,4 @@
 class ArgReader;
 class Convert;
-template <typename FromType, typename ToType>
-class Converter;
 class MultiTypePrimitive;
 class MultiTypeString;
Index: code/trunk/src/util/tinyxml/ticpp.h
===================================================================
--- code/trunk/src/util/tinyxml/ticpp.h	(revision 1051)
+++ code/trunk/src/util/tinyxml/ticpp.h	(revision 1052)
@@ -973,5 +973,5 @@
  		Stream output operator.
  		*/
- 		friend std::ostream& operator <<( std::ostream& out, Node& base )
+ 		friend std::ostream& operator <<( std::ostream& out, const Node& base )
  		{
  			out << *base.GetTiXmlPointer();
