Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 1735)
+++ code/trunk/src/util/CMakeLists.txt	(revision 1747)
@@ -2,9 +2,10 @@
   ArgReader.cc
   Clipboard.cc
+  Error.cc
   ExprParser.cc
   Math.cc
-  MultiTypePrimitive.cc
-  MultiTypeString.cc
-  MultiTypeMath.cc
+  MultiType.cc
+  OutputBuffer.cc
+  OutputHandler.cc
   String.cc
   SubString.cc
Index: code/trunk/src/util/Convert.h
===================================================================
--- code/trunk/src/util/Convert.h	(revision 1735)
+++ code/trunk/src/util/Convert.h	(revision 1747)
@@ -41,6 +41,6 @@
 
 #include "Math.h"
+#include "Debug.h"
 #include "SubString.h"
-#include "MultiTypeMath.h"
 #include "String.h"
 
@@ -75,5 +75,8 @@
     enum { specialized = false };
     static bool convert(ToType* output, const FromType& input)
-    { return false; }
+    {
+        COUT(2) << "Warning: Couldn't convert a value: From \"" << typeid(FromType).name() << "\" to \"" << typeid(ToType).name() << "\"" << std::endl;
+        return false;
+    }
 };
 
@@ -95,20 +98,22 @@
 
 // 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__ }; };
+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<long long>          { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned long 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__ }; };
 
 
@@ -140,4 +145,5 @@
     static bool convert(ToType* output, const FromType& input)
     {
+        COUT(2) << "Warning: Couldn't convert a value: From \"" << typeid(FromType).name() << "\" to \"" << typeid(ToType).name() << "\"" << std::endl;
         return false;
     }
@@ -330,85 +336,32 @@
 
 
-////////////////
-// MULTITYPES //
-////////////////
-
-// 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_vector4)
-            return ConvertValue(output, input.getVector4());
-        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);
+//////////
+// MATH //
+//////////
+// convert everything to Degree
+template <class FromType>
+struct ConverterSpecialized<FromType, Ogre::Degree, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(Ogre::Degree* output, const FromType& input)
+    {
+        float angle = 0;
+        bool success = ConvertValue<FromType, float>(&angle, input);
+        (*output) = angle;
+        return success;
+    }
+};
+
+// convert everything to Radian
+template <class FromType>
+struct ConverterSpecialized<FromType, Ogre::Radian, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(Ogre::Radian* output, const FromType& input)
+    {
+        float angle = 0;
+        bool success = ConvertValue<FromType, float>(&angle, input);
+        (*output) = angle;
+        return success;
     }
 };
