Index: /code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- /code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc	(revision 702)
+++ /code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc	(revision 703)
@@ -49,10 +49,10 @@
         this->type_ = Int;
 
-        this->defvalueString_ = number2String(defvalue, "0");                   // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        if (!string2Number(this->value_.value_int_, valueString, defvalue))     // Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String(defvalue, "0");                       // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -70,10 +70,10 @@
         this->type_ = uInt;
 
-        this->defvalueString_ = number2String(defvalue, "0");                   // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        if (!string2Number(this->value_.value_uint_, valueString, defvalue))    // Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String(defvalue, "0");                       // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -91,11 +91,10 @@
         this->type_ = Char;
 
-        this->defvalueString_ = number2String((int)defvalue, "0");              // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        // I used value_int_ instead of value_char_ to avoid number <-> char confusion in the config-file
-        if (!string2Number(this->value_.value_int_, valueString, (int)defvalue))// Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String((int)defvalue, "0");                  // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -113,11 +112,10 @@
         this->type_ = uChar;
 
-        this->defvalueString_ = number2String((unsigned int)defvalue, "0");     // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        // I used value_uint_ instead of value_uchar_ to avoid number <-> char confusion in the config-file
-        if (!string2Number(this->value_.value_uint_, valueString, (unsigned int)defvalue)) // Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String((unsigned int)defvalue, "0");         // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -135,10 +133,10 @@
         this->type_ = Float;
 
-        this->defvalueString_ = number2String(defvalue, "0.000000");            // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        if (!string2Number(this->value_.value_float_, valueString, defvalue))   // Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String(defvalue, "0.000000");                // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -156,10 +154,31 @@
         this->type_ = Double;
 
