Index: code/branches/core2/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- code/branches/core2/src/orxonox/core/ConfigValueContainer.cc	(revision 949)
+++ code/branches/core2/src/orxonox/core/ConfigValueContainer.cc	(revision 957)
@@ -34,7 +34,7 @@
 
 #include "ConfigValueContainer.h"
-#include "util/Tokenizer.h"
-#include "util/Convert.h"
 #include "Language.h"
+#include "Iterator.h"
+#include "BaseObject.h"
 
 #define CONFIGFILEPATH "orxonox.ini"
@@ -49,129 +49,48 @@
         @param defvalue The default-value
     */
-    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, MultiTypeMath defvalue)
+    ConfigValueContainer::ConfigValueContainer(Identifier* identifier, const std::string& varname, MultiTypeMath defvalue)
     {
         this->bAddedDescription_ = false;
-        this->classname_ = classname;
+        this->identifier_ = identifier;
         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";
-            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;
+        this->defvalueString_ = defvalue.toString();                                // Convert the default-value to a string
+        this->searchLineInConfigFile();                                             // Search the entry in the config-file
+
+        std::string valueString = this->parseValueStringFromConfigFile(!(defvalue.isA(MT_string) || defvalue.isA(MT_constchar)));     // Parses the value string from the config-file-entry
+        if (!this->parse(valueString, defvalue))                                    // Try to convert the string to a value
+            this->resetLineInConfigFile();                                            // The conversion failed
+    }
+
+    /**
+        @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)
+    {
+        bool success = this->tset(input);
+        this->setLineInConfigFile(input);
+        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 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);
+        this->identifier_->updateConfigValues();
+        return success;
+    }
+
+    /**
+        @brief Sets the value of the variable back to the default value and resets the config-file entry.
+    */
+    bool ConfigValueContainer::reset()
+    {
+        return this->set(this->defvalueString_);
     }
 
@@ -181,468 +100,43 @@
         @return True if the string was successfully parsed
     */
-    bool ConfigValueContainer::parseString(const std::string& input, const 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());
-
+    bool ConfigValueContainer::parse(const std::string& input)
+    {
+        MultiTypeMath temp = this->value_;
+        if (temp.fromString(input))
+        {
+            this->value_ = temp;
+            return true;
+        }
         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.
+        @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
+        @param defvalue The default value to assign if the parsing fails
         @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);
+    bool ConfigValueContainer::parse(const std::string& input, const MultiTypeMath& defvalue)
+    {
+        MultiTypeMath temp = defvalue;
+        if (temp.fromString(input))
+        {
+            this->value_ = temp;
+            return true;
+        }
         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);
+            this->value_ = defvalue;
+            return false;
+        }
+    }
+
+    /**
+        @brief Sets the corresponding entry in the config-file to a given value.
+    */
+    void ConfigValueContainer::setLineInConfigFile(const std::string& input)
+    {
+        (*this->configFileLine_) = this->varname_ + "=" + input;
+        ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);
     }
 
@@ -650,17 +144,7 @@
         @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();
+    void ConfigValueContainer::resetLineInConfigFile()
+    {
+        this->setLineInConfigFile(this->defvalueString_);
     }
 
@@ -668,5 +152,5 @@
         @brief Searches the corresponding entry in the config-file and creates it, if there is no entry.
     */
-    void ConfigValueContainer::searchConfigFileLine()
+    void ConfigValueContainer::searchLineInConfigFile()
     {
         // Read the file if needed
@@ -677,5 +161,5 @@
         std::string section = "";
         section.append("[");
-        section.append(this->classname_);
+        section.append(this->identifier_->getName());
         section.append("]");
 
@@ -686,5 +170,5 @@
         {
             // Don't try to parse comments
-            if (this->isComment(*it1))
+            if (isComment(*it1))
                 continue;
 
@@ -700,5 +184,5 @@
                 {
                     // Don't try to parse comments
-                    if (this->isComment(*it2))
+                    if (isComment(*it2))
                         continue;
 
@@ -706,5 +190,5 @@
                     // 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 (isEmpty(*it2))
                     {
                         if (!bLineIsEmpty)
@@ -760,59 +244,11 @@
         {
             // 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->identifier_->getName() + "]");                   // 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] == '/'))
-            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;
+            this->getConfigFileLines().push_back("");                                             // Add an empty line - this is needed for the algorithm in the searchLineInConfigFile-function
+            ConfigValueContainer::writeConfigFile(CONFIGFILEPATH);                                // Save the changed config-file
+        }
     }
 
@@ -822,9 +258,9 @@
         @return The value-string
     */
-    std::string ConfigValueContainer::parseValueString(bool bStripped)
+    std::string ConfigValueContainer::parseValueStringFromConfigFile(bool bStripped)
     {
         std::string output;
         if (bStripped)
-            output = this->getStrippedLine(*this->configFileLine_);
+            output = getStripped(*this->configFileLine_);
         else
             output = *this->configFileLine_;
@@ -889,5 +325,4 @@
             file.getline(line, 1024);
             ConfigValueContainer::getConfigFileLines().push_back(line);
-//            std::cout << "### ->" << line << "<- : empty: " << isEmpty(line) << " comment: " << isComment(line) << std::endl;
         }
 
@@ -896,10 +331,7 @@
 
         // Add an empty line to the end of the file if needed
-        // this is needed for the algorithm in the searchConfigFileLine-function
+        // this is needed for the algorithm in the searchLineInConfigFile-function
         if ((ConfigValueContainer::getConfigFileLines().size() > 0) && !isEmpty(*ConfigValueContainer::getConfigFileLines().rbegin()))
-        {
-//            std::cout << "### newline added" << std::endl;
             ConfigValueContainer::getConfigFileLines().push_back("");
-        }
 
         file.close();
@@ -949,5 +381,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;