Index: code/trunk/src/util/Debug.h
===================================================================
--- code/trunk/src/util/Debug.h	(revision 1747)
+++ code/trunk/src/util/Debug.h	(revision 1747)
@@ -0,0 +1,234 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Benjamin Grauer
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+/**
+ * @file Debug.h
+ * @brief Handles the output for different verbose-modes.
+ *
+ * There are two modes: HARD and SOFT. HARD is precessed during compiletime, while SOFT is for runtime.
+ */
+
+#ifndef _Debug_H__
+#define _Debug_H__
+
+#include "UtilPrereqs.h"
+
+#include <stdio.h>
+
+#include "OutputHandler.h"
+
+
+/**
+    @brief Returns the soft debug level, stored in the only existing instance of the OutputHandler class, configured in the config-file.
+    @return The soft debug level
+*/
+static inline int getSoftDebugLevel()
+{
+    return orxonox::OutputHandler::getSoftDebugLevel();
+}
+
+
+// DEFINE ERROR MODES
+#define ORX_NONE            0
+#define ORX_ERROR           1
+#define ORX_WARNING         2
+#define ORX_INFO            3
+#define ORX_DEBUG           4
+#define ORX_VERBOSE         5
+#define ORX_ULTRA           6
+
+//definitions
+#define ORX_PRINT_DEBUG_OUTPUT 1
+#define ORX_HARD_DEBUG_LEVEL ORX_VERBOSE
+
+#define COUT_EXEC(x) orxonox::OutputHandler::getOutStream().setOutputLevel(x)
+
+////////////////////////////////////////////////////////
+///  COUT: just prints output as is with std::cout   ///
+////////////////////////////////////////////////////////
+#define COUTORX_NONE    COUT0
+#define COUTORX_ERROR   COUT1
+#define COUTORX_WARNING COUT2
+#define COUTORX_INFO    COUT3
+#define COUTORX_DEBUG   COUT4
+#define COUTORX_VERBOSE COUT5
+#define COUTORX_ULTRA   COUT6
+
+#ifndef COUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define COUT(x) \
+   COUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define COUT0 \
+    (getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : COUT_EXEC(0)
+  #else
+   #define COUT0 \
+    false ? COUT_EXEC(0) : COUT_EXEC(0)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define COUT1 \
+    (getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : COUT_EXEC(1)
+  #else
+   #define COUT1 \
+    false ? COUT_EXEC(1) : COUT_EXEC(1)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define COUT2 \
+    (getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : COUT_EXEC(2)
+  #else
+   #define COUT2 \
+    false ? COUT_EXEC(2) : COUT_EXEC(2)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define COUT3 \
+    (getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : COUT_EXEC(3)
+  #else
+   #define COUT3 \
+    false ? COUT_EXEC(3) : COUT_EXEC(3)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define COUT4 \
+    (getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : COUT_EXEC(4)
+  #else
+   #define COUT4 \
+    false ? COUT_EXEC(4) : COUT_EXEC(4)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
+   #define COUT5 \
+    (getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : COUT_EXEC(5)
+  #else
+   #define COUT5 \
+    false ? COUT_EXEC(5) : COUT_EXEC(5)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
+   #define COUT6 \
+    (getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : COUT_EXEC(6)
+  #else
+   #define COUT6 \
+    false ? COUT_EXEC(6) : COUT_EXEC(6)
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define COUT(x) \
+    false ? COUT_EXEC(6) : COUT_EXEC(6)
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+#endif /* ifndef COUT */
+
+
+/////////////////////////////////////////////////////////////////////
+///  CCOUT: Prints output with std::cout and adds the classname   ///
+/////////////////////////////////////////////////////////////////////
+#define CCOUTORX_NONE    CCOUT0
+#define CCOUTORX_ERROR   CCOUT1
+#define CCOUTORX_WARNING CCOUT2
+#define CCOUTORX_INFO    CCOUT3
+#define CCOUTORX_DEBUG   CCOUT4
+#define CCOUTORX_VERBOSE CCOUT5
+#define CCOUTORX_ULTRA   CCOUT6
+
+#define CCOUT_EXEC(x) \
+  orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
+  << this->getIdentifier()->getName() << ": "
+
+#ifndef CCOUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define CCOUT(x) \
+   CCOUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define CCOUT0 \
+    (getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : CCOUT_EXEC(0)
+  #else
+   #define CCOUT0 \
+    false ? COUT_EXEC(0) : CCOUT_EXEC(0)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define CCOUT1 \
+    (getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : CCOUT_EXEC(1)
+  #else
+   #define CCOUT1 \
+    false ? COUT_EXEC(1) : CCOUT_EXEC(1)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define CCOUT2 \
+    (getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : CCOUT_EXEC(2)
+  #else
+   #define CCOUT2 \
+    false ? COUT_EXEC(2) : CCOUT_EXEC(2)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define CCOUT3 \
+    (getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : CCOUT_EXEC(3)
+  #else
+   #define CCOUT3 \
+    false ? COUT_EXEC(3) : CCOUT_EXEC(3)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define CCOUT4 \
+    (getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : CCOUT_EXEC(4)
+  #else
+   #define CCOUT4 \
+    false ? COUT_EXEC(4) : CCOUT_EXEC(4)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
+   #define CCOUT5 \
+    (getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : CCOUT_EXEC(5)
+  #else
+   #define CCOUT5 \
+    false ? COUT_EXEC(5) : CCOUT_EXEC(5)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
+   #define CCOUT6 \
+    (getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : CCOUT_EXEC(6)
+  #else
+   #define CCOUT6 \
+    false ? COUT_EXEC(6) : CCOUT_EXEC(6)
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define CCOUT(x) \
+   false ? CCOUT_EXEC(6) : CCOUT_EXEC(6)
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+#endif /* ifndef CCOUT */
+
+#endif /* _Debug_H__ */
Index: code/trunk/src/util/Error.cc
===================================================================
--- code/trunk/src/util/Error.cc	(revision 1747)
+++ code/trunk/src/util/Error.cc	(revision 1747)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Nicolas Perrenoud
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Error.cc
+    @brief Implementation of the Error class.
+*/
+
+#include "Error.h"
+#include "Debug.h"
+
+namespace orxonox
+{
+	Error::Error(std::string errorMsg, int errorCode)
+	{
+		COUT(1) << "############################ " << std::endl
+					  << "#         Error " << errorCode << "          #" << std::endl
+						<< "############################ " << std::endl
+						<< "An error occured in Orxonox: " << std::endl;
+
+		if (errorMsg == "")
+		{
+			switch (errorCode)
+			{
+				case 1:
+					errorMsg = "Some error!";
+					break;
+
+				default:
+					errorMsg = "Unknown error!";
+			}
+		}
+		COUT(1) << errorMsg << std::endl << std::endl;
+	}
+}
Index: code/trunk/src/util/Error.h
===================================================================
--- code/trunk/src/util/Error.h	(revision 1747)
+++ code/trunk/src/util/Error.h	(revision 1747)
@@ -0,0 +1,52 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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:
+ *      Nicolas Perrenoud
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Error.h
+    @brief Definition of the Error class.
+*/
+
+#ifndef _Error_H__
+#define _Error_H__
+
+#include "UtilPrereqs.h"
+
+#include <string>
+
+namespace orxonox
+{
+	class _UtilExport Error
+	{
+	public:
+		Error(std::string errorMsg = "", int errorCode = 0);
+	private:
+
+	};
+}
+
+#endif /* _Error_H__ */
Index: code/trunk/src/util/MultiType.cc
===================================================================
--- code/trunk/src/util/MultiType.cc	(revision 1747)
+++ code/trunk/src/util/MultiType.cc	(revision 1747)
@@ -0,0 +1,190 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 "MultiType.h"
+#include "MultiTypeValue.h"
+
+void MultiType::convert(MT_Type type)
+{
+    switch (type)
+    {
+        case MT_char:
+            this->convert<char>(); break;
+        case MT_uchar:
+            this->convert<unsigned char>(); break;
+        case MT_short:
+            this->convert<short>(); break;
+        case MT_ushort:
+            this->convert<unsigned short>(); break;
+        case MT_int:
+            this->convert<int>(); break;
+        case MT_uint:
+            this->convert<unsigned int>(); break;
+        case MT_long:
+            this->convert<long>(); break;
+        case MT_ulong:
+            this->convert<unsigned long>(); break;
+        case MT_longlong:
+            this->convert<long long>(); break;
+        case MT_ulonglong:
+            this->convert<unsigned long long>(); break;
+        case MT_float:
+            this->convert<float>(); break;
+        case MT_double:
+            this->convert<double>(); break;
+        case MT_longdouble:
+            this->convert<long double>(); break;
+        case MT_bool:
+            this->convert<bool>(); break;
+        case MT_void:
+            this->convert<void*>(); break;
+        case MT_string:
+            this->convert<std::string>(); break;
+        case MT_vector2:
+            this->convert<orxonox::Vector2>(); break;
+        case MT_vector3:
+            this->convert<orxonox::Vector3>(); break;
+        case MT_vector4:
+            this->convert<orxonox::Vector4>(); break;
+        case MT_colourvalue:
+            this->convert<orxonox::ColourValue>(); break;
+        case MT_quaternion:
+            this->convert<orxonox::Quaternion>(); break;
+        case MT_radian:
+            this->convert<orxonox::Radian>(); break;
+        case MT_degree:
+            this->convert<orxonox::Degree>(); break;
+        default:
+            this->reset(); break;
+    };
+}
+
+std::string MultiType::getTypename() const
+{
+    MT_Type type = (this->value_) ? this->value_->type_ : MT_null;
+
+    switch (type)
+    {
+        case MT_char:
+            return "char"; break;
+        case MT_uchar:
+            return "unsigned char"; break;
+        case MT_short:
+            return "short"; break;
+        case MT_ushort:
+            return "unsigned short"; break;
+        case MT_int:
+            return "int"; break;
+        case MT_uint:
+            return "unsigned int"; break;
+        case MT_long:
+            return "long"; break;
+        case MT_ulong:
+            return "unsigned long"; break;
+        case MT_longlong:
+            return "long long"; break;
+        case MT_ulonglong:
+            return "unsigned long long"; break;
+        case MT_float:
+            return "float"; break;
+        case MT_double:
+            return "double"; break;
+        case MT_longdouble:
+            return "long double"; break;
+        case MT_bool:
+            return "bool"; break;
+        case MT_void:
+            return "void*"; break;
+        case MT_string:
+            return "std::string"; break;
+        case MT_vector2:
+            return "orxonox::Vector2"; break;
+        case MT_vector3:
+            return "orxonox::Vector3"; break;
+        case MT_vector4:
+            return "orxonox::Vector4"; break;
+        case MT_colourvalue:
+            return "orxonox::ColourValue"; break;
+        case MT_quaternion:
+            return "orxonox::Quaternion"; break;
+        case MT_radian:
+            return "orxonox::Radian"; break;
+        case MT_degree:
+            return "orxonox::Degree"; break;
+        default:
+            return "unknown"; break;
+    };
+}
+
+MultiType::operator char()                 const { return (this->value_) ? ((this->value_->type_ == MT_char       ) ? ((MT_Value<char>                *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? ((MT_Value<unsigned char>       *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? ((MT_Value<short>               *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? ((MT_Value<unsigned short>      *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? ((MT_Value<int>                 *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? ((MT_Value<unsigned int>        *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? ((MT_Value<long>                *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? ((MT_Value<unsigned long>       *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? ((MT_Value<long long>           *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator unsigned long long()   const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong  ) ? ((MT_Value<unsigned long long>  *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? ((MT_Value<float>               *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? ((MT_Value<double>              *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? ((MT_Value<long double>         *)this->value_)->value_ : (*this->value_)) : 0;                      }
+MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? ((MT_Value<bool>                *)this->value_)->value_ : (*this->value_)) : false;                  }
+MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? ((MT_Value<void*>               *)this->value_)->value_ : (*this->value_)) : (void*)0;               }
+MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? ((MT_Value<std::string>         *)this->value_)->value_ : (*this->value_)) : std::string();          }
+MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? ((MT_Value<orxonox::Vector2>    *)this->value_)->value_ : (*this->value_)) : orxonox::Vector2();     }
+MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? ((MT_Value<orxonox::Vector3>    *)this->value_)->value_ : (*this->value_)) : orxonox::Vector3();     }
+MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? ((MT_Value<orxonox::Vector4>    *)this->value_)->value_ : (*this->value_)) : orxonox::Vector4();     }
+MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? ((MT_Value<orxonox::ColourValue>*)this->value_)->value_ : (*this->value_)) : orxonox::ColourValue(); }
+MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? ((MT_Value<orxonox::Quaternion> *)this->value_)->value_ : (*this->value_)) : orxonox::Quaternion();  }
+MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? ((MT_Value<orxonox::Radian>     *)this->value_)->value_ : (*this->value_)) : orxonox::Radian();      }
+MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? ((MT_Value<orxonox::Degree>     *)this->value_)->value_ : (*this->value_)) : orxonox::Degree();      }
+
+template <> void MultiType::createNewValueContainer(const char& value)                 { this->value_ = new MT_Value<char>                (value, MT_char       ); }
+template <> void MultiType::createNewValueContainer(const unsigned char& value)        { this->value_ = new MT_Value<unsigned char>       (value, MT_uchar      ); }
+template <> void MultiType::createNewValueContainer(const short& value)                { this->value_ = new MT_Value<short>               (value, MT_short      ); }
+template <> void MultiType::createNewValueContainer(const unsigned short& value)       { this->value_ = new MT_Value<unsigned short>      (value, MT_ushort     ); }
+template <> void MultiType::createNewValueContainer(const int& value)                  { this->value_ = new MT_Value<int>                 (value, MT_int        ); }
+template <> void MultiType::createNewValueContainer(const unsigned int& value)         { this->value_ = new MT_Value<unsigned int>        (value, MT_uint       ); }
+template <> void MultiType::createNewValueContainer(const long& value)                 { this->value_ = new MT_Value<long>                (value, MT_long       ); }
+template <> void MultiType::createNewValueContainer(const unsigned long& value)        { this->value_ = new MT_Value<unsigned long>       (value, MT_ulong      ); }
+template <> void MultiType::createNewValueContainer(const long long& value)            { this->value_ = new MT_Value<long long>           (value, MT_longlong   ); }
+template <> void MultiType::createNewValueContainer(const unsigned long long& value)   { this->value_ = new MT_Value<unsigned long long>  (value, MT_ulonglong  ); }
+template <> void MultiType::createNewValueContainer(const float& value)                { this->value_ = new MT_Value<float>               (value, MT_float      ); }
+template <> void MultiType::createNewValueContainer(const double& value)               { this->value_ = new MT_Value<double>              (value, MT_double     ); }
+template <> void MultiType::createNewValueContainer(const long double& value)          { this->value_ = new MT_Value<long double>         (value, MT_longdouble ); }
+template <> void MultiType::createNewValueContainer(const bool& value)                 { this->value_ = new MT_Value<bool>                (value, MT_bool       ); }
+template <> void MultiType::createNewValueContainer(      void* const& value)          { this->value_ = new MT_Value<void*>               (value, MT_void       ); }
+template <> void MultiType::createNewValueContainer(const std::string& value)          { this->value_ = new MT_Value<std::string>         (value, MT_string     ); }
+template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value)     { this->value_ = new MT_Value<orxonox::Vector2>    (value, MT_vector2    ); }
+template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value)     { this->value_ = new MT_Value<orxonox::Vector3>    (value, MT_vector3    ); }
+template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value)     { this->value_ = new MT_Value<orxonox::Vector4>    (value, MT_vector4    ); }
+template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value) { this->value_ = new MT_Value<orxonox::ColourValue>(value, MT_colourvalue); }
+template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value)  { this->value_ = new MT_Value<orxonox::Quaternion> (value, MT_quaternion ); }
+template <> void MultiType::createNewValueContainer(const orxonox::Radian& value)      { this->value_ = new MT_Value<orxonox::Radian>     (value, MT_radian     ); }
+template <> void MultiType::createNewValueContainer(const orxonox::Degree& value)      { this->value_ = new MT_Value<orxonox::Degree>     (value, MT_degree     ); }
Index: code/trunk/src/util/MultiType.h
===================================================================
--- code/trunk/src/util/MultiType.h	(revision 1735)
+++ code/trunk/src/util/MultiType.h	(revision 1747)
@@ -25,5 +25,4 @@
  *      ...
  *
- *   Inspiration: MultiType by Benjamin Grauer
  */
 
@@ -33,23 +32,27 @@
 #include "UtilPrereqs.h"
 
-enum _UtilExport MultiType
+#include <boost/static_assert.hpp>
+
+#include "Math.h"
+
+enum MT_Type
 {
     MT_null,
-    MT_void,
-    MT_int,
-    MT_uint,
     MT_char,
     MT_uchar,
     MT_short,
     MT_ushort,
+    MT_int,
+    MT_uint,
     MT_long,
     MT_ulong,
+    MT_longlong,
+    MT_ulonglong,
     MT_float,
     MT_double,
     MT_longdouble,
     MT_bool,
-    MT_constchar,
+    MT_void,
     MT_string,
-    MT_xmlelement,
     MT_vector2,
     MT_vector3,
@@ -57,24 +60,355 @@
     MT_colourvalue,
     MT_quaternion,
-    MT_degree,
-    MT_radian
+    MT_radian,
+    MT_degree
 };
 
-union _UtilExport MultiTypeValue
+class _UtilExport MultiType
 {
-    void*           void_;
-    int             int_;
-    unsigned int    uint_;
-    char            char_;
-    unsigned char   uchar_;
-    short           short_;
-    unsigned short  ushort_;
-    long            long_;
-    unsigned long   ulong_;
-    float           float_;
-    double          double_;
-    long double     longdouble_;
-    bool            bool_;
+    _UtilExport friend std::ostream& operator<<(std::ostream& outstream, const MultiType& mt);
+    template <typename T> friend struct MT_Value;
+
+    struct _UtilExport MT_ValueBase
+    {
+        MT_ValueBase(MT_Type type) : type_(type) {}
+        virtual ~MT_ValueBase() {}
+
+        virtual MT_ValueBase* clone() const = 0;
+
+        virtual void reset() = 0;
+        virtual void assimilate(const MultiType& other) = 0;
+        const MT_Type& getType() const { return this->type_; }
+
+        virtual void setValue(const char& value)                 = 0;
+        virtual void setValue(const unsigned char& value)        = 0;
+        virtual void setValue(const short& value)                = 0;
+        virtual void setValue(const unsigned short& value)       = 0;
+        virtual void setValue(const int& value)                  = 0;
+        virtual void setValue(const unsigned int& value)         = 0;
+        virtual void setValue(const long& value)                 = 0;
+        virtual void setValue(const unsigned long& value)        = 0;
+        virtual void setValue(const long long& value)            = 0;
+        virtual void setValue(const unsigned long long& value)   = 0;
+        virtual void setValue(const float& value)                = 0;
+        virtual void setValue(const double& value)               = 0;
+        virtual void setValue(const long double& value)          = 0;
+        virtual void setValue(const bool& value)                 = 0;
+        virtual void setValue(      void* const& value)          = 0;
+        virtual void setValue(const std::string& value)          = 0;
+        virtual void setValue(const orxonox::Vector2& value)     = 0;
+        virtual void setValue(const orxonox::Vector3& value)     = 0;
+        virtual void setValue(const orxonox::Vector4& value)     = 0;
+        virtual void setValue(const orxonox::ColourValue& value) = 0;
+        virtual void setValue(const orxonox::Quaternion& value)  = 0;
+        virtual void setValue(const orxonox::Radian& value)      = 0;
+        virtual void setValue(const orxonox::Degree& value)      = 0;
+
+        virtual operator char()                 const = 0;
+        virtual operator unsigned char()        const = 0;
+        virtual operator short()                const = 0;
+        virtual operator unsigned short()       const = 0;
+        virtual operator int()                  const = 0;
+        virtual operator unsigned int()         const = 0;
+        virtual operator long()                 const = 0;
+        virtual operator unsigned long()        const = 0;
+        virtual operator long long()            const = 0;
+        virtual operator unsigned long long()   const = 0;
+        virtual operator float()                const = 0;
+        virtual operator double()               const = 0;
+        virtual operator long double()          const = 0;
+        virtual operator bool()                 const = 0;
+        virtual operator void*()                const = 0;
+        virtual operator std::string()          const = 0;
+        virtual operator orxonox::Vector2()     const = 0;
+        virtual operator orxonox::Vector3()     const = 0;
+        virtual operator orxonox::Vector4()     const = 0;
+        virtual operator orxonox::ColourValue() const = 0;
+        virtual operator orxonox::Quaternion()  const = 0;
+        virtual operator orxonox::Radian()      const = 0;
+        virtual operator orxonox::Degree()      const = 0;
+
+        virtual void toString(std::ostream& outstream) const = 0;
+
+        MT_Type type_;
+    };
+
+    public:
+        inline MultiType()                                  : value_(0) {}
+        inline MultiType(const char& value)                 : value_(0) { this->assignValue(value); }
+        inline MultiType(const unsigned char& value)        : value_(0) { this->assignValue(value); }
+        inline MultiType(const short& value)                : value_(0) { this->assignValue(value); }
+        inline MultiType(const unsigned short& value)       : value_(0) { this->assignValue(value); }
+        inline MultiType(const int& value)                  : value_(0) { this->assignValue(value); }
+        inline MultiType(const unsigned int& value)         : value_(0) { this->assignValue(value); }
+        inline MultiType(const long& value)                 : value_(0) { this->assignValue(value); }
+        inline MultiType(const unsigned long& value)        : value_(0) { this->assignValue(value); }
+        inline MultiType(const long long& value)            : value_(0) { this->assignValue(value); }
+        inline MultiType(const unsigned long long& value)   : value_(0) { this->assignValue(value); }
+        inline MultiType(const float& value)                : value_(0) { this->assignValue(value); }
+        inline MultiType(const double& value)               : value_(0) { this->assignValue(value); }
+        inline MultiType(const long double& value)          : value_(0) { this->assignValue(value); }
+        inline MultiType(const bool& value)                 : value_(0) { this->assignValue(value); }
+        inline MultiType(      void* const& value)          : value_(0) { this->assignValue(value); }
+        inline MultiType(const std::string& value)          : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Vector2& value)     : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Vector3& value)     : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Vector4& value)     : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::ColourValue& value) : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Quaternion& value)  : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }
+        inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }
+        inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); }
+        inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }
+        inline MultiType(MT_Type type)                      : value_(0) { this->setType(type); }
+
+        inline ~MultiType() { if (this->value_) { delete this->value_; } }
+
+        template <typename V> inline MultiType& operator=(const V& value)         { this->setValue(value); return (*this); }
+        inline                       MultiType& operator=(const MultiType& other) { this->setValue(other); return (*this); }
+        inline                       MultiType& operator=(MT_Type type)           { this->setType(type);   return (*this); }
+
+        inline void                                   setValue(const char& value);
+        inline void                                   setValue(const unsigned char& value);
+        inline void                                   setValue(const short& value);
+        inline void                                   setValue(const unsigned short& value);
+        inline void                                   setValue(const int& value);
+        inline void                                   setValue(const unsigned int& value);
+        inline void                                   setValue(const long& value);
+        inline void                                   setValue(const unsigned long& value);
+        inline void                                   setValue(const long long& value);
+        inline void                                   setValue(const unsigned long long& value);
+        inline void                                   setValue(const float& value);
+        inline void                                   setValue(const double& value);
+        inline void                                   setValue(const long double& value);
+        inline void                                   setValue(const bool& value);
+        inline void                                   setValue(      void* const& value);
+        inline void                                   setValue(const std::string& value);
+        inline void                                   setValue(const orxonox::Vector2& value);
+        inline void                                   setValue(const orxonox::Vector3& value);
+        inline void                                   setValue(const orxonox::Vector4& value);
+        inline void                                   setValue(const orxonox::ColourValue& value);
+        inline void                                   setValue(const orxonox::Quaternion& value);
+        inline void                                   setValue(const orxonox::Radian& value);
+        inline void                                   setValue(const orxonox::Degree& value);
+        template <typename V> inline void             setValue(V* value)               { if (this->value_) { this->value_->setValue((void*)value); } else { this->assignValue((void*)value); } }
+        void                                          setValue(const MultiType& other) { if (this->value_) { this->value_->assimilate(other); } else { if (other.value_) { this->value_ = other.value_->clone(); } } }
+        template <typename T, typename V> inline void setValue(const V& value)         { this->setType<T>(); this->setValue(value); }
+        inline void                                   setValue(const char* value);
+
+        inline void                       copy(const MultiType& other)    { if (this == &other) { return; } if (this->value_) { delete this->value_; } this->value_ = (other.value_) ? other.value_->clone() : 0; }
+
+        template <typename T> inline void convert()                       { this->setValue<T>((T)(*this));  }
+        inline void                       convert(const MultiType& other) { this->convert(other.getType()); }
+        void                              convert(MT_Type type);
+
+        inline void                       reset()                         { if (this->value_) { delete this->value_; this->value_ = 0; } }
+
+        template <typename T> inline void setType()                       { this->assignValue(T());             }
+        inline void                       setType(const MultiType& other) { this->setType(other.getType());     }
+        inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); }
+
+        inline MT_Type                    getType()                 const { return (this->value_) ? this->value_->type_ : MT_null; }
+        inline bool                       isType(MT_Type type)      const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_null); }
+        template <typename T> inline bool isType()                  const { return false; }
+        std::string                       getTypename()             const;
+
+        operator char()                  const;
+        operator unsigned char()         const;
+        operator short()                 const;
+        operator unsigned short()        const;
+        operator int()                   const;
+        operator unsigned int()          const;
+        operator long()                  const;
+        operator unsigned long()         const;
+        operator long long()             const;
+        operator unsigned long long()    const;
+        operator float()                 const;
+        operator double()                const;
+        operator long double()           const;
+        operator bool()                  const;
+        operator void*()                 const;
+        operator std::string()           const;
+        operator orxonox::Vector2()      const;
+        operator orxonox::Vector3()      const;
+        operator orxonox::Vector4()      const;
+        operator orxonox::ColourValue()  const;
+        operator orxonox::Quaternion()   const;
+        operator orxonox::Radian()       const;
+        operator orxonox::Degree()       const;
+        template <class T> operator T*() const { return ((T*)this->operator void*()); }
+
+        inline void getValue(char*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(unsigned char*        value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(short*                value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(unsigned short*       value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(int*                  value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(unsigned int*         value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(long*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(unsigned long*        value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(long long*            value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(unsigned long long*   value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(float*                value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(double*               value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(long double*          value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(bool*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
+        inline void getValue(void*                 value) const { if (this->value_) {   value  = (*this->value_); } }
+        inline void getValue(std::string*          value) const { if (this->value_) { (*value) = this->value_->operator std::string();          } }
+        inline void getValue(orxonox::Vector2*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector2();     } }
+        inline void getValue(orxonox::Vector3*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector3();     } }
+        inline void getValue(orxonox::Vector4*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector4();     } }
+        inline void getValue(orxonox::ColourValue* value) const { if (this->value_) { (*value) = this->value_->operator orxonox::ColourValue(); } }
+        inline void getValue(orxonox::Quaternion*  value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Quaternion();  } }
+        inline void getValue(orxonox::Radian*      value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Radian();      } }
+        inline void getValue(orxonox::Degree*      value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Degree();      } }
+
+        inline char                     getChar()             const { return this->operator char();                 }
+        inline unsigned char            getUnsignedChar()     const { return this->operator unsigned char();        }
+        inline short                    getShort()            const { return this->operator short();                }
+        inline unsigned short           getUnsignedShort()    const { return this->operator unsigned short();       }
+        inline int                      getInt()              const { return this->operator int();                  }
+        inline unsigned int             getUnsignedInt()      const { return this->operator unsigned int();         }
+        inline long                     getLong()             const { return this->operator long();                 }
+        inline unsigned long            getUnsignedLong()     const { return this->operator unsigned long();        }
+        inline long long                getLongLong()         const { return this->operator long long();            }
+        inline unsigned long long       getUnsignedLongLong() const { return this->operator unsigned long long();   }
+        inline float                    getFloat()            const { return this->operator float();                }
+        inline double                   getDouble()           const { return this->operator double();               }
+        inline long double              getLongDouble()       const { return this->operator long double();          }
+        inline bool                     getBool()             const { return this->operator bool();                 }
+        inline void*                    getVoid()             const { return this->operator void*();                }
+        inline std::string              getString()           const { return this->operator std::string();          }
+        inline orxonox::Vector2         getVector2()          const { return this->operator orxonox::Vector2();     }
+        inline orxonox::Vector3         getVector3()          const { return this->operator orxonox::Vector3();     }
+        inline orxonox::Vector4         getVector4()          const { return this->operator orxonox::Vector4();     }
+        inline orxonox::ColourValue     getColourValue()      const { return this->operator orxonox::ColourValue(); }
+        inline orxonox::Quaternion      getQuaternion()       const { return this->operator orxonox::Quaternion();  }
+        inline orxonox::Radian          getRadian()           const { return this->operator orxonox::Radian();      }
+        inline orxonox::Degree          getDegree()           const { return this->operator orxonox::Degree();      }
+        template <typename T> inline T* getPointer()          const { return ((T*)this->getVoid());                 }
+
+    private:
+        inline void assignValue(const char& value)                 { if (this->value_ && this->value_->type_ == MT_char)        { this->value_->setValue(value); } else { this->changeValueContainer<char>(value);                 } }
+        inline void assignValue(const unsigned char& value)        { if (this->value_ && this->value_->type_ == MT_uchar)       { this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value);        } }
+        inline void assignValue(const short& value)                { if (this->value_ && this->value_->type_ == MT_short)       { this->value_->setValue(value); } else { this->changeValueContainer<short>(value);                } }
+        inline void assignValue(const unsigned short& value)       { if (this->value_ && this->value_->type_ == MT_ushort)      { this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value);       } }
+        inline void assignValue(const int& value)                  { if (this->value_ && this->value_->type_ == MT_int)         { this->value_->setValue(value); } else { this->changeValueContainer<int>(value);                  } }
+        inline void assignValue(const unsigned int& value)         { if (this->value_ && this->value_->type_ == MT_uint)        { this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value);         } }
+        inline void assignValue(const long& value)                 { if (this->value_ && this->value_->type_ == MT_long)        { this->value_->setValue(value); } else { this->changeValueContainer<long>(value);                 } }
+        inline void assignValue(const unsigned long& value)        { if (this->value_ && this->value_->type_ == MT_ulong)       { this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value);        } }
+        inline void assignValue(const long long& value)            { if (this->value_ && this->value_->type_ == MT_longlong)    { this->value_->setValue(value); } else { this->changeValueContainer<long long>(value);            } }
+        inline void assignValue(const unsigned long long& value)   { if (this->value_ && this->value_->type_ == MT_ulonglong)   { this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value);   } }
+        inline void assignValue(const float& value)                { if (this->value_ && this->value_->type_ == MT_float)       { this->value_->setValue(value); } else { this->changeValueContainer<float>(value);                } }
+        inline void assignValue(const double& value)               { if (this->value_ && this->value_->type_ == MT_double)      { this->value_->setValue(value); } else { this->changeValueContainer<double>(value);               } }
+        inline void assignValue(const long double& value)          { if (this->value_ && this->value_->type_ == MT_longdouble)  { this->value_->setValue(value); } else { this->changeValueContainer<long double>(value);          } }
+        inline void assignValue(const bool& value)                 { if (this->value_ && this->value_->type_ == MT_bool)        { this->value_->setValue(value); } else { this->changeValueContainer<bool>(value);                 } }
+        inline void assignValue(      void* const& value)          { if (this->value_ && this->value_->type_ == MT_void)        { this->value_->setValue(value); } else { this->changeValueContainer<void*>(value);                } }
+        inline void assignValue(const std::string& value)          { if (this->value_ && this->value_->type_ == MT_string)      { this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value);          } }
+        inline void assignValue(const orxonox::Vector2& value)     { if (this->value_ && this->value_->type_ == MT_vector2)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value);     } }
+        inline void assignValue(const orxonox::Vector3& value)     { if (this->value_ && this->value_->type_ == MT_vector3)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value);     } }
+        inline void assignValue(const orxonox::Vector4& value)     { if (this->value_ && this->value_->type_ == MT_vector4)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value);     } }
+        inline void assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_colourvalue) { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); } }
+        inline void assignValue(const orxonox::Quaternion& value)  { if (this->value_ && this->value_->type_ == MT_quaternion)  { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value);  } }
+        inline void assignValue(const orxonox::Radian& value)      { if (this->value_ && this->value_->type_ == MT_radian)      { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value);      } }
+        inline void assignValue(const orxonox::Degree& value)      { if (this->value_ && this->value_->type_ == MT_degree)      { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value);      } }
+
+        template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
+        template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); }
+
+        MT_ValueBase* value_;
 };
 