-        this->defvalueString_ = number2String(defvalue, "0.000000");            // Try to convert the default-value to a string
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-        if (!string2Number(this->value_.value_double_, valueString, defvalue))  // Try to convert the string to a value
-            this->setConfigFileEntyToDefault();                                 // The conversion failed
+        this->defvalueString_ = number2String(defvalue, "0.000000");                // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
+    }
+
+    /**
+        @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 varname The name of the variable
+        @param defvalue The default-value
+    */
+    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue)
+    {
+        this->classname_ = classname;
+        this->varname_ = varname;
+        this->type_ = LongDouble;
+
+        this->defvalueString_ = number2String(defvalue, "0.000000");                // Try to convert the default-value to a string
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -183,26 +202,8 @@
             this->defvalueString_ = "false";
 
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-
-        // Try to parse the value-string - is it a word?
-        if (valueString.find("true") < valueString.size()
-         || valueString.find("True") < valueString.size()
-         || valueString.find("yes") < valueString.size()
-         || valueString.find("Yes") < valueString.size())
-            this->value_.value_bool_ = true;
-        else if (valueString.find("false") < valueString.size()
-              || valueString.find("False") < valueString.size()
-              || valueString.find("no") < valueString.size()
-              || valueString.find("No") < valueString.size())
-            this->value_.value_bool_ = false;
-        else
-        {
-            // Its not a known word - is it a number?
-            std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-            if (!string2Number(this->value_.value_bool_, valueString, defvalue))    // Try to convert the string to a value
-                this->setConfigFileEntyToDefault();                                 // The conversion failed
-        }
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -220,26 +221,9 @@
         this->type_ = String;
 
-        this->defvalueString_ = "\"" + defvalue + "\"";                         // Convert the string to a "config-file-string" with quotes
-
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-        std::string valueString = this->parseValueString(false);                // Parses the value string from the config-file-entry
-
-        // Strip the quotes
-        unsigned int pos1 = valueString.find("\"") + 1;
-        unsigned int pos2 = valueString.find("\"", pos1);
-
-        // Check if the entry was correctly quoted
-        if (pos1 < valueString.length() && pos2 < valueString.length() && !(valueString.find("\"", pos2 + 1) < valueString.length()))
-        {
-            // It was - get the string between the quotes
-            valueString = valueString.substr(pos1, pos2 - pos1);
-            this->value_string_ = valueString;
-        }
-        else
-        {
-            // It wasn't - use the default-value and restore the entry in the config-file.
-            this->value_string_ = defvalue;
-            this->setConfigFileEntyToDefault();
-        }
+        this->defvalueString_ = "\"" + defvalue + "\"";                             // Convert the string to a "config-file-string" with quotes
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -257,26 +241,9 @@
         this->type_ = ConstChar;
 
-        this->defvalueString_ = "\"" + std::string(defvalue) + "\"";            // Convert the string to a "config-file-string" with quotes
-
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-        std::string valueString = this->parseValueString(false);                // Parses the value string from the config-file-entry
-
-        // Strip the quotes
-        unsigned int pos1 = valueString.find("\"") + 1;
-        unsigned int pos2 = valueString.find("\"", pos1);
-
-        // Check if the entry was correctly quoted
-        if (pos1 < valueString.length() && pos2 < valueString.length() && !(valueString.find("\"", pos2 + 1) < valueString.length()))
-        {
-            // It was - get the string between the quotes
-            valueString = valueString.substr(pos1, pos2 - pos1);
-            this->value_string_ = valueString;
-        }
-        else
-        {
-            // It wasn't - use the default-value and restore the entry in the config-file.
-            this->value_string_ = defvalue;
-            this->setConfigFileEntyToDefault();
-        }
+        this->defvalueString_ = "\"" + std::string(defvalue) + "\"";                // Convert the string to a "config-file-string" with quotes
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -301,26 +268,8 @@
             this->defvalueString_ = "(0,0)";
 
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-
-        // Strip the value-string
-        unsigned int pos1 = valueString.find("(") + 1;
-        unsigned int pos2 = valueString.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector2
-        if (pos1 < valueString.length() && pos2 < valueString.length() && pos1 < pos2)
-        {
-            valueString = valueString.substr(pos1, pos2 - pos1);
-            std::vector<std::string> tokens = tokenize(valueString, ",");
-            if (!string2Number(this->value_vector2_.x, tokens[0], defvalue.x))
-                this->setConfigFileEntyToDefault();
-            if (!string2Number(this->value_vector2_.y, tokens[1], defvalue.y))
-                this->setConfigFileEntyToDefault();
-        }
-        else
-        {
-            this->value_vector2_ = defvalue;
-            this->setConfigFileEntyToDefault();
-        }
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -345,28 +294,8 @@
             this->defvalueString_ = "(0,0,0)";
 
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-
-        // Strip the value-string
-        unsigned int pos1 = valueString.find("(") + 1;
-        unsigned int pos2 = valueString.find(")", pos1);
-
-        // Try to convert the stripped value-string to Vector3
-        if (pos1 < valueString.length() && pos2 < valueString.length() && pos1 < pos2)
-        {
-            valueString = valueString.substr(pos1, pos2 - pos1);
-            std::vector<std::string> tokens = tokenize(valueString, ",");
-            if (!string2Number(this->value_vector3_.x, tokens[0], defvalue.x))
-                this->setConfigFileEntyToDefault();
-            if (!string2Number(this->value_vector3_.y, tokens[1], defvalue.y))
-                this->setConfigFileEntyToDefault();
-            if (!string2Number(this->value_vector3_.z, tokens[2], defvalue.z))
-                this->setConfigFileEntyToDefault();
-        }
-        else
-        {
-            this->value_vector3_ = defvalue;
-            this->setConfigFileEntyToDefault();
-        }
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
     }
 
@@ -391,36 +320,325 @@
             this->defvalueString_ = "(0,0,0,0)";
 
-        this->searchConfigFileLine();                                           // Search the entry in the config-file
-        std::string valueString = this->parseValueString();                     // Parses the value string from the config-file-entry
-
+        this->searchConfigFileLine();                                               // Search the entry in the config-file
+        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
+        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
+            this->resetConfigFileEntry();                                           // The conversion failed
+    }
+
+    /**
+        @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
+        @return True if the string was successfully parsed
+    */
+    bool ConfigValueContainer::parseSting(const std::string& input)
+    {
+        if (this->type_ == ConfigValueContainer::Int)
+            return this->parseSting(input, this->value_.value_int_);
+        else if (this->type_ == ConfigValueContainer::uInt)
+            return this->parseSting(input, this->value_.value_uint_);
+        else if (this->type_ == ConfigValueContainer::Char)
+            return this->parseSting(input, this->value_.value_char_);
+        else if (this->type_ == ConfigValueContainer::uChar)
+            return this->parseSting(input, this->value_.value_uchar_);
+        else if (this->type_ == ConfigValueContainer::Float)
+            return this->parseSting(input, this->value_.value_float_);
+        else if (this->type_ == ConfigValueContainer::Double)
+            return this->parseSting(input, this->value_.value_double_);
+        else if (this->type_ == ConfigValueContainer::LongDouble)
+            return this->parseSting(input, this->value_.value_long_double_);
+        else if (this->type_ == ConfigValueContainer::Bool)
+            return this->parseSting(input, this->value_.value_bool_);
+        else if (this->type_ == ConfigValueContainer::String)
+            return this->parseSting(input, this->value_string_);
+        else if (this->type_ == ConfigValueContainer::ConstChar)
+            return this->parseSting(input, this->value_string_);
+        else if (this->type_ == ConfigValueContainer::Vector2)
+            return this->parseSting(input, this->value_vector2_);
+        else if (this->type_ == ConfigValueContainer::Vector3)
+            return this->parseSting(input, this->value_vector3_);
+        else if (this->type_ == ConfigValueContainer::ColourValue)
+            return this->parseSting(input, this->value_colourvalue_);
+
+        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::parseSting(const std::string& input, int defvalue)
+    {
+        return string2Number(this->value_.value_int_, input, defvalue);
+    }
+
+    /**
+        @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::parseSting(const std::string& input, unsigned int defvalue)
+    {
+        return string2Number(this->value_.value_uint_, input, defvalue);
+    }
+
+    /**
+        @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::parseSting(const std::string& input, char defvalue)
+    {
+        // I used value_int_ instead of value_char_ to avoid number <-> char confusion in the config-file
+        return string2Number(this->value_.value_int_, input, (int)defvalue);
+    }
+
+    /**
+        @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::parseSting(const std::string& input, unsigned char defvalue)
+    {
+        // I used value_uint_ instead of value_uchar_ to avoid number <-> char confusion in the config-file
+        return string2Number(this->value_.value_uint_, input, (unsigned int)defvalue);
+    }
+
+    /**
+        @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::parseSting(const std::string& input, float defvalue)
+    {
+        return string2Number(this->value_.value_float_, input, defvalue);
+    }
+
+    /**
+        @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::parseSting(const std::string& input, double defvalue)
+    {
+        return string2Number(this->value_.value_double_, 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::parseSting(const std::string& input, long double defvalue)
+    {
+        return string2Number(this->value_.value_long_double_, input, defvalue);
+    }
+
+    /**
+        @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::parseSting(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_.value_bool_ = 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_.value_bool_ = false;
+        else
+        {
+            // Its not a known word - is it a number?
+            return string2Number(this->value_.value_bool_, input, defvalue);
+        }
+
+        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::parseSting(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_string_ = input.substr(pos1, pos2 - pos1);
+            return true;
+        }
+
+        // It wasn't - use the default-value and restore the entry in the config-file.
+        this->value_string_ = 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::parseSting(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_string_ = input.substr(pos1, pos2 - pos1);
+            return true;
+        }
+
+        // It wasn't - use the default-value and restore the entry in the config-file.
+        this->value_string_ = defvalue;
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type Ogre::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::parseSting(const std::string& input, const Ogre::Vector2& defvalue)
+    {
         // Strip the value-string
-        unsigned int pos1 = valueString.find("(") + 1;
-        unsigned int pos2 = valueString.find(")", pos1);
+        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 (!string2Number(this->value_vector2_.x, tokens[0], defvalue.x))
+            {
+                this->value_vector2_ = defvalue;
+                return false;
+            }
+            if (!string2Number(this->value_vector2_.y, tokens[1], defvalue.y))
+            {
+                this->value_vector2_ = defvalue;
+                return false;
+            }
+
+            return true;
+        }
+
+        this->value_vector2_ = defvalue;
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type Ogre::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::parseSting(const std::string& input, const Ogre::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 < valueString.length() && pos2 < valueString.length() && pos1 < pos2)
-        {
-            valueString = valueString.substr(pos1, pos2 - pos1);
-            std::vector<std::string> tokens = tokenize(valueString, ",");
+        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
+        {
+            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
+            if (!string2Number(this->value_vector3_.x, tokens[0], defvalue.x))
+            {
+                this->value_vector3_ = defvalue;
+                return false;
+            }
+            if (!string2Number(this->value_vector3_.y, tokens[1], defvalue.y))
+            {
+                this->value_vector3_ = defvalue;
+                return false;
+            }
+            if (!string2Number(this->value_vector3_.z, tokens[2], defvalue.z))
+            {
+                this->value_vector3_ = defvalue;
+                return false;
+            }
+
+            return true;
+        }
+
+        this->value_vector3_ = defvalue;
+        return false;
+    }
+
+    /**
+        @brief Parses a given std::string into a value of the type Ogre::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::parseSting(const std::string& input, const Ogre::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 (!string2Number(this->value_colourvalue_.r, tokens[0], defvalue.r))
-                this->setConfigFileEntyToDefault();
+            {
+                this->value_colourvalue_ = defvalue;
+                return false;
+            }
             if (!string2Number(this->value_colourvalue_.g, tokens[1], defvalue.g))
-                this->setConfigFileEntyToDefault();
+            {
+                this->value_colourvalue_ = defvalue;
+                return false;
+            }
             if (!string2Number(this->value_colourvalue_.b, tokens[2], defvalue.b))
-                this->setConfigFileEntyToDefault();
+            {
+                this->value_colourvalue_ = defvalue;
+                return false;
+            }
             if (!string2Number(this->value_colourvalue_.a, tokens[3], defvalue.a))
-                this->setConfigFileEntyToDefault();
-        }
-        else
-        {
-            this->value_colourvalue_ = defvalue;
-            this->setConfigFileEntyToDefault();
-        }
-    }
-
-    /**
-        @brief Sets the corresponding enty in the config-file back to the default value.
-    */
-    void ConfigValueContainer::setConfigFileEntyToDefault()
+            {
+                this->value_colourvalue_ = defvalue;
+                return false;
+            }
+
+            return true;
+        }
+
+        this->value_colourvalue_ = defvalue;
+        return false;
+    }
+
+    /**
+        @brief Sets the corresponding entry in the config-file back to the default value.
+    */
+    void ConfigValueContainer::resetConfigFileEntry()
     {
         (*this->configFileLine_) = this->varname_ + "=" + this->defvalueString_;
@@ -428,4 +646,11 @@
     }
 