+_UtilExport inline std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
+
+template <> inline bool MultiType::isType<char>()                 const { return (this->value_ && this->value_->type_ == MT_char);        }
+template <> inline bool MultiType::isType<unsigned char>()        const { return (this->value_ && this->value_->type_ == MT_uchar);       }
+template <> inline bool MultiType::isType<short>()                const { return (this->value_ && this->value_->type_ == MT_short);       }
+template <> inline bool MultiType::isType<unsigned short>()       const { return (this->value_ && this->value_->type_ == MT_ushort);      }
+template <> inline bool MultiType::isType<int>()                  const { return (this->value_ && this->value_->type_ == MT_int);         }
+template <> inline bool MultiType::isType<unsigned int>()         const { return (this->value_ && this->value_->type_ == MT_uint);        }
+template <> inline bool MultiType::isType<long>()                 const { return (this->value_ && this->value_->type_ == MT_long);        }
+template <> inline bool MultiType::isType<unsigned long>()        const { return (this->value_ && this->value_->type_ == MT_ulong);       }
+template <> inline bool MultiType::isType<long long>()            const { return (this->value_ && this->value_->type_ == MT_longlong);    }
+template <> inline bool MultiType::isType<unsigned long long>()   const { return (this->value_ && this->value_->type_ == MT_ulonglong);   }
+template <> inline bool MultiType::isType<float>()                const { return (this->value_ && this->value_->type_ == MT_float);       }
+template <> inline bool MultiType::isType<double>()               const { return (this->value_ && this->value_->type_ == MT_double);      }
+template <> inline bool MultiType::isType<long double>()          const { return (this->value_ && this->value_->type_ == MT_longdouble);  }
+template <> inline bool MultiType::isType<bool>()                 const { return (this->value_ && this->value_->type_ == MT_bool);        }
+template <> inline bool MultiType::isType<void*>()                const { return (this->value_ && this->value_->type_ == MT_void);        }
+template <> inline bool MultiType::isType<std::string>()          const { return (this->value_ && this->value_->type_ == MT_string);      }
+template <> inline bool MultiType::isType<orxonox::Vector2>()     const { return (this->value_ && this->value_->type_ == MT_vector2);     }
+template <> inline bool MultiType::isType<orxonox::Vector3>()     const { return (this->value_ && this->value_->type_ == MT_vector3);     }
+template <> inline bool MultiType::isType<orxonox::Vector4>()     const { return (this->value_ && this->value_->type_ == MT_vector4);     }
+template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_colourvalue); }
+template <> inline bool MultiType::isType<orxonox::Quaternion>()  const { return (this->value_ && this->value_->type_ == MT_quaternion);  }
+template <> inline bool MultiType::isType<orxonox::Radian>()      const { return (this->value_ && this->value_->type_ == MT_radian);      }
+template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_degree);      }
+
+template <> inline void MultiType::convert<std::string>()          { this->setValue<std::string>         (this->operator std::string());          }
+template <> inline void MultiType::convert<orxonox::Vector2>()     { this->setValue<orxonox::Vector2>    (this->operator orxonox::Vector2());     }
+template <> inline void MultiType::convert<orxonox::Vector3>()     { this->setValue<orxonox::Vector3>    (this->operator orxonox::Vector3());     }
+template <> inline void MultiType::convert<orxonox::Vector4>()     { this->setValue<orxonox::Vector4>    (this->operator orxonox::Vector4());     }
+template <> inline void MultiType::convert<orxonox::ColourValue>() { this->setValue<orxonox::ColourValue>(this->operator orxonox::ColourValue()); }
+template <> inline void MultiType::convert<orxonox::Quaternion>()  { this->setValue<orxonox::Quaternion> (this->operator orxonox::Quaternion());  }
+template <> inline void MultiType::convert<orxonox::Radian>()      { this->setValue<orxonox::Radian>     (this->operator orxonox::Radian());      }
+template <> inline void MultiType::convert<orxonox::Degree>()      { this->setValue<orxonox::Degree>     (this->operator orxonox::Degree());      }
+
+template <> inline void MultiType::convert<const std::string&>()          { this->convert<std::string>();          }
+template <> inline void MultiType::convert<const orxonox::Vector2&>()     { this->convert<orxonox::Vector2>();     }
+template <> inline void MultiType::convert<const orxonox::Vector3&>()     { this->convert<orxonox::Vector3>();     }
+template <> inline void MultiType::convert<const orxonox::Vector4&>()     { this->convert<orxonox::Vector4>();     }
+template <> inline void MultiType::convert<const orxonox::ColourValue&>() { this->convert<orxonox::ColourValue>(); }
+template <> inline void MultiType::convert<const orxonox::Quaternion&>()  { this->convert<orxonox::Quaternion>();  }
+template <> inline void MultiType::convert<const orxonox::Radian&>()      { this->convert<orxonox::Radian>();      }
+template <> inline void MultiType::convert<const orxonox::Degree&>()      { this->convert<orxonox::Degree>();      }
+
+template <> void MultiType::createNewValueContainer(const char& value);
+template <> void MultiType::createNewValueContainer(const unsigned char& value);
+template <> void MultiType::createNewValueContainer(const short& value);
+template <> void MultiType::createNewValueContainer(const unsigned short& value);
+template <> void MultiType::createNewValueContainer(const int& value);
+template <> void MultiType::createNewValueContainer(const unsigned int& value);
+template <> void MultiType::createNewValueContainer(const long& value);
+template <> void MultiType::createNewValueContainer(const unsigned long& value);
+template <> void MultiType::createNewValueContainer(const long long& value);
+template <> void MultiType::createNewValueContainer(const unsigned long long& value);
+template <> void MultiType::createNewValueContainer(const float& value);
+template <> void MultiType::createNewValueContainer(const double& value);
+template <> void MultiType::createNewValueContainer(const bool& value);
+template <> void MultiType::createNewValueContainer(const long double& value);
+template <> void MultiType::createNewValueContainer(      void* const& value);
+template <> void MultiType::createNewValueContainer(const std::string& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value);
+template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Radian& value);
+template <> void MultiType::createNewValueContainer(const orxonox::Degree& value);
+
+inline void MultiType::setValue(const char& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const unsigned char& value)         { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const short& value)                 { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const unsigned short& value)        { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const int& value)                   { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const unsigned int& value)          { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const long& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const unsigned long& value)         { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const long long& value)             { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const unsigned long long& value)    { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const float& value)                 { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const double& value)                { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const long double& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const bool& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(      void* const& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const std::string& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Vector2& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Vector3& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Vector4& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::ColourValue& value)  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Quaternion& value)   { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Radian& value)       { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+inline void MultiType::setValue(const orxonox::Degree& value)       { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
+
+inline void MultiType::setValue(const char* value)                  { if (this->value_) { this->value_->setValue(std::string(value)); } else { this->assignValue(std::string(value)); } }
+
 #endif /* _MultiType_H__ */
Index: code/trunk/src/util/MultiTypeMath.cc
===================================================================
--- code/trunk/src/util/MultiTypeMath.cc	(revision 1735)
+++ 	(revision )
@@ -1,302 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#include "MultiTypeMath.h"
-#include "Convert.h"
-
-MultiTypeMath::MultiTypeMath(MultiType type) : MultiTypeString(type)
-{
-    if (type == MT_vector2)
-        this->vector2_ = orxonox::Vector2(0, 0);
-    else if (type == MT_vector3)
-        this->vector3_ = orxonox::Vector3(0, 0, 0);
-    else if (type == MT_vector4)
-        this->vector4_ = orxonox::Vector4(0, 0, 0, 0);
-    else if (type == MT_colourvalue)
-        this->colourvalue_ = orxonox::ColourValue(0, 0, 0, 0);
-    else if (type == MT_quaternion)
-        this->quaternion_ = orxonox::Quaternion(1, 0, 0, 0);
-    else if (type == MT_radian)
-        this->radian_ = orxonox::Radian(0);
-    else if (type == MT_degree)
-        this->degree_ = orxonox::Degree(0);
-}
-
-bool MultiTypeMath::operator==(const MultiTypeMath& mtm) const
-{
-    if (!MultiTypeString::operator==(mtm) && this->type_ == mtm.type_)
-    {
-        if (this->type_ == MT_vector2)
-            return (this->vector2_ == mtm.vector2_);
-        else if (this->type_ == MT_vector3)
-            return (this->vector3_ == mtm.vector3_);
-        else if (this->type_ == MT_vector4)
-            return (this->vector4_ == mtm.vector4_);
-        else if (this->type_ == MT_colourvalue)
-            return (this->colourvalue_ == mtm.colourvalue_);
-        else if (this->type_ == MT_quaternion)
-            return (this->quaternion_ == mtm.quaternion_);
-        else if (this->type_ == MT_radian)
-            return (this->radian_ == mtm.radian_);
-        else if (this->type_ == MT_degree)
-            return (this->degree_ == mtm.degree_);
-    }
-
-    return false;
-}
-
-bool MultiTypeMath::operator==(const MultiTypeString& mts) const
-{
-    return MultiTypeString::operator==(mts);
-}
-
-bool MultiTypeMath::operator==(const MultiTypePrimitive& mtp) const
-{
-    return MultiTypePrimitive::operator==(mtp);
-}
-
-bool MultiTypeMath::operator!=(const MultiTypeMath& mtm) const
-{
-    if (MultiTypeString::operator==(mtm) && this->type_ == mtm.type_)
-    {
-        if (this->type_ == MT_vector2)
-            return (this->vector2_ != mtm.vector2_);
-        else if (this->type_ == MT_vector3)
-            return (this->vector3_ != mtm.vector3_);
-        else if (this->type_ == MT_vector4)
-            return (this->vector4_ != mtm.vector4_);
-        else if (this->type_ == MT_colourvalue)
-            return (this->colourvalue_ != mtm.colourvalue_);
-        else if (this->type_ == MT_quaternion)
-            return (this->quaternion_ != mtm.quaternion_);
-        else if (this->type_ == MT_radian)
-            return (this->radian_ != mtm.radian_);
-        else if (this->type_ == MT_degree)
-            return (this->degree_ != mtm.degree_);
-    }
-
-    return true;
-}
-
-bool MultiTypeMath::operator!=(const MultiTypeString& mts) const
-{
-    return MultiTypeString::operator!=(mts);
-}
-
-bool MultiTypeMath::operator!=(const MultiTypePrimitive& mtp) const
-{
-    return MultiTypePrimitive::operator!=(mtp);
-}
-
-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_ : getConvertedValue<MultiTypeMath, int>(*this, 0); }
-MultiTypeMath::operator unsigned int() const
-{ 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_ : getConvertedValue<MultiTypeMath, char>(*this, 0); }
-MultiTypeMath::operator unsigned char() const
-{ 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_ : getConvertedValue<MultiTypeMath, short>(*this, 0); }
-MultiTypeMath::operator unsigned short() const
-{ 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_ : getConvertedValue<MultiTypeMath, long>(*this, 0); }
-MultiTypeMath::operator unsigned long() const
-{ 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_ : getConvertedValue<MultiTypeMath, float>(*this, 0); }
-MultiTypeMath::operator double() const
-{ 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_ : getConvertedValue<MultiTypeMath, long double>(*this, 0); }
-MultiTypeMath::operator bool() const
-{ 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_ : getConvertedValue<MultiTypeMath, std::string>(*this); }
-MultiTypeMath::operator const char*() const
-{ 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_ : getConvertedValue<MultiTypeMath, orxonox::Vector2>(*this); }
-MultiTypeMath::operator orxonox::Vector3() const
-{ return (this->type_ == MT_vector3) ? this->vector3_ : getConvertedValue<MultiTypeMath, orxonox::Vector3>(*this); }
-MultiTypeMath::operator orxonox::Vector4() const
-{ return (this->type_ == MT_vector4) ? this->vector4_ : getConvertedValue<MultiTypeMath, orxonox::Vector4>(*this); }
-MultiTypeMath::operator orxonox::Quaternion() const
-{ return (this->type_ == MT_quaternion) ? this->quaternion_ : getConvertedValue<MultiTypeMath, orxonox::Quaternion>(*this); }
-MultiTypeMath::operator orxonox::ColourValue() const
-{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : getConvertedValue<MultiTypeMath, orxonox::ColourValue>(*this); }
-MultiTypeMath::operator orxonox::Radian() const
-{ return (this->type_ == MT_radian) ? this->radian_ : getConvertedValue<MultiTypeMath, orxonox::Radian>(*this); }
-MultiTypeMath::operator orxonox::Degree() const
-{ return (this->type_ == MT_degree) ? this->degree_ : getConvertedValue<MultiTypeMath, orxonox::Degree>(*this); }
-
-void MultiTypeMath::setValue(const MultiTypeMath& mtm)
-{
-    MultiTypeString::setValue(mtm);
-    this->vector2_ = mtm.vector2_;
-    this->vector3_ = mtm.vector3_;
-    this->vector4_ = mtm.vector4_;
-    this->quaternion_ = mtm.quaternion_;
-    this->colourvalue_ = mtm.colourvalue_;
-    this->radian_ = mtm.radian_;
-    this->degree_ = mtm.degree_;
-}
-
-void MultiTypeMath::setValue(const MultiTypeString& mts)
-{
-    MultiTypeString::setValue(mts);
-}
-
-void MultiTypeMath::setValue(const MultiTypePrimitive& mtp)
-{
-    MultiTypePrimitive::setValue(mtp);
-}
-
-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_vector4)
-        return "Vector4";
-    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();
-}
-
-std::string MultiTypeMath::toString() const
-{
-    std::string output;
-
-    if (this->type_ == MT_vector2)
-        ConvertValue(&output, this->vector2_);
-    else if (this->type_ == MT_vector3)
-        ConvertValue(&output, this->vector3_);
-    else if (this->type_ == MT_vector4)
-        ConvertValue(&output, this->vector4_);
-    else if (this->type_ == MT_colourvalue)
-        ConvertValue(&output, this->colourvalue_);
-    else if (this->type_ == MT_quaternion)
-        ConvertValue(&output, this->quaternion_);
-    else if (this->type_ == MT_radian)
-        ConvertValue(&output, this->radian_);
-    else if (this->type_ == MT_degree)
-        ConvertValue(&output, this->degree_);
-    else
-        return MultiTypeString::toString();
-
-    return output;
-}
-
-bool MultiTypeMath::fromString(const std::string value)
-{
-    if (this->type_ == MT_vector2)
-        return ConvertValue(&this->vector2_, value, orxonox::Vector2(0, 0));
-    else if (this->type_ == MT_vector3)
-        return ConvertValue(&this->vector3_, value, orxonox::Vector3(0, 0, 0));
-    else if (this->type_ == MT_vector4)
-        return ConvertValue(&this->vector4_, value, orxonox::Vector4(0, 0, 0, 0));
-    else if (this->type_ == MT_colourvalue)
-        return ConvertValue(&this->colourvalue_, value, orxonox::ColourValue(0, 0, 0, 0));
-    else if (this->type_ == MT_quaternion)
-        return ConvertValue(&this->quaternion_, value, orxonox::Quaternion(1, 0, 0, 0));
-    else if (this->type_ == MT_radian)
-        return ConvertValue(&this->radian_, value, orxonox::Radian(0));
-    else if (this->type_ == MT_degree)
-        return ConvertValue(&this->degree_, value, orxonox::Degree(0));
-    else
-        return MultiTypeString::fromString(value);
-}
-
-bool MultiTypeMath::assimilate(const MultiTypeMath& mtm, const MultiTypeMath& defvalue)
-{
-    if (this->type_ == MT_void)
-        return ConvertValue(&this->value_.void_, mtm, defvalue.value_.void_);
-    else if (this->type_ == MT_int)
-        return ConvertValue(&this->value_.int_, mtm, defvalue.value_.int_);
-    else if (this->type_ == MT_uint)
-        return ConvertValue(&this->value_.uint_, mtm, defvalue.value_.uint_);
-    else if (this->type_ == MT_char)
-        return ConvertValue(&this->value_.char_, mtm, defvalue.value_.char_);
-    else if (this->type_ == MT_uchar)
-        return ConvertValue(&this->value_.uchar_, mtm, defvalue.value_.uchar_);
-    else if (this->type_ == MT_short)
-        return ConvertValue(&this->value_.short_, mtm, defvalue.value_.short_);
-    else if (this->type_ == MT_ushort)
-        return ConvertValue(&this->value_.ushort_, mtm, defvalue.value_.ushort_);
-    else if (this->type_ == MT_long)
-        return ConvertValue(&this->value_.long_, mtm, defvalue.value_.long_);
-    else if (this->type_ == MT_ulong)
-        return ConvertValue(&this->value_.ulong_, mtm, defvalue.value_.ulong_);
-    else if (this->type_ == MT_float)
-        return ConvertValue(&this->value_.float_, mtm, defvalue.value_.float_);
-    else if (this->type_ == MT_double)
-        return ConvertValue(&this->value_.double_, mtm, defvalue.value_.double_);
-    else if (this->type_ == MT_longdouble)
-        return ConvertValue(&this->value_.longdouble_, mtm, defvalue.value_.longdouble_);
-    else if (this->type_ == MT_bool)
-        return ConvertValue(&this->value_.bool_, mtm, defvalue.value_.bool_);
-    else if (this->type_ == MT_constchar)
-        return ConvertValue(&this->string_, mtm, defvalue.string_);
-    else if (this->type_ == MT_string)
-        return ConvertValue(&this->string_, mtm, defvalue.string_);
-    else if (this->type_ == MT_vector2)
-        return ConvertValue(&this->vector2_, mtm, defvalue.vector2_);
-    else if (this->type_ == MT_vector3)
-        return ConvertValue(&this->vector3_, mtm, defvalue.vector3_);
-    else if (this->type_ == MT_vector4)
-        return ConvertValue(&this->vector4_, mtm, defvalue.vector4_);
-    else if (this->type_ == MT_colourvalue)
-        return ConvertValue(&this->colourvalue_, mtm, defvalue.colourvalue_);
-    else if (this->type_ == MT_quaternion)
-        return ConvertValue(&this->quaternion_, mtm, defvalue.quaternion_);
-    else if (this->type_ == MT_radian)
-        return ConvertValue(&this->radian_, mtm, defvalue.radian_);
-    else if (this->type_ == MT_degree)
-        return ConvertValue(&this->degree_, mtm, defvalue.degree_);
-    else
-        return false;
-}
-
-std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm)
-{
-    out << mtm.toString();
-    return out;
-}
Index: code/trunk/src/util/MultiTypeMath.h
===================================================================
--- code/trunk/src/util/MultiTypeMath.h	(revision 1735)
+++ 	(revision )
@@ -1,194 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#ifndef _MultiTypeMath_H__
-#define _MultiTypeMath_H__
-
-#include "UtilPrereqs.h"
-
-#include "MultiTypeString.h"
-#include "Math.h"
-
-// disable annoying warning about multiple assignment operators
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
-#pragma warning(push)
-#pragma warning(disable:4522)
-#endif
-
-class _UtilExport MultiTypeMath : public MultiTypeString
-{
-    public:
-        MultiTypeMath(MultiType type = MT_null);
-        inline MultiTypeMath(void*          value) : MultiTypeString(value) {}
-        inline MultiTypeMath(int            value) : MultiTypeString(value) {}
-        inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
-        inline MultiTypeMath(char           value) : MultiTypeString(value) {}
-        inline MultiTypeMath(unsigned char  value) : MultiTypeString(value) {}
-        inline MultiTypeMath(short          value) : MultiTypeString(value) {}
-        inline MultiTypeMath(unsigned short value) : MultiTypeString(value) {}
-        inline MultiTypeMath(long           value) : MultiTypeString(value) {}
-        inline MultiTypeMath(unsigned long  value) : MultiTypeString(value) {}
-        inline MultiTypeMath(float          value) : MultiTypeString(value) {}
-        inline MultiTypeMath(double         value) : MultiTypeString(value) {}
-        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 orxonox::Vector2&     value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::Vector4&     value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::Quaternion&  value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::Radian&      value) { this->setValue(value); }
-        inline MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }
-        inline MultiTypeMath(const MultiTypeMath& mtm)          { this->setValue(mtm);   }
-        inline MultiTypeMath(const MultiTypeString& mts)        { this->setValue(mts);   }
-        inline MultiTypeMath(const MultiTypePrimitive& mtp)     { this->setValue(mtp);   }
-        virtual inline ~MultiTypeMath() {}
-
-        using MultiTypeString::operator=;
-        inline MultiTypeMath& operator=(const orxonox::Vector2&     value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::Vector3&     value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::Vector4&     value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::Quaternion&  value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::Radian&      value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const orxonox::Degree&      value) { this->setValue(value); return *this; }
-        inline MultiTypeMath& operator=(const MultiTypeMath& mtm)          { this->setValue(mtm);   return *this; }
-        inline MultiTypeMath& operator=(const MultiTypeString& mts)        { this->setValue(mts);   return *this; }
-        inline MultiTypeMath& operator=(const MultiTypePrimitive mtp)      { this->setValue(mtp);   return *this; }
-
-        using MultiTypeString::operator==;
-        inline bool operator==(const orxonox::Vector2&     value) const { return (this->vector2_     == value); }
-        inline bool operator==(const orxonox::Vector3&     value) const { return (this->vector3_     == value); }
-        inline bool operator==(const orxonox::Vector4&     value) const { return (this->vector4_     == value); }
-        inline bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); }
-        inline bool operator==(const orxonox::Quaternion&  value) const { return (this->quaternion_  == value); }
-        inline bool operator==(const orxonox::Radian&      value) const { return (this->radian_      == value); }
-        inline bool operator==(const orxonox::Degree&      value) const { return (this->degree_      == value); }
-        bool operator==(const MultiTypeMath& mtm) const;
-        bool operator==(const MultiTypeString& mts) const;
-        bool operator==(const MultiTypePrimitive& mtp) const;
-
-        using MultiTypeString::operator!=;
-        inline bool operator!=(const orxonox::Vector2&     value) const { return (this->vector2_     != value); }
-        inline bool operator!=(const orxonox::Vector3&     value) const { return (this->vector3_     != value); }
-        inline bool operator!=(const orxonox::Vector4&     value) const { return (this->vector4_     != value); }
-        inline bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); }
-        inline bool operator!=(const orxonox::Quaternion&  value) const { return (this->quaternion_  != value); }
-        inline bool operator!=(const orxonox::Radian&      value) const { return (this->radian_      != value); }
-        inline bool operator!=(const orxonox::Degree&      value) const { return (this->degree_      != value); }
-        bool operator!=(const MultiTypeMath& mtm) const;
-        bool operator!=(const MultiTypeString& mts) const;
-        bool operator!=(const MultiTypePrimitive& mtp) 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;
-        virtual operator orxonox::Vector2()     const;
-        virtual operator orxonox::Vector3()     const;
-        virtual operator orxonox::Vector4()     const;
-        virtual operator orxonox::ColourValue() const;
-        virtual operator orxonox::Quaternion()  const;
-        virtual operator orxonox::Radian()      const;
-        virtual operator orxonox::Degree()      const;
-
-        using MultiTypeString::setValue;
-        inline void setValue(const orxonox::Vector2&     value) { this->type_ = MT_vector2;     this->vector2_     = value; }
-        inline void setValue(const orxonox::Vector3&     value) { this->type_ = MT_vector3;     this->vector3_     = value; }
-        inline void setValue(const orxonox::Vector4&     value) { this->type_ = MT_vector4;     this->vector4_     = value; }
-        inline void setValue(const orxonox::ColourValue& value) { this->type_ = MT_colourvalue; this->colourvalue_ = value; }
-        inline void setValue(const orxonox::Quaternion&  value) { this->type_ = MT_quaternion;  this->quaternion_  = value; }
-        inline void setValue(const orxonox::Radian&      value) { this->type_ = MT_radian;      this->radian_      = value; }
-        inline void setValue(const orxonox::Degree&      value) { this->type_ = MT_degree;      this->degree_      = value; }
-        void setValue(const MultiTypeMath& mtm);
-        void setValue(const MultiTypeString& mts);
-        void setValue(const MultiTypePrimitive& mtp);
-
-        inline orxonox::Vector2     getVector2()     const { return this->vector2_;     }
-        inline orxonox::Vector3     getVector3()     const { return this->vector3_;     }
-        inline orxonox::Vector4     getVector4()     const { return this->vector4_;     }
-        inline orxonox::ColourValue getColourValue() const { return this->colourvalue_; }
-        inline orxonox::Quaternion  getQuaternion()  const { return this->quaternion_;  }
-        inline orxonox::Radian      getRadian()      const { return this->radian_;      }
-        inline orxonox::Degree      getDegree()      const { return this->degree_;      }
-
-        inline orxonox::Vector2&     getVector2()     { return this->vector2_;     }
-        inline orxonox::Vector3&     getVector3()     { return this->vector3_;     }
-        inline orxonox::Vector4&     getVector4()     { return this->vector4_;     }
-        inline orxonox::ColourValue& getColourValue() { return this->colourvalue_; }
-        inline orxonox::Quaternion&  getQuaternion()  { return this->quaternion_;  }
-        inline orxonox::Radian&      getRadian()      { return this->radian_;      }
-        inline orxonox::Degree&      getDegree()      { return this->degree_;      }
-
-        using MultiTypeString::getValue;
-        inline void getValue(orxonox::Vector2*     variable) const { (*variable) = orxonox::Vector2     (this->vector2_);     }
-        inline void getValue(orxonox::Vector3*     variable) const { (*variable) = orxonox::Vector3     (this->vector3_);     }
-        inline void getValue(orxonox::Vector4*     variable) const { (*variable) = orxonox::Vector4     (this->vector4_);     }
-        inline void getValue(orxonox::ColourValue* variable) const { (*variable) = orxonox::ColourValue (this->colourvalue_); }
-        inline void getValue(orxonox::Quaternion*  variable) const { (*variable) = orxonox::Quaternion  (this->quaternion_);  }
-        inline void getValue(orxonox::Radian*      variable) const { (*variable) = orxonox::Radian      (this->radian_);      }
-        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);
-
-        virtual bool assimilate(const MultiTypeMath& mtm, const MultiTypeMath& defvalue = MultiTypeMath());
-
-    protected:
-        orxonox::Vector2      vector2_;
-        orxonox::Vector3      vector3_;
-        orxonox::Vector4      vector4_;
-        orxonox::ColourValue  colourvalue_;
-        orxonox::Quaternion   quaternion_;
-        orxonox::Radian       radian_;
-        orxonox::Degree       degree_;
-};
-
-_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm);
-
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
-#pragma warning(pop)
-#endif
-
-#endif /* _MultiTypeMath_H__ */
Index: code/trunk/src/util/MultiTypePrimitive.cc
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.cc	(revision 1735)
+++ 	(revision )
@@ -1,305 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#include "MultiTypePrimitive.h"
-#include "Convert.h"
-
-MultiTypePrimitive::MultiTypePrimitive(MultiType type)
-{
-    this->type_ = type;
-
-    if (type == MT_void)
-        this->value_.void_ = 0;
-    else if (type == MT_int)
-        this->value_.int_ = 0;
-    else if (type == MT_uint)
-        this->value_.uint_ = 0;
-    else if (type == MT_char)
-        this->value_.char_ = 0;
-    else if (type == MT_uchar)
-        this->value_.uchar_ = 0;
-    else if (type == MT_short)
-        this->value_.short_ = 0;
-    else if (type == MT_ushort)
-        this->value_.ushort_ = 0;
-    else if (type == MT_long)
-        this->value_.long_ = 0;
-    else if (type == MT_ulong)
-        this->value_.ulong_ = 0;
-    else if (type == MT_float)
-        this->value_.float_ = 0.0;
-    else if (type == MT_double)
-        this->value_.double_ = 0.0;
-    else if (type == MT_longdouble)
-        this->value_.longdouble_ = 0.0;
-    else if (type == MT_bool)
-        this->value_.bool_ = false;
-    else
-        this->value_.void_ = 0;
-}
-
-bool MultiTypePrimitive::operator==(const MultiTypePrimitive& mtp) const
-{
-    if (this->type_ == mtp.type_)
-    {
-        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)
-            return (this->value_.uint_ == mtp.value_.uint_);
-        else if (this->type_ == MT_char)
-            return (this->value_.char_ == mtp.value_.char_);
-        else if (this->type_ == MT_uchar)
-            return (this->value_.uchar_ == mtp.value_.uchar_);
-        else if (this->type_ == MT_short)
-            return (this->value_.short_ == mtp.value_.short_);
-        else if (this->type_ == MT_ushort)
-            return (this->value_.ushort_ == mtp.value_.ushort_);
-        else if (this->type_ == MT_long)
-            return (this->value_.long_ == mtp.value_.long_);
-        else if (this->type_ == MT_ulong)
-            return (this->value_.ulong_ == mtp.value_.ulong_);
-        else if (this->type_ == MT_float)
-            return (this->value_.float_ == mtp.value_.float_);
-        else if (this->type_ == MT_double)
-            return (this->value_.double_ == mtp.value_.double_);
-        else if (this->type_ == MT_longdouble)
-            return (this->value_.longdouble_ == mtp.value_.longdouble_);
-        else if (this->type_ == MT_bool)
-            return (this->value_.bool_ == mtp.value_.bool_);
-    }
-
-    return false;
-}
-
-bool MultiTypePrimitive::operator!=(const MultiTypePrimitive& mtp) const
-{
-    if (this->type_ == mtp.type_)
-    {
-        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)
-            return (this->value_.uint_ != mtp.value_.uint_);
-        else if (this->type_ == MT_char)
-            return (this->value_.char_ != mtp.value_.char_);
-        else if (this->type_ == MT_uchar)
-            return (this->value_.uchar_ != mtp.value_.uchar_);
-        else if (this->type_ == MT_short)
-            return (this->value_.short_ != mtp.value_.short_);
-        else if (this->type_ == MT_ushort)
-            return (this->value_.ushort_ != mtp.value_.ushort_);
-        else if (this->type_ == MT_long)
-            return (this->value_.long_ != mtp.value_.long_);
-        else if (this->type_ == MT_ulong)
-            return (this->value_.ulong_ != mtp.value_.ulong_);
-        else if (this->type_ == MT_float)
-            return (this->value_.float_ != mtp.value_.float_);
-        else if (this->type_ == MT_double)
-            return (this->value_.double_ != mtp.value_.double_);
-        else if (this->type_ == MT_longdouble)
-            return (this->value_.longdouble_ != mtp.value_.longdouble_);
-        else if (this->type_ == MT_bool)
-            return (this->value_.bool_ != mtp.value_.bool_);
-    }
-
-    return true;
-}
-
-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_ : getConvertedValue<MultiTypePrimitive, int>(*this, 0); }
-MultiTypePrimitive::operator unsigned int() const
-{ 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_ : getConvertedValue<MultiTypePrimitive, char>(*this, 0); }
-MultiTypePrimitive::operator unsigned char() const
-{ 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_ : getConvertedValue<MultiTypePrimitive, short>(*this, 0); }
-MultiTypePrimitive::operator unsigned short() const
-{ 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_ : getConvertedValue<MultiTypePrimitive, long>(*this, 0); }
-MultiTypePrimitive::operator unsigned long() const
-{ 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_ : getConvertedValue<MultiTypePrimitive, float>(*this, 0); }
-MultiTypePrimitive::operator double() const
-{ 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_ : getConvertedValue<MultiTypePrimitive, long double>(*this, 0); }
-MultiTypePrimitive::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypePrimitive, bool>(*this, 0); }
-
-void MultiTypePrimitive::setValue(const MultiTypePrimitive& mtp)
-{
-    this->type_ = mtp.type_;
-    this->value_ = mtp.value_;
-}
-
-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_void)
-        ConvertValue(&output, this->value_.void_);
-    else if (this->type_ == MT_int)
-        ConvertValue(&output, this->value_.int_);
-    else if (this->type_ == MT_uint)
-        ConvertValue(&output, this->value_.uint_);
-    else if (this->type_ == MT_char)
-        ConvertValue(&output, this->value_.char_);
-    else if (this->type_ == MT_uchar)
-        ConvertValue(&output, this->value_.uchar_);
-    else if (this->type_ == MT_short)
-        ConvertValue(&output, this->value_.short_);
-    else if (this->type_ == MT_ushort)
-        ConvertValue(&output, this->value_.ushort_);
-    else if (this->type_ == MT_long)
-        ConvertValue(&output, this->value_.long_);
-    else if (this->type_ == MT_ulong)
-        ConvertValue(&output, this->value_.ulong_);
-    else if (this->type_ == MT_float)
-        ConvertValue(&output, this->value_.float_);
-    else if (this->type_ == MT_double)
-        ConvertValue(&output, this->value_.double_);
-    else if (this->type_ == MT_longdouble)
-        ConvertValue(&output, this->value_.longdouble_);
-    else if (this->type_ == MT_bool)
-        ConvertValue(&output, this->value_.bool_);
-
-    return output;
-}
-
-bool MultiTypePrimitive::fromString(const std::string value)
-{
-    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)
-        return ConvertValue(&this->value_.uint_, value, (unsigned int)0);
-    else if (this->type_ == MT_char)
-        return ConvertValue(&this->value_.char_, value, (char)0);
-    else if (this->type_ == MT_uchar)
-        return ConvertValue(&this->value_.uchar_, value, (unsigned char)0);
-    else if (this->type_ == MT_short)
-        return ConvertValue(&this->value_.short_, value, (short)0);
-    else if (this->type_ == MT_ushort)
-        return ConvertValue(&this->value_.ushort_, value, (unsigned short)0);
-    else if (this->type_ == MT_long)
-        return ConvertValue(&this->value_.long_, value, (long)0);
-    else if (this->type_ == MT_ulong)
-        return ConvertValue(&this->value_.ulong_, value, (unsigned long)0);
-    else if (this->type_ == MT_float)
-        return ConvertValue(&this->value_.float_, value, (float)0.0);
-    else if (this->type_ == MT_double)
-        return ConvertValue(&this->value_.double_, value, (double)0.0);
-    else if (this->type_ == MT_longdouble)
-        return ConvertValue(&this->value_.longdouble_, value, (long double)0.0);
-    else if (this->type_ == MT_bool)
-        return ConvertValue(&this->value_.bool_, value, false);
-    else
-        return false;
-}
-
-bool MultiTypePrimitive::assimilate(const MultiTypePrimitive& mtp, const MultiTypePrimitive& defvalue)
-{
-    if (this->type_ == MT_void)
-        return ConvertValue(&this->value_.void_, mtp, defvalue.value_.void_);
-    else if (this->type_ == MT_int)
-        return ConvertValue(&this->value_.int_, mtp, defvalue.value_.int_);
-    else if (this->type_ == MT_uint)
-        return ConvertValue(&this->value_.uint_, mtp, defvalue.value_.uint_);
-    else if (this->type_ == MT_char)
-        return ConvertValue(&this->value_.char_, mtp, defvalue.value_.char_);
-    else if (this->type_ == MT_uchar)
-        return ConvertValue(&this->value_.uchar_, mtp, defvalue.value_.uchar_);
-    else if (this->type_ == MT_short)
-        return ConvertValue(&this->value_.short_, mtp, defvalue.value_.short_);
-    else if (this->type_ == MT_ushort)
-        return ConvertValue(&this->value_.ushort_, mtp, defvalue.value_.ushort_);
-    else if (this->type_ == MT_long)
-        return ConvertValue(&this->value_.long_, mtp, defvalue.value_.long_);
-    else if (this->type_ == MT_ulong)
-        return ConvertValue(&this->value_.ulong_, mtp, defvalue.value_.ulong_);
-    else if (this->type_ == MT_float)
-        return ConvertValue(&this->value_.float_, mtp, defvalue.value_.float_);
-    else if (this->type_ == MT_double)
-        return ConvertValue(&this->value_.double_, mtp, defvalue.value_.double_);
-    else if (this->type_ == MT_longdouble)
-        return ConvertValue(&this->value_.longdouble_, mtp, defvalue.value_.longdouble_);
-    else if (this->type_ == MT_bool)
-        return ConvertValue(&this->value_.bool_, mtp, defvalue.value_.bool_);
-    else
-        return false;
-
-}
-
-std::ostream& operator<<(std::ostream& out, const MultiTypePrimitive& mtp)
-{
-    out << mtp.toString();
-    return out;
-}
Index: code/trunk/src/util/MultiTypePrimitive.h
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.h	(revision 1735)
+++ 	(revision )
@@ -1,198 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#ifndef _MultiTypePrimitive_H__
-#define _MultiTypePrimitive_H__
-
-#include "UtilPrereqs.h"
-
-#include <ostream>
-
-#include "MultiType.h"
-
-namespace orxonox
-{
-    class BaseObject;
-}
-class _UtilExport MultiTypePrimitive
-{
-    public:
-        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); }
-        inline MultiTypePrimitive(char           value) { this->setValue(value); }
-        inline MultiTypePrimitive(unsigned char  value) { this->setValue(value); }
-        inline MultiTypePrimitive(short          value) { this->setValue(value); }
-        inline MultiTypePrimitive(unsigned short value) { this->setValue(value); }
-        inline MultiTypePrimitive(long           value) { this->setValue(value); }
-        inline MultiTypePrimitive(unsigned long  value) { this->setValue(value); }
-        inline MultiTypePrimitive(float          value) { this->setValue(value); }
-        inline MultiTypePrimitive(double         value) { this->setValue(value); }
-        inline MultiTypePrimitive(long double    value) { this->setValue(value); }
-        inline MultiTypePrimitive(bool           value) { this->setValue(value); }
-        inline MultiTypePrimitive(const MultiTypePrimitive& mtp) { this->setValue(mtp); }
-        virtual inline ~MultiTypePrimitive() {}
-
-        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; }
-        inline MultiTypePrimitive& operator=(char           value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(unsigned char  value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(short          value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(unsigned short value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(long           value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(unsigned long  value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(float          value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(double         value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(long double    value) { this->setValue(value); return *this; }
-        inline MultiTypePrimitive& operator=(bool           value) { this->setValue(value); return *this; }
-        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); }
-        inline bool operator==(char           value) const { return (this->value_.char_       == value); }
-        inline bool operator==(unsigned char  value) const { return (this->value_.uchar_      == value); }
-        inline bool operator==(short          value) const { return (this->value_.short_      == value); }
-        inline bool operator==(unsigned short value) const { return (this->value_.ushort_     == value); }
-        inline bool operator==(long           value) const { return (this->value_.long_       == value); }
-        inline bool operator==(unsigned long  value) const { return (this->value_.ulong_      == value); }
-        inline bool operator==(float          value) const { return (this->value_.float_      == value); }
-        inline bool operator==(double         value) const { return (this->value_.double_     == value); }
-        inline bool operator==(long double    value) const { return (this->value_.longdouble_ == value); }
-        inline bool operator==(bool           value) const { return (this->value_.bool_       == value); }
-        bool operator==(const MultiTypePrimitive& mtp) const;
-
-        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); }
-        inline bool operator!=(unsigned char  value) const { return (this->value_.uchar_      != value); }
-        inline bool operator!=(short          value) const { return (this->value_.short_      != value); }
-        inline bool operator!=(unsigned short value) const { return (this->value_.ushort_     != value); }
-        inline bool operator!=(long           value) const { return (this->value_.long_       != value); }
-        inline bool operator!=(unsigned long  value) const { return (this->value_.ulong_      != value); }
-        inline bool operator!=(float          value) const { return (this->value_.float_      != value); }
-        inline bool operator!=(double         value) const { return (this->value_.double_     != value); }
-        inline bool operator!=(long double    value) const { return (this->value_.longdouble_ != value); }
-        inline bool operator!=(bool           value) const { return (this->value_.bool_       != value); }
-        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;
-        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;
-
-        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; }
-        inline void setValue(char           value) { this->type_ = MT_char;       this->value_.char_       = value; }
-        inline void setValue(unsigned char  value) { this->type_ = MT_uchar;      this->value_.uchar_      = value; }
-        inline void setValue(short          value) { this->type_ = MT_short;      this->value_.short_      = value; }
-        inline void setValue(unsigned short value) { this->type_ = MT_ushort;     this->value_.ushort_     = value; }
-        inline void setValue(long           value) { this->type_ = MT_long;       this->value_.long_       = value; }
-        inline void setValue(unsigned long  value) { this->type_ = MT_ulong;      this->value_.ulong_      = value; }
-        inline void setValue(float          value) { this->type_ = MT_float;      this->value_.float_      = value; }
-        inline void setValue(double         value) { this->type_ = MT_double;     this->value_.double_     = value; }
-        inline void setValue(long double    value) { this->type_ = MT_longdouble; this->value_.longdouble_ = value; }
-        inline void setValue(bool           value) { this->type_ = MT_bool;       this->value_.bool_       = value; }
-        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_;       }
-        inline char           getChar()          const { return this->value_.char_;       }
-        inline unsigned char  getUnsignedChar()  const { return this->value_.uchar_;      }
-        inline short          getShort()         const { return this->value_.short_;      }
-        inline unsigned short getUnsignedShort() const { return this->value_.ushort_;     }
-        inline long           getLong()          const { return this->value_.long_;       }
-        inline unsigned long  getUnsignedLong()  const { return this->value_.ulong_;      }
-        inline float          getFloat()         const { return this->value_.float_;      }
-        inline double         getDouble()        const { return this->value_.double_;     }
-        inline long double    getLongDouble()    const { return this->value_.longdouble_; }
-        inline bool           getBool()          const { return this->value_.bool_;       }
-
-        inline int&            getInt()           { return this->value_.int_;        }
-        inline unsigned int&   getUnsignedInt()   { return this->value_.uint_;       }
-        inline char&           getChar()          { return this->value_.char_;       }
-        inline unsigned char&  getUnsignedChar()  { return this->value_.uchar_;      }
-        inline short&          getShort()         { return this->value_.short_;      }
-        inline unsigned short& getUnsignedShort() { return this->value_.ushort_;     }
-        inline long&           getLong()          { return this->value_.long_;       }
-        inline unsigned long&  getUnsignedLong()  { return this->value_.ulong_;      }
-        inline float&          getFloat()         { return this->value_.float_;      }
-        inline double&         getDouble()        { return this->value_.double_;     }
-        inline long double&    getLongDouble()    { return this->value_.longdouble_; }
-        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_;       }
-        inline void getValue(char*           variable) const { (*variable) = this->value_.char_;       }
-        inline void getValue(unsigned char*  variable) const { (*variable) = this->value_.uchar_;      }
-        inline void getValue(short*          variable) const { (*variable) = this->value_.short_;      }
-        inline void getValue(unsigned short* variable) const { (*variable) = this->value_.ushort_;     }
-        inline void getValue(long*           variable) const { (*variable) = this->value_.long_;       }
-        inline void getValue(unsigned long*  variable) const { (*variable) = this->value_.ulong_;      }
-        inline void getValue(float*          variable) const { (*variable) = this->value_.float_;      }
-        inline void getValue(double*         variable) const { (*variable) = this->value_.double_;     }
-        inline void getValue(long double*    variable) const { (*variable) = this->value_.longdouble_; }
-        inline void getValue(bool*           variable) const { (*variable) = this->value_.bool_;       }
-
-        inline MultiType getType()           const { return this->type_; }
-        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);
-
-        virtual bool assimilate(const MultiTypePrimitive& mtp, const MultiTypePrimitive& defvalue = MultiTypePrimitive());
-
-    protected:
-        MultiTypeValue  value_;
-        MultiType       type_;
-};
-
-_UtilExport std::ostream& operator<<(std::ostream& out, const MultiTypePrimitive& mtp);
-
-#endif /* _MultiTypePrimitive_H__ */
Index: code/trunk/src/util/MultiTypeString.cc
===================================================================
--- code/trunk/src/util/MultiTypeString.cc	(revision 1735)
+++ 	(revision )
@@ -1,193 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#include "MultiTypeString.h"
-#include "Convert.h"
-
-MultiTypeString::MultiTypeString(MultiType type) : MultiTypePrimitive(type)
-{
-    // Nothing to do for string
-}
-
-bool MultiTypeString::operator==(const MultiTypeString& mts) const
-{
-    if (!MultiTypePrimitive::operator==(mts) && this->type_ == mts.type_)
-    {
-        if (this->type_ == MT_constchar)
-            return (this->string_ == mts.string_);
-        else if (this->type_ == MT_string)
-            return (this->string_ == mts.string_);
-    }
-
-    return false;
-}
-
-bool MultiTypeString::operator==(const MultiTypePrimitive& mtp) const
-{
-    return MultiTypePrimitive::operator==(mtp);
-}
-
-bool MultiTypeString::operator!=(const MultiTypeString& mts) const
-{
-    if (MultiTypePrimitive::operator==(mts) && this->type_ == mts.type_)
-    {
-        if (this->type_ == MT_constchar)
-            return (this->string_ != mts.string_);
-        else if (this->type_ == MT_string)
-            return (this->string_ != mts.string_);
-    }
-
-    return true;
-}
-
-bool MultiTypeString::operator!=(const MultiTypePrimitive& mtp) const
-{
-    return MultiTypePrimitive::operator!=(mtp);
-}
-
-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_ : getConvertedValue<MultiTypeString, int>(*this, 0); }
-MultiTypeString::operator unsigned int() const
-{ 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_ : getConvertedValue<MultiTypeString, char>(*this, 0); }
-MultiTypeString::operator unsigned char() const
-{ 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_ : getConvertedValue<MultiTypeString, short>(*this, 0); }
-MultiTypeString::operator unsigned short() const
-{ 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_ : getConvertedValue<MultiTypeString, long>(*this, 0); }
-MultiTypeString::operator unsigned long() const
-{ 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_ : getConvertedValue<MultiTypeString, float>(*this, 0); }
-MultiTypeString::operator double() const
-{ 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_ : getConvertedValue<MultiTypeString, long double>(*this, 0); }
-MultiTypeString::operator bool() const
-{ 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_ : getConvertedValue<MultiTypeString, std::string>(*this); }
-MultiTypeString::operator const char*() const
-{ return ((this->type_ == MT_constchar) ? this->string_ : getConvertedValue<MultiTypeString, std::string>(*this)).c_str(); }
-
-void MultiTypeString::setValue(const MultiTypeString& mts)
-{
-    MultiTypePrimitive::setValue(mts);
-    this->string_ = mts.string_;
-}
-
-void MultiTypeString::setValue(const MultiTypePrimitive& mtp)
-{
-    MultiTypePrimitive::setValue(mtp);
-}
-
-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_;
-    else if (this->type_ == MT_string)
-        return this->string_;
-    else
-        return MultiTypePrimitive::toString();
-
-    // FIXME: unreachable code
-    // return output;
-}
-
-bool MultiTypeString::fromString(const std::string value)
-{
-    if (this->type_ == MT_constchar)
-        this->string_ = value;
-    else if (this->type_ == MT_string)
-        this->string_ = value;
-    else
-        return MultiTypePrimitive::fromString(value);
-
-    return true;
-}
-
-bool MultiTypeString::assimilate(const MultiTypeString& mts, const MultiTypeString& defvalue)
-{
-    if (this->type_ == MT_void)
-        return ConvertValue(&this->value_.void_, mts, defvalue.value_.void_);
-    else if (this->type_ == MT_int)
-        return ConvertValue(&this->value_.int_, mts, defvalue.value_.int_);
-    else if (this->type_ == MT_uint)
-        return ConvertValue(&this->value_.uint_, mts, defvalue.value_.uint_);
-    else if (this->type_ == MT_char)
-        return ConvertValue(&this->value_.char_, mts, defvalue.value_.char_);
-    else if (this->type_ == MT_uchar)
-        return ConvertValue(&this->value_.uchar_, mts, defvalue.value_.uchar_);
-    else if (this->type_ == MT_short)
-        return ConvertValue(&this->value_.short_, mts, defvalue.value_.short_);
-    else if (this->type_ == MT_ushort)
-        return ConvertValue(&this->value_.ushort_, mts, defvalue.value_.ushort_);
-    else if (this->type_ == MT_long)
-        return ConvertValue(&this->value_.long_, mts, defvalue.value_.long_);
-    else if (this->type_ == MT_ulong)
-        return ConvertValue(&this->value_.ulong_, mts, defvalue.value_.ulong_);
-    else if (this->type_ == MT_float)
-        return ConvertValue(&this->value_.float_, mts, defvalue.value_.float_);
-    else if (this->type_ == MT_double)
-        return ConvertValue(&this->value_.double_, mts, defvalue.value_.double_);
-    else if (this->type_ == MT_longdouble)
-        return ConvertValue(&this->value_.longdouble_, mts, defvalue.value_.longdouble_);
-    else if (this->type_ == MT_bool)
-        return ConvertValue(&this->value_.bool_, mts, defvalue.value_.bool_);
-    else if (this->type_ == MT_constchar)
-        return ConvertValue(&this->string_, mts, defvalue.string_);
-    else if (this->type_ == MT_string)
-        return ConvertValue(&this->string_, mts, defvalue.string_);
-    else
-        return false;
-}
-
-std::ostream& operator<<(std::ostream& out, MultiTypeString& mts)
-{
-    out << mts.toString();
-    return out;
-}
Index: code/trunk/src/util/MultiTypeString.h
===================================================================
--- code/trunk/src/util/MultiTypeString.h	(revision 1735)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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:
- *      ...
- *
- *   Inspiration: MultiType by Benjamin Grauer
- */
-
-#ifndef _MultiTypeString_H__
-#define _MultiTypeString_H__
-
-#include "UtilPrereqs.h"
-
-#include <string>
-#include <iostream>
-
-#include "MultiTypePrimitive.h"
-
-// disable annoying warning about multiple assignment operators
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
-#pragma warning(push)
-#pragma warning(disable:4522)
-#endif
-
-class _UtilExport MultiTypeString : public MultiTypePrimitive
-{
-    public:
-        MultiTypeString(MultiType type = MT_null);
-        inline MultiTypeString(void*          value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(char           value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(unsigned char  value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(short          value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(unsigned short value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(long           value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(unsigned long  value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(float          value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(double         value) : MultiTypePrimitive(value) {}
-        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 MultiTypePrimitive& mtp)  { this->setValue(mtp);   }
-        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 MultiTypePrimitive& mtp) { this->setValue(mtp);   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);              }
-        bool operator==(const MultiTypeString&    mts) const;
-        bool operator==(const MultiTypePrimitive& mtp) 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);              }
-        bool operator!=(const MultiTypeString&    mts) const;
-        bool operator!=(const MultiTypePrimitive& mtp) 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;              }
-        void setValue(const MultiTypeString&    mts);
-        void setValue(const MultiTypePrimitive& mtp);
-
-        inline std::string getString()     const { return this->string_;         }
-        inline const char*  getConstChar() const { 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(); }
-
-        virtual std::string getTypename() const;
-
-        virtual std::string toString() const;
-        virtual bool fromString(const std::string value);
-
-        virtual bool assimilate(const MultiTypeString& mts, const MultiTypeString& defvalue = MultiTypeString());
-
-    protected:
-        std::string      string_;
-};
-
-_UtilExport std::ostream& operator<<(std::ostream& out, MultiTypeString& mts);
-
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
-#pragma warning(pop)
-#endif
-
-#endif /* _MultiTypeString_H__ */
Index: code/trunk/src/util/MultiTypeValue.h
===================================================================
--- code/trunk/src/util/MultiTypeValue.h	(revision 1747)
+++ code/trunk/src/util/MultiTypeValue.h	(revision 1747)
@@ -0,0 +1,98 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 _MultiTypeValue_H__
+#define _MultiTypeValue_H__
+
+#include "UtilPrereqs.h"
+#include "Convert.h"
+#include "MultiType.h"
+
+template <typename T>
+struct MT_Value : public MultiType::MT_ValueBase
+{
+    MT_Value(const T& value, MT_Type type) : MT_ValueBase(type), value_(value) {}
+
+    inline MT_ValueBase* clone() const { return new MT_Value<T>(this->value_, this->type_); }
+    inline void reset() { this->value_ = T(); }
+    inline void assimilate(const MultiType& other) { if (other.value_) { T temp; other.getValue(&temp); this->value_ = temp; } else { this->value_ = T(); } }
+
+    inline void setValue(const char& value)                 { this->value_ = getConvertedValue<char,                 T>(value); }
+    inline void setValue(const unsigned char& value)        { this->value_ = getConvertedValue<unsigned char,        T>(value); }
+    inline void setValue(const short& value)                { this->value_ = getConvertedValue<short,                T>(value); }
+    inline void setValue(const unsigned short& value)       { this->value_ = getConvertedValue<unsigned short,       T>(value); }
+    inline void setValue(const int& value)                  { this->value_ = getConvertedValue<int,                  T>(value); }
+    inline void setValue(const unsigned int& value)         { this->value_ = getConvertedValue<unsigned int,         T>(value); }
+    inline void setValue(const long& value)                 { this->value_ = getConvertedValue<long,                 T>(value); }
+    inline void setValue(const unsigned long& value)        { this->value_ = getConvertedValue<unsigned long,        T>(value); }
+    inline void setValue(const long long& value)            { this->value_ = getConvertedValue<long long,            T>(value); }
+    inline void setValue(const unsigned long long& value)   { this->value_ = getConvertedValue<unsigned long long,   T>(value); }
+    inline void setValue(const float& value)                { this->value_ = getConvertedValue<float,                T>(value); }
+    inline void setValue(const double& value)               { this->value_ = getConvertedValue<double,               T>(value); }
+    inline void setValue(const long double& value)          { this->value_ = getConvertedValue<long double,          T>(value); }
+    inline void setValue(const bool& value)                 { this->value_ = getConvertedValue<bool,                 T>(value); }
+    inline void setValue(      void* const& value)          { this->value_ = getConvertedValue<void*,                T>(value); }
+    inline void setValue(const std::string& value)          { this->value_ = getConvertedValue<std::string,          T>(value); }
+    inline void setValue(const orxonox::Vector2& value)     { this->value_ = getConvertedValue<orxonox::Vector2,     T>(value); }
+    inline void setValue(const orxonox::Vector3& value)     { this->value_ = getConvertedValue<orxonox::Vector3,     T>(value); }
+    inline void setValue(const orxonox::Vector4& value)     { this->value_ = getConvertedValue<orxonox::Vector4,     T>(value); }
+    inline void setValue(const orxonox::ColourValue& value) { this->value_ = getConvertedValue<orxonox::ColourValue, T>(value); }
+    inline void setValue(const orxonox::Quaternion& value)  { this->value_ = getConvertedValue<orxonox::Quaternion,  T>(value); }
+    inline void setValue(const orxonox::Radian& value)      { this->value_ = getConvertedValue<orxonox::Radian,      T>(value); }
+    inline void setValue(const orxonox::Degree& value)      { this->value_ = getConvertedValue<orxonox::Degree,      T>(value); }
+
+    inline operator char()                 const { return getConvertedValue<T, char>                (this->value_, 0); }
+    inline operator unsigned char()        const { return getConvertedValue<T, unsigned char>       (this->value_, 0); }
+    inline operator short()                const { return getConvertedValue<T, short>               (this->value_, 0); }
+    inline operator unsigned short()       const { return getConvertedValue<T, unsigned short>      (this->value_, 0); }
+    inline operator int()                  const { return getConvertedValue<T, int>                 (this->value_, 0); }
+    inline operator unsigned int()         const { return getConvertedValue<T, unsigned int>        (this->value_, 0); }
+    inline operator long()                 const { return getConvertedValue<T, long>                (this->value_, 0); }
+    inline operator unsigned long()        const { return getConvertedValue<T, unsigned long>       (this->value_, 0); }
+    inline operator long long()            const { return getConvertedValue<T, long long>           (this->value_, 0); }
+    inline operator unsigned long long()   const { return getConvertedValue<T, unsigned long long>  (this->value_, 0); }
+    inline operator float()                const { return getConvertedValue<T, float>               (this->value_, 0); }
+    inline operator double()               const { return getConvertedValue<T, double>              (this->value_, 0); }
+    inline operator long double()          const { return getConvertedValue<T, long double>         (this->value_, 0); }
+    inline operator bool()                 const { return getConvertedValue<T, bool>                (this->value_, false); }
+    inline operator void*()                const { return getConvertedValue<T, void*>               (this->value_, 0); }
+    inline operator std::string()          const { return getConvertedValue<T, std::string>         (this->value_); }
+    inline operator orxonox::Vector2()     const { return getConvertedValue<T, orxonox::Vector2>    (this->value_); }
+    inline operator orxonox::Vector3()     const { return getConvertedValue<T, orxonox::Vector3>    (this->value_); }
+    inline operator orxonox::Vector4()     const { return getConvertedValue<T, orxonox::Vector4>    (this->value_); }
+    inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_); }
+    inline operator orxonox::Quaternion()  const { return getConvertedValue<T, orxonox::Quaternion> (this->value_); }
+    inline operator orxonox::Radian()      const { return getConvertedValue<T, orxonox::Radian>     (this->value_); }
+    inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_); }
+
+    inline void toString(std::ostream& outstream) const { outstream << this->value_; }
+
+    T value_;
+};
+
+#endif /* _MultiTypeValue_H__ */
Index: code/trunk/src/util/OutputBuffer.cc
===================================================================
--- code/trunk/src/util/OutputBuffer.cc	(revision 1747)
+++ code/trunk/src/util/OutputBuffer.cc	(revision 1747)
@@ -0,0 +1,96 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 "OutputBuffer.h"
+
+#define OUTPUTBUFFER_MAX_LINE_LENGTH 16384
+
+namespace orxonox
+{
+    void OutputBuffer::registerListener(OutputBufferListener* listener)
+    {
+        this->listeners_.insert(this->listeners_.end(), listener);
+    }
+
+    void OutputBuffer::unregisterListener(OutputBufferListener* listener)
+    {
+        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
+        {
+            if ((*it) == listener)
+                this->listeners_.erase(it++);
+            else
+                ++it;
+        }
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ostream& (*manipulator)(std::ostream&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ios& (*manipulator)(std::ios&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    OutputBuffer& OutputBuffer::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
+    {
+                this->stream_ << manipulator;
+                this->callListeners();
+                return *this;
+    }
+
+    bool OutputBuffer::getLine(std::string* output)
+    {
+        char line[OUTPUTBUFFER_MAX_LINE_LENGTH];
+
+        this->stream_.getline(line, OUTPUTBUFFER_MAX_LINE_LENGTH);
+        (*output) = std::string(line);
+
+        bool eof = this->stream_.eof();
+        bool fail = this->stream_.fail();
+
+        if (eof)
+            this->stream_.flush();
+
+        if (eof || fail)
+            this->stream_.clear();
+
+        return (!eof && !fail);
+    }
+
+    void OutputBuffer::callListeners()
+    {
+        for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+            (*it)->outputChanged();
+    }
+}
Index: code/trunk/src/util/OutputBuffer.h
===================================================================
--- code/trunk/src/util/OutputBuffer.h	(revision 1747)
+++ code/trunk/src/util/OutputBuffer.h	(revision 1747)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 _OutputBuffer_H__
+#define _OutputBuffer_H__
+
+#include <list>
+#include <sstream>
+#include <iostream>
+
+#include "UtilPrereqs.h"
+
+namespace orxonox
+{
+    class _UtilExport OutputBufferListener
+    {
+        friend class OutputBuffer;
+
+        public:
+            virtual ~OutputBufferListener() {}
+
+        private:
+            virtual void outputChanged() = 0;
+    };
+
+    class _UtilExport OutputBuffer
+    {
+        public:
+            OutputBuffer() {}
+            ~OutputBuffer() {}
+
+            template <class T>
+            inline OutputBuffer& operator<<(T object)
+            {
+                this->stream_ << object;
+                this->callListeners();
+                return *this;
+            }
+
+            template <const OutputBuffer&>
+            inline OutputBuffer& operator<<(const OutputBuffer& object)
+            {
+                this->stream_ << object.stream_.rdbuf();
+                this->callListeners();
+                return *this;
+            }
+
+            OutputBuffer& operator<<(std::ostream& (*manipulator)(std::ostream&));
+            OutputBuffer& operator<<(std::ios& (*manipulator)(std::ios&));
+            OutputBuffer& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
+
+            template <class T>
+            inline void add(T object)
+            {
+                this->stream_ << object;
+                this->callListeners();
+            }
+
+            template <class T>
+            inline void addLine(T object)
+            {
+                this->stream_ << object << std::endl;
+                this->callListeners();
+            }
+
+            inline void newline()
+            {
+                this->stream_ << std::endl;
+                this->callListeners();
+            }
+
+            inline void flush()
+            {
+                this->stream_.flush();
+            }
+
+            bool getLine(std::string* output);
+
+            void registerListener(OutputBufferListener* listener);
+            void unregisterListener(OutputBufferListener* listener);
+
+            inline std::stringstream& getStream()
+                { return this->stream_; }
+
+        private:
+            void callListeners();
+
+            std::stringstream stream_;
+            std::list<OutputBufferListener*> listeners_;
+    };
+}
+
+#endif /* _OutputBuffer_H__ */
Index: code/trunk/src/util/OutputHandler.cc
===================================================================
--- code/trunk/src/util/OutputHandler.cc	(revision 1747)
+++ code/trunk/src/util/OutputHandler.cc	(revision 1747)
@@ -0,0 +1,188 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 OutputHandler.cc
+    @brief Implementation of the OutputHandler class.
+*/
+
+#include "OutputHandler.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Opens the logfile and writes the first line.
+        @param logfilename The name of the logfile
+    */
+    OutputHandler::OutputHandler(const std::string& logfilename)
+    {
+        this->outputBuffer_ = &this->fallbackBuffer_;
+        this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2;
+        this->logfilename_ = logfilename;
+        this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
+        this->logfile_ << "Started log at yyyy/mm/dd hh:mm:ss" << std::endl;
+        this->logfile_.flush();
+    }
+
+    /**
+        @brief Destructor: Writes the last line to the logfile and closes it.
+    */
+    OutputHandler::~OutputHandler()
+    {
+        this->logfile_ << "Closed log" << std::endl;
+        this->logfile_.close();
+    }
+
+    /**
+        @brief Returns a reference to the only existing instance of the OutputHandler class.
+        @return The instance
+    */
+    OutputHandler& OutputHandler::getOutStream()
+    {
+        static OutputHandler orxout("orxonox.log");
+        return orxout;
+    }
+
+    /**
+        @brief Sets the soft debug level for a given output device.
+        @param device The output device
+        @param level The debug level
+    */
+    void OutputHandler::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
+    {
+        OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device] = level;
+    }
+
+    /**
+        @brief Returns the soft debug level for a given output device.
+        @param device The output device
+        @return The debug level
+    */
+    int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device)
+    {
+        return OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device];
+    }
+
+    /**
+        @brief Sets the OutputBuffer, representing the third output stream.
+        @param buffer The OutputBuffer
+    */
+    void OutputHandler::setOutputBuffer(OutputBuffer& buffer)
+    {
+        buffer.getStream() >> this->outputBuffer_->getStream().rdbuf();
+        this->outputBuffer_ = &buffer;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param sb The streambuffer that should be shown in the console
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::streambuf* sb)
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            std::cout << sb;
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            this->logfile_ << sb;
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << sb;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ostream& (*manipulator)(std::ostream&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ios& (*manipulator)(std::ios&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloaded << operator, redirects the output to the console and the logfile.
+        @param manipulator A function, manipulating the outstream.
+        @return A reference to the OutputHandler itself
+    */
+    OutputHandler& OutputHandler::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
+    {
+        if (getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            manipulator(std::cout);
+
+        if (getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            manipulator(this->logfile_);
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << manipulator;
+
+        return *this;
+    }
+}
Index: code/trunk/src/util/OutputHandler.h
===================================================================
--- code/trunk/src/util/OutputHandler.h	(revision 1747)
+++ code/trunk/src/util/OutputHandler.h	(revision 1747)
@@ -0,0 +1,204 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 OutputHandler.h
+    @brief Definition of the OutputHandler class.
+
+    The OutputHandler acts like std::cout, but output isn't only shown in the console,
+    but also written to the logfile.
+*/
+
+#ifndef _OutputHandler_H__
+#define _OutputHandler_H__
+
+#include "UtilPrereqs.h"
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include "OutputBuffer.h"
+
+namespace orxonox
+{
+    //! The OutputHandler acts like std::cout, but redirects output to the console AND the logfile.
+    class _UtilExport OutputHandler
+    {
+        public:
+            enum OutputDevice
+            {
+                LD_All = 0,
+                LD_Console = 1,
+                LD_Logfile = 2,
+                LD_Shell = 3
+            };
+
+            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 Puts an error on the outstream. @param text The text */
+            static inline std::string error(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts a warning on the outstream. @param text The text */
+            static inline std::string warning(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts an info on the outstream. @param text The text */
+            static inline std::string info(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Puts some debug output on the outstream. @param text The text */
+            static inline std::string debug(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
+
+            /** @brief Returns a reference to the logfile. @return The logfile */
+            inline std::ofstream& getLogfile()
+                { return this->logfile_; }
+
+            /** @brief Returns a pointer to the OutputBuffer. @return The OutputBuffer */
+            inline OutputBuffer* getOutputBuffer()
+                { return this->outputBuffer_; }
+
+            /** @brief Sets the level of the incoming output. @param level The level of the incoming output @return The OutputHandler itself */
+            inline OutputHandler& setOutputLevel(int level)
+                { this->outputLevel_ = level; return *this; }
+
+            /** @brief Returns the level of the incoming output. @return The level */
+            inline int getOutputLevel() const
+                { return this->outputLevel_; }
+
+            static void setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
+            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
+
+            void setOutputBuffer(OutputBuffer& buffer);
+
+            template <class T>
+            OutputHandler& output(const T& output);
+
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned char val)      { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(short val)              { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned short val)     { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(int val)                { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned int val)       { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(long val)               { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned long val)      { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(long long val)          { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(unsigned long long val) { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(float val)              { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(double val)             { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(long double val)        { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(const void* val)        { return this->output(val); }
+            /** @brief Overloaded << operator, redirects the output to the console and the logfile. @param val The value that should be shown in the console @return A reference to the OutputHandler itself */
+            inline OutputHandler& operator<<(bool val)               { return this->output(val); }
+
+            OutputHandler& operator<<(std::streambuf* sb);
+
+            OutputHandler& operator<<(std::ostream& (*manipulator)(std::ostream&));
+            OutputHandler& operator<<(std::ios& (*manipulator)(std::ios&));
+            OutputHandler& operator<<(std::ios_base& (*manipulator)(std::ios_base&));
+
+        private:
+            explicit OutputHandler(const std::string& logfilename);
+            OutputHandler(const OutputHandler& oh);  // don't copy
+            virtual ~OutputHandler();
+
+            std::ofstream logfile_;              //!< The logfile where the output is logged
+            std::string logfilename_;            //!< The name of the logfile
+            OutputBuffer fallbackBuffer_;        //!< The OutputBuffer that gets used if there is no other OutputBuffer
+            OutputBuffer* outputBuffer_;         //!< The OutputBuffer to put output in (usually used by the Shell)
+            int outputLevel_;                    //!< The level of the incoming output
+            int softDebugLevel_[4];              //!< The soft debug level for each OutputDevice - the configurable maximal output level
+    };
+
+    /**
+        @brief Redirects the output to the console and the logfile.
+        @param output The value that should be shown in the console
+        @return A reference to the OutputHandler itself
+    */
+    template<class T>
+    OutputHandler& OutputHandler::output(const T& output)
+    {
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Console) >= this->outputLevel_)
+            std::cout << output;
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Logfile) >= this->outputLevel_)
+        {
+            this->logfile_ << output;
+            this->logfile_.flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_)
+            (*this->outputBuffer_) << output;
+
+        return *this;
+    }
+
+    /**
+        @brief Overloading of the non-member << operator to redirect the output of classes with self defined '<< to std::ostream' operators to the console and the logfile.
+        @param out The OutputHandler itself
+        @param output The class that should be shown in the console
+        @return The OutputHandler itself
+    */
+    template<class T>
+    OutputHandler& operator<<(OutputHandler& out, const T& output)
+    {
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Console) >= out.getOutputLevel())
+            std::cout << output;
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Logfile) >= out.getOutputLevel())
+        {
+            out.getLogfile() << output;
+            out.getLogfile().flush();
+        }
+
+        if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= out.getOutputLevel())
+            (*out.getOutputBuffer()) << output;
+
+        return out;
+    }
+}
+
+#endif /* _OutputHandler_H__ */
Index: code/trunk/src/util/UtilPrereqs.h
===================================================================
--- code/trunk/src/util/UtilPrereqs.h	(revision 1735)
+++ code/trunk/src/util/UtilPrereqs.h	(revision 1747)
@@ -62,9 +62,14 @@
 class ArgReader;
 class Convert;
-class MultiTypePrimitive;
-class MultiTypeString;
-class MultiTypeMath;
-template <class T>
-class String2Number;
+class ExprParser;
+class MultiType;
 class SubString;
+namespace orxonox
+{
+    class OutputBuffer;
+    class OutputBufferListener;
+    class Error;
+    class OutputHandler;
+}
+
 #endif /* _UtilPrereqs_H__ */