+    /**
+        @brief Sets the value of the variable back to the default value.
+    */
+    void ConfigValueContainer::resetConfigValue()
+    {
+        parseSting(this->defvalueString_);
+    }
 
     /**
Index: /code/branches/FICN/src/orxonox/core/ConfigValueContainer.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/ConfigValueContainer.h	(revision 702)
+++ /code/branches/FICN/src/orxonox/core/ConfigValueContainer.h	(revision 703)
@@ -73,4 +73,21 @@
     {
         public:
+            enum VariableType
+            {
+                Int,
+                uInt,
+                Char,
+                uChar,
+                Float,
+                Double,
+                LongDouble,
+                Bool,
+                ConstChar,
+                String,
+                Vector2,
+                Vector3,
+                ColourValue
+            };
+
             ConfigValueContainer(const std::string& classname, const std::string& varname, int defvalue);
             ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned int defvalue);
@@ -79,4 +96,5 @@
             ConfigValueContainer(const std::string& classname, const std::string& varname, float defvalue);
             ConfigValueContainer(const std::string& classname, const std::string& varname, double defvalue);
+            ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue);
             ConfigValueContainer(const std::string& classname, const std::string& varname, bool defvalue);
             ConfigValueContainer(const std::string& classname, const std::string& varname, const std::string& defvalue);
@@ -85,16 +103,4 @@
             ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector3 defvalue);
             ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::ColourValue defvalue);
-
-            static std::list<std::string>& getConfigFileLines();
-            static bool finishedReadingConfigFile(bool finished = false);
-            void setConfigFileEntyToDefault();
-            void searchConfigFileLine();
-            std::string parseValueString(bool bStripped = true);
-
-            static std::string getStrippedLine(const std::string& line);
-            static bool isEmpty(const std::string& line);
-            static bool isComment(const std::string& line);
-            static void readConfigFile(const std::string& filename);
-            static void writeConfigFile(const std::string& filename);
 
             /** @returns the value. @param value This is only needed to determine the right type. */
@@ -111,4 +117,6 @@
             inline double getValue(double value)                                { return this->value_.value_double_; }
             /** @returns the value. @param value This is only needed to determine the right type. */
+            inline double getValue(long double value)                           { return this->value_.value_long_double_; }
+            /** @returns the value. @param value This is only needed to determine the right type. */
             inline bool getValue(bool value)                                    { return this->value_.value_bool_; }
             /** @returns the value. @param value This is only needed to determine the right type. */
@@ -123,5 +131,34 @@
             inline Ogre::ColourValue getValue(const Ogre::ColourValue& value)   { return this->value_colourvalue_; }
 
+            bool parseSting(const std::string& input);
+            void resetConfigFileEntry();
+            void resetConfigValue();
+
         private:
+            bool parseSting(const std::string& input, int defvalue);
+            bool parseSting(const std::string& input, unsigned int defvalue);
+            bool parseSting(const std::string& input, char defvalue);
+            bool parseSting(const std::string& input, unsigned char defvalue);
+            bool parseSting(const std::string& input, float defvalue);
+            bool parseSting(const std::string& input, double defvalue);
+            bool parseSting(const std::string& input, long double defvalue);
+            bool parseSting(const std::string& input, bool defvalue);
+            bool parseSting(const std::string& input, const std::string& defvalue);
+            bool parseSting(const std::string& input, const char* defvalue);
+            bool parseSting(const std::string& input, const Ogre::Vector2& defvalue);
+            bool parseSting(const std::string& input, const Ogre::Vector3& defvalue);
+            bool parseSting(const std::string& input, const Ogre::ColourValue& defvalue);
+
+            static std::list<std::string>& getConfigFileLines();
+            static bool finishedReadingConfigFile(bool finished = false);
+            void searchConfigFileLine();
+            std::string parseValueString(bool bStripped = true);
+
+            static std::string getStrippedLine(const std::string& line);
+            static bool isEmpty(const std::string& line);
+            static bool isComment(const std::string& line);
+            static void readConfigFile(const std::string& filename);
+            static void writeConfigFile(const std::string& filename);
+
             std::string         classname_;                     //!< The name of the class the variable belongs to
             std::string         varname_;                       //!< The name of the variable
@@ -136,4 +173,5 @@
                 float               value_float_;               //!< The value, if the variable is of the type float
                 double              value_double_;              //!< The value, if the variable is of the type double
+                long double         value_long_double_;         //!< The value, if the variable is of the type long double
                 bool                value_bool_;                //!< The value, if the variable is of the type bool
             } value_;                                           //!< The value of the variable
@@ -146,19 +184,5 @@
             std::list<std::string>::iterator configFileLine_;   //!< An iterator, pointing to the entry of the variable in the config-file
 
-            enum VariableType
-            {
-                Int,
-                uInt,
-                Char,
-                uChar,
-                Float,
-                Double,
-                Bool,
-                ConstChar,
-                String,
-                Vector2,
-                Vector3,
-                ColourValue
-            } type_;                                            //!< The type of the variable
+            VariableType type_;                                 //!< The type of the variable
     };
 }
Index: /code/branches/FICN/src/orxonox/core/CoreIncludes.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/CoreIncludes.h	(revision 702)
+++ /code/branches/FICN/src/orxonox/core/CoreIncludes.h	(revision 703)
@@ -143,3 +143,17 @@
     varname = container##varname->getValue(varname)
 
+/**
+    @brief Sets the variable 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(); \
+        varname = container##varname->getValue(varname); \
+    } \
+    else \
+        COUT(2) << "Warning: Couldn't reset variable " << #varname << ", corresponding container doesn't exist." << std::endl
+
 #endif /* _CoreIncludes_H__ */
