Index: /code/trunk/TODO
===================================================================
--- /code/trunk/TODO	(revision 2170)
+++ /code/trunk/TODO	(revision 2171)
@@ -1,3 +1,5 @@
 todo: 
+
+	test network functionality with paketloss/delay: http://www.linuxfoundation.org/en/Net:Netem#Packet_loss
 
 	bidirectional
Index: /code/trunk/bin/run-script
===================================================================
--- /code/trunk/bin/run-script	(revision 2170)
+++ /code/trunk/bin/run-script	(revision 2171)
@@ -8,5 +8,5 @@
 fi
 
-if [[ -ne orge.cfg ]] ; then
+if [[ ! -f ogre.cfg ]] ; then
 	cp ogre.cfg-init ogre.cfg
 fi
Index: /code/trunk/src/audio/AudioBuffer.cc
===================================================================
--- /code/trunk/src/audio/AudioBuffer.cc	(revision 2170)
+++ /code/trunk/src/audio/AudioBuffer.cc	(revision 2171)
@@ -29,5 +29,5 @@
 #include "AudioBuffer.h"
 
-namespace audio
+namespace orxonox
 {
     AudioBuffer::AudioBuffer(std::string filename)
Index: /code/trunk/src/audio/AudioBuffer.h
===================================================================
--- /code/trunk/src/audio/AudioBuffer.h	(revision 2170)
+++ /code/trunk/src/audio/AudioBuffer.h	(revision 2171)
@@ -35,5 +35,5 @@
 #include <AL/al.h>
 
-namespace audio
+namespace orxonox
 {
     class _AudioExport AudioBuffer
Index: /code/trunk/src/audio/AudioManager.cc
===================================================================
--- /code/trunk/src/audio/AudioManager.cc	(revision 2170)
+++ /code/trunk/src/audio/AudioManager.cc	(revision 2171)
@@ -37,5 +37,5 @@
 #include "AudioStream.h"
 
-namespace audio
+namespace orxonox
 {
     AudioManager::AudioManager()
Index: /code/trunk/src/audio/AudioManager.h
===================================================================
--- /code/trunk/src/audio/AudioManager.h	(revision 2170)
+++ /code/trunk/src/audio/AudioManager.h	(revision 2171)
@@ -35,5 +35,5 @@
 #include <string>
 
-namespace audio
+namespace orxonox
 {
     class _AudioExport AudioManager
Index: /code/trunk/src/audio/AudioPrereqs.h
===================================================================
--- /code/trunk/src/audio/AudioPrereqs.h	(revision 2170)
+++ /code/trunk/src/audio/AudioPrereqs.h	(revision 2171)
@@ -60,5 +60,5 @@
 // Forward declarations
 //-----------------------------------------------------------------------
-namespace audio
+namespace orxonox
 {
   class AudioBuffer;
Index: /code/trunk/src/audio/AudioSource.cc
===================================================================
--- /code/trunk/src/audio/AudioSource.cc	(revision 2170)
+++ /code/trunk/src/audio/AudioSource.cc	(revision 2171)
@@ -29,5 +29,5 @@
 #include "AudioSource.h"
 
-namespace audio
+namespace orxonox
 {
     AudioSource::AudioSource()
Index: /code/trunk/src/audio/AudioSource.h
===================================================================
--- /code/trunk/src/audio/AudioSource.h	(revision 2170)
+++ /code/trunk/src/audio/AudioSource.h	(revision 2171)
@@ -32,5 +32,5 @@
 #include "AudioPrereqs.h"
 
-namespace audio
+namespace orxonox
 {
     class _AudioExport AudioSource
Index: /code/trunk/src/audio/AudioStream.cc
===================================================================
--- /code/trunk/src/audio/AudioStream.cc	(revision 2170)
+++ /code/trunk/src/audio/AudioStream.cc	(revision 2171)
@@ -30,5 +30,5 @@
 #include "util/Debug.h"
 
-namespace audio
+namespace orxonox
 {
     AudioStream::AudioStream(std::string path)
Index: /code/trunk/src/audio/AudioStream.h
===================================================================
--- /code/trunk/src/audio/AudioStream.h	(revision 2170)
+++ /code/trunk/src/audio/AudioStream.h	(revision 2171)
@@ -39,5 +39,5 @@
 
 
-namespace audio
+namespace orxonox
 {
     const int BUFFER_SIZE = 4096 * 4;
Index: /code/trunk/src/core/BaseObject.cc
===================================================================
--- /code/trunk/src/core/BaseObject.cc	(revision 2170)
+++ /code/trunk/src/core/BaseObject.cc	(revision 2171)
@@ -41,4 +41,5 @@
 #include "Template.h"
 #include "util/String.h"
+#include "util/mbool.h"
 
 namespace orxonox
Index: /code/trunk/src/core/BaseObject.h
===================================================================
--- /code/trunk/src/core/BaseObject.h	(revision 2170)
+++ /code/trunk/src/core/BaseObject.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file BaseObject.h
+    @file
     @brief Definition of the BaseObject class.
 
@@ -45,4 +45,5 @@
 #include "XMLIncludes.h"
 #include "Event.h"
+#include "util/mbool.h"
 
 namespace orxonox
@@ -72,14 +73,28 @@
 
             /** @brief Sets the state of the objects activity. @param bActive True = active */
-            inline void setActive(bool bActive) { this->bActive_ = bActive; this->changedActivity(); }
+            inline void setActive(bool bActive)
+            {
+                if (this->bActive_ != bActive)
+                {
+                    this->bActive_ = bActive;
+                    this->changedActivity();
+                }
+            }
             /** @brief Returns the state of the objects activity. @return The state of the activity */
-            inline bool isActive() const { return this->bActive_; }
+            inline const mbool& isActive() const { return this->bActive_; }
             /** @brief This function gets called if the activity of the object changes. */
             virtual void changedActivity() {}
 
             /** @brief Sets the state of the objects visibility. @param bVisible True = visible */
-            inline void setVisible(bool bVisible) { this->bVisible_ = bVisible; this->changedVisibility(); }
+            inline void setVisible(bool bVisible)
+            {
+                if (this->bVisible_ != bVisible)
+                {
+                    this->bVisible_ = bVisible;
+                    this->changedVisibility();
+                }
+            }
             /** @brief Returns the state of the objects visibility. @return The state of the visibility */
-            inline bool isVisible() const { return this->bVisible_; }
+            inline const mbool& isVisible() const { return this->bVisible_; }
             /** @brief This function gets called if the visibility of the object changes. */
             virtual void changedVisibility() {}
@@ -138,6 +153,6 @@
             std::string name_;                          //!< The name of the object
             std::string oldName_;                       //!< The old name of the object
-            bool bActive_;                              //!< True = the object is active
-            bool bVisible_;                             //!< True = the object is visible
+            mbool bActive_;                             //!< True = the object is active
+            mbool bVisible_;                            //!< True = the object is visible
 
         private:
Index: /code/trunk/src/core/ClassFactory.h
===================================================================
--- /code/trunk/src/core/ClassFactory.h	(revision 2170)
+++ /code/trunk/src/core/ClassFactory.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ClassFactory.h
+    @file
     @brief Definition and implementation of the ClassFactory class
 
Index: /code/trunk/src/core/ClassTreeMask.cc
===================================================================
--- /code/trunk/src/core/ClassTreeMask.cc	(revision 2170)
+++ /code/trunk/src/core/ClassTreeMask.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ClassTreeMask.cc
+    @file
     @brief Implementation of the ClassTreeMask, ClassTreeMaskNode and ClassTreeMaskIterator classes.
 */
Index: /code/trunk/src/core/ClassTreeMask.h
===================================================================
--- /code/trunk/src/core/ClassTreeMask.h	(revision 2170)
+++ /code/trunk/src/core/ClassTreeMask.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ClassTreeMask.h
+    @file
     @brief Definition of the ClassTreeMask, ClassTreeMaskNode and ClassTreeMaskIterator classes.
 
Index: /code/trunk/src/core/Clock.h
===================================================================
--- /code/trunk/src/core/Clock.h	(revision 2170)
+++ /code/trunk/src/core/Clock.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Core.h
+    @file
     @brief Declaration of the Core class.
 
Index: /code/trunk/src/core/ConfigValueContainer.cc
===================================================================
--- /code/trunk/src/core/ConfigValueContainer.cc	(revision 2170)
+++ /code/trunk/src/core/ConfigValueContainer.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ConfigValueContainer.cc
+    @file
     @brief Implementation of the ConfigValueContainer class.
 */
Index: /code/trunk/src/core/ConfigValueContainer.h
===================================================================
--- /code/trunk/src/core/ConfigValueContainer.h	(revision 2170)
+++ /code/trunk/src/core/ConfigValueContainer.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ConfigValueContainer.h
+    @file
     @brief Definition of the ConfigValueContainer class.
 
Index: /code/trunk/src/core/ConfigValueIncludes.h
===================================================================
--- /code/trunk/src/core/ConfigValueIncludes.h	(revision 2170)
+++ /code/trunk/src/core/ConfigValueIncludes.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ConfigValueIncludes.h
+    @file
     @brief Definition of macros for config-values.
 */
Index: /code/trunk/src/core/Core.cc
===================================================================
--- /code/trunk/src/core/Core.cc	(revision 2170)
+++ /code/trunk/src/core/Core.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Core.cc
+    @file
     @brief Implementation of the Core class.
 */
Index: /code/trunk/src/core/Core.h
===================================================================
--- /code/trunk/src/core/Core.h	(revision 2170)
+++ /code/trunk/src/core/Core.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Core.h
+    @file
     @brief Declaration of the Core class.
 
Index: /code/trunk/src/core/CoreIncludes.h
===================================================================
--- /code/trunk/src/core/CoreIncludes.h	(revision 2170)
+++ /code/trunk/src/core/CoreIncludes.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file CoreIncludes.h
+    @file
     @brief Definition of macros for Identifier and Factory.
 
Index: /code/trunk/src/core/Factory.cc
===================================================================
--- /code/trunk/src/core/Factory.cc	(revision 2170)
+++ /code/trunk/src/core/Factory.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Factory.cc
+    @file
     @brief Implementation of the Factory class.
 */
Index: /code/trunk/src/core/Factory.h
===================================================================
--- /code/trunk/src/core/Factory.h	(revision 2170)
+++ /code/trunk/src/core/Factory.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Factory.h
+    @file
     @brief Definition of the Factory and the BaseFactory class.
 
Index: /code/trunk/src/core/Identifier.cc
===================================================================
--- /code/trunk/src/core/Identifier.cc	(revision 2170)
+++ /code/trunk/src/core/Identifier.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Identifier.cc
+    @file
     @brief Implementation of the Identifier class.
 */
Index: /code/trunk/src/core/Identifier.h
===================================================================
--- /code/trunk/src/core/Identifier.h	(revision 2170)
+++ /code/trunk/src/core/Identifier.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Identifier.h
+    @file
     @brief Definition of the Identifier, ClassIdentifier and SubclassIdentifier classes, implementation of the ClassIdentifier and SubclassIdentifier classes.
 
Index: /code/trunk/src/core/Iterator.h
===================================================================
--- /code/trunk/src/core/Iterator.h	(revision 2170)
+++ /code/trunk/src/core/Iterator.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Iterator.h
+    @file
     @brief Definition and implementation of the Iterator class.
 
Index: /code/trunk/src/core/Language.cc
===================================================================
--- /code/trunk/src/core/Language.cc	(revision 2170)
+++ /code/trunk/src/core/Language.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Language.cc
+    @file
     @brief Implementation of the Language and the LanguageEntry classes.
 */
Index: /code/trunk/src/core/Language.h
===================================================================
--- /code/trunk/src/core/Language.h	(revision 2170)
+++ /code/trunk/src/core/Language.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Language.h
+    @file
     @brief Definition of the Language and the LanguageEntry class.
 
Index: /code/trunk/src/core/Loader.cc
===================================================================
--- /code/trunk/src/core/Loader.cc	(revision 2170)
+++ /code/trunk/src/core/Loader.cc	(revision 2171)
@@ -37,4 +37,5 @@
 #include "Namespace.h"
 #include "util/Debug.h"
+#include "util/Exception.h"
 
 #include "tinyxml/ticpp.h"
@@ -157,9 +158,32 @@
             return true;
         }
-        catch(ticpp::Exception& ex)
+        catch (ticpp::Exception& ex)
+        {
+            COUT(1) << std::endl;
+            COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
+            COUT(1) << ex.what() << std::endl;
+            COUT(1) << "Loading aborted." << std::endl;
+            return false;
+        }
+        catch (Exception& ex)
+        {
+            COUT(1) << std::endl;
+            COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
+            COUT(1) << ex.what() << std::endl;
+            COUT(1) << "Loading aborted." << std::endl;
+            return false;
+        }
+        catch (std::exception& ex)
         {
             COUT(1) << std::endl;
             COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
             COUT(1) << ex.what() << std::endl;
+            COUT(1) << "Loading aborted." << std::endl;
+            return false;
+        }
+        catch (...)
+        {
+            COUT(1) << std::endl;
+            COUT(1) << "An unknown error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
             COUT(1) << "Loading aborted." << std::endl;
             return false;
Index: /code/trunk/src/core/MetaObjectList.cc
===================================================================
--- /code/trunk/src/core/MetaObjectList.cc	(revision 2170)
+++ /code/trunk/src/core/MetaObjectList.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file MetaObjectList.cc
+    @file
     @brief Implementation of the MetaObjectList class.
 */
Index: /code/trunk/src/core/MetaObjectList.h
===================================================================
--- /code/trunk/src/core/MetaObjectList.h	(revision 2170)
+++ /code/trunk/src/core/MetaObjectList.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file MetaObjectList.h
+    @file
     @brief Definition of the MetaObjectList class.
 
Index: /code/trunk/src/core/ObjectList.h
===================================================================
--- /code/trunk/src/core/ObjectList.h	(revision 2170)
+++ /code/trunk/src/core/ObjectList.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ObjectList.h
+    @file
     @brief Definition and implementation of the ObjectList class.
 
Index: /code/trunk/src/core/ObjectListBase.cc
===================================================================
--- /code/trunk/src/core/ObjectListBase.cc	(revision 2170)
+++ /code/trunk/src/core/ObjectListBase.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ObjectListBase.cc
+    @file
     @brief Implementation of the ObjectListBase class.
 
Index: /code/trunk/src/core/ObjectListBase.h
===================================================================
--- /code/trunk/src/core/ObjectListBase.h	(revision 2170)
+++ /code/trunk/src/core/ObjectListBase.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file ObjectListBase.h
+    @file
     @brief Definition of the ObjectListBase class.
 
Index: /code/trunk/src/core/OrxonoxClass.cc
===================================================================
--- /code/trunk/src/core/OrxonoxClass.cc	(revision 2170)
+++ /code/trunk/src/core/OrxonoxClass.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OrxonoxClass.cc
+    @file
     @brief Implementation of the OrxonoxClass Class.
 */
Index: /code/trunk/src/core/OrxonoxClass.h
===================================================================
--- /code/trunk/src/core/OrxonoxClass.h	(revision 2170)
+++ /code/trunk/src/core/OrxonoxClass.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OrxonoxClass.h
+    @file
     @brief Declaration of the OrxonoxClass Class.
 
Index: /code/trunk/src/core/Super.h
===================================================================
--- /code/trunk/src/core/Super.h	(revision 2170)
+++ /code/trunk/src/core/Super.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Super.h
+    @file
     @brief Definition of all super-function related macros.
 
Index: /code/trunk/src/core/XMLIncludes.h
===================================================================
--- /code/trunk/src/core/XMLIncludes.h	(revision 2170)
+++ /code/trunk/src/core/XMLIncludes.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file XMLIncludes.h
+    @file
     @brief Forward declarations of some XML classes.
 */
Index: /code/trunk/src/core/XMLPort.h
===================================================================
--- /code/trunk/src/core/XMLPort.h	(revision 2170)
+++ /code/trunk/src/core/XMLPort.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file XMLPort.h
+    @file
     @brief Declaration of the XMLPort helper classes and macros.
 
@@ -44,4 +44,5 @@
 
 #include "util/Debug.h"
+#include "util/Exception.h"
 #include "util/MultiType.h"
 #include "tinyxml/ticpp.h"
@@ -495,30 +496,47 @@
                                             if (this->identifierIsIncludedInLoaderMask(identifier))
                                             {
-                                                COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
-
-                                                BaseObject* newObject = identifier->fabricate((BaseObject*)object);
-                                                assert(newObject);
-                                                newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + "  ");
-
-                                                O* castedObject = dynamic_cast<O*>(newObject);
-                                                assert(castedObject);
-
-                                                if (this->bLoadBefore_)
+                                                try
                                                 {
-                                                    newObject->XMLPort(*child, XMLPort::LoadObject);
-                                                    COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
+                                                    COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;
+
+                                                    BaseObject* newObject = identifier->fabricate((BaseObject*)object);
+                                                    assert(newObject);
+                                                    newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + "  ");
+
+                                                    O* castedObject = dynamic_cast<O*>(newObject);
+                                                    assert(castedObject);
+
+                                                    if (this->bLoadBefore_)
+                                                    {
+                                                        newObject->XMLPort(*child, XMLPort::LoadObject);
+                                                        COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
+                                                    }
+                                                    else
+                                                    {
+                                                        COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
+                                                    }
+
+                                                    COUT(5) << ((BaseObject*)object)->getLoaderIndentation();
+                                                    (*this->loadexecutor_)(object, castedObject);
+
+                                                    if (!this->bLoadBefore_)
+                                                        newObject->XMLPort(*child, XMLPort::LoadObject);
+
+                                                    COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
                                                 }
-                                                else
+                                                catch (AbortLoadingException& ex)
                                                 {
-                                                    COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
+                                                    COUT(1) << "An error occurred while loading object, abort loading..." << std::endl;
+                                                    throw ex;
                                                 }
-
-                                                COUT(5) << ((BaseObject*)object)->getLoaderIndentation();
-                                                (*this->loadexecutor_)(object, castedObject);
-
-                                                if (!this->bLoadBefore_)
-                                                    newObject->XMLPort(*child, XMLPort::LoadObject);
-
-                                                COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
+                                                catch (std::exception& ex)
+                                                {
+                                                    COUT(1) << "An error occurred while loading object:" << std::endl;
+                                                    COUT(1) << ex.what() << std::endl;
+                                                }
+                                                catch (...)
+                                                {
+                                                    COUT(1) << "An unknown error occurred while loading object." << std::endl;
+                                                }
                                             }
                                         }
Index: /code/trunk/src/network/ChatListener.cc
===================================================================
--- /code/trunk/src/network/ChatListener.cc	(revision 2170)
+++ /code/trunk/src/network/ChatListener.cc	(revision 2171)
@@ -32,5 +32,5 @@
 #include "core/Core.h"
 
-namespace network
+namespace orxonox
 {
     ChatListener::ChatListener()
Index: /code/trunk/src/network/ChatListener.h
===================================================================
--- /code/trunk/src/network/ChatListener.h	(revision 2170)
+++ /code/trunk/src/network/ChatListener.h	(revision 2171)
@@ -35,7 +35,7 @@
 #include "core/OrxonoxClass.h"
 
-namespace network
+namespace orxonox
 {
-    class _NetworkExport ChatListener : virtual public orxonox::OrxonoxClass
+    class _NetworkExport ChatListener : virtual public OrxonoxClass
     {
         public:
Index: /code/trunk/src/network/Client.cc
===================================================================
--- /code/trunk/src/network/Client.cc	(revision 2170)
+++ /code/trunk/src/network/Client.cc	(revision 2171)
@@ -49,5 +49,5 @@
 // #include "packet/Acknowledgement.h"
 
-namespace network
+namespace orxonox
 {
 //   SetConsoleCommandShortcut(Client, chat);
Index: /code/trunk/src/network/Client.h
===================================================================
--- /code/trunk/src/network/Client.h	(revision 2170)
+++ /code/trunk/src/network/Client.h	(revision 2171)
@@ -54,8 +54,8 @@
 
 
-namespace network
+namespace orxonox
 {
   /**
-  network::Client *client;
+  Client *client;
   * The network/Client class
   * This class implements all necessary function for the network communication
Index: /code/trunk/src/network/ClientConnection.cc
===================================================================
--- /code/trunk/src/network/ClientConnection.cc	(revision 2170)
+++ /code/trunk/src/network/ClientConnection.cc	(revision 2171)
@@ -48,5 +48,5 @@
 #include "util/Debug.h"
 
-namespace network
+namespace orxonox
 {
   //static boost::thread_group network_threads;
Index: /code/trunk/src/network/ClientConnection.h
===================================================================
--- /code/trunk/src/network/ClientConnection.h	(revision 2170)
+++ /code/trunk/src/network/ClientConnection.h	(revision 2171)
@@ -50,5 +50,5 @@
 namespace boost { class thread; }
 
-namespace network
+namespace orxonox
 {
 
Index: /code/trunk/src/network/ClientConnectionListener.cc
===================================================================
--- /code/trunk/src/network/ClientConnectionListener.cc	(revision 2170)
+++ /code/trunk/src/network/ClientConnectionListener.cc	(revision 2171)
@@ -3,5 +3,5 @@
 #include "core/Core.h"
 
-namespace network{
+namespace orxonox{
 
   ClientConnectionListener::ClientConnectionListener()
@@ -11,5 +11,5 @@
 
   void ClientConnectionListener::getConnectedClients(){
-    if(orxonox::Core::showsGraphics())
+    if(Core::showsGraphics())
       this->clientConnected(0); //server client id
     ClientInformation *client = ClientInformation::getBegin();
Index: /code/trunk/src/network/ClientConnectionListener.h
===================================================================
--- /code/trunk/src/network/ClientConnectionListener.h	(revision 2170)
+++ /code/trunk/src/network/ClientConnectionListener.h	(revision 2171)
@@ -6,7 +6,7 @@
 #include "core/OrxonoxClass.h"
 
-namespace network{
+namespace orxonox{
 
-  class _NetworkExport ClientConnectionListener : virtual public orxonox::OrxonoxClass
+  class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
   {
     friend class Server;
Index: /code/trunk/src/network/ClientInformation.cc
===================================================================
--- /code/trunk/src/network/ClientInformation.cc	(revision 2170)
+++ /code/trunk/src/network/ClientInformation.cc	(revision 2171)
@@ -43,5 +43,5 @@
 #include <iostream> //debug
 
-namespace network
+namespace orxonox
 {
 
Index: /code/trunk/src/network/ClientInformation.h
===================================================================
--- /code/trunk/src/network/ClientInformation.h	(revision 2170)
+++ /code/trunk/src/network/ClientInformation.h	(revision 2171)
@@ -48,5 +48,5 @@
 // WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE
 
-namespace network
+namespace orxonox
 {
   static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
Index: /code/trunk/src/network/ConnectionManager.cc
===================================================================
--- /code/trunk/src/network/ConnectionManager.cc	(revision 2170)
+++ /code/trunk/src/network/ConnectionManager.cc	(revision 2171)
@@ -65,5 +65,5 @@
 }
 
-namespace network
+namespace orxonox
 {
   //boost::thread_group network_threads;
@@ -138,5 +138,5 @@
 
   bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) {
-    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     if(enet_peer_send(peer, NETWORK_DEFAULT_CHANNEL, packet)!=0)
       return false;
@@ -156,5 +156,5 @@
     if(!instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     for(ClientInformation *i=ClientInformation::getBegin()->next(); i!=0; i=i->next()){
       COUT(3) << "adding broadcast packet for client: " << i->getID() << std::endl;
@@ -169,5 +169,5 @@
     if(server==NULL || !instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     enet_host_flush(server);
     lock.unlock();
@@ -180,5 +180,5 @@
     atexit(enet_deinitialize);
     { //scope of the mutex
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_initialize();
       server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
@@ -194,5 +194,5 @@
     while(!quit){
       { //mutex scope
-        boost::recursive_mutex::scoped_lock lock(enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
         if(enet_host_service(server, event, NETWORK_WAIT_TIMEOUT)<0){
           // we should never reach this point
@@ -236,5 +236,5 @@
     // if we're finishied, destroy server
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_host_destroy(server);
       lock.unlock();
@@ -250,5 +250,5 @@
     while(temp!=0){
       {
-        boost::recursive_mutex::scoped_lock lock(enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
         enet_peer_disconnect(temp->getPeer(), 0);
         lock.unlock();
@@ -258,5 +258,5 @@
     //bugfix: might be the reason why server crashes when clients disconnects
     temp = ClientInformation::getBegin()->next();
-    boost::recursive_mutex::scoped_lock lock(enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     while( temp!=0 && enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT) >= 0){
       switch (event.type)
@@ -306,7 +306,7 @@
     unsigned int network_id=0, failures=0;
     std::string classname;
-    orxonox::Identifier *id;
-    std::map<std::string, orxonox::Identifier*>::const_iterator it = orxonox::Factory::getFactoryMapBegin();
-    while(it != orxonox::Factory::getFactoryMapEnd()){
+    Identifier *id;
+    std::map<std::string, Identifier*>::const_iterator it = Factory::getFactoryMapBegin();
+    while(it != Factory::getFactoryMapEnd()){
       id = (*it).second;
       if(id == NULL)
@@ -332,5 +332,5 @@
   void ConnectionManager::disconnectClient(ClientInformation *client){
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_peer_disconnect(client->getPeer(), 0);
       lock.unlock();
Index: /code/trunk/src/network/ConnectionManager.h
===================================================================
--- /code/trunk/src/network/ConnectionManager.h	(revision 2170)
+++ /code/trunk/src/network/ConnectionManager.h	(revision 2171)
@@ -59,5 +59,5 @@
 }
 
-namespace network
+namespace orxonox
 {
     const int NETWORK_PORT = 55556;
Index: /code/trunk/src/network/GamestateClient.cc
===================================================================
--- /code/trunk/src/network/GamestateClient.cc	(revision 2170)
+++ /code/trunk/src/network/GamestateClient.cc	(revision 2171)
@@ -39,5 +39,5 @@
 
 
-namespace network
+namespace orxonox
 {
   struct _NetworkExport GameStateItem{
@@ -94,6 +94,6 @@
   * @return iterator pointing to the next object in the list
   */
-  void GamestateClient::removeObject(orxonox::ObjectList<Synchronisable>::iterator &it) {
-    orxonox::ObjectList<Synchronisable>::iterator temp=it;
+  void GamestateClient::removeObject(ObjectList<Synchronisable>::iterator &it) {
+    ObjectList<Synchronisable>::iterator temp=it;
     ++it;
     delete  *temp;
Index: /code/trunk/src/network/GamestateClient.h
===================================================================
--- /code/trunk/src/network/GamestateClient.h	(revision 2170)
+++ /code/trunk/src/network/GamestateClient.h	(revision 2171)
@@ -50,5 +50,5 @@
 const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
 
-namespace network
+namespace orxonox
 {
   class _NetworkExport GamestateClient: public GamestateHandler
@@ -66,5 +66,5 @@
   private:
     packet::Gamestate *processGamestate(packet::Gamestate *gs);
-    void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
+    void removeObject(ObjectListIterator<Synchronisable> &it);
     void printGamestateMap();
     bool sendAck(unsigned int gamestateID);
Index: /code/trunk/src/network/GamestateHandler.cc
===================================================================
--- /code/trunk/src/network/GamestateHandler.cc	(revision 2170)
+++ /code/trunk/src/network/GamestateHandler.cc	(revision 2171)
@@ -4,5 +4,5 @@
 #include "packet/Packet.h"
 
-namespace network {
+namespace orxonox {
 
 GamestateHandler *GamestateHandler::instance_=0;
@@ -22,3 +22,3 @@
 
 
-}//namespace network
+}//namespace orxonox
Index: /code/trunk/src/network/GamestateHandler.h
===================================================================
--- /code/trunk/src/network/GamestateHandler.h	(revision 2170)
+++ /code/trunk/src/network/GamestateHandler.h	(revision 2171)
@@ -34,5 +34,5 @@
 #include "packet/Chat.h"
 
-namespace network {
+namespace orxonox {
 
 /**
Index: /code/trunk/src/network/GamestateManager.cc
===================================================================
--- /code/trunk/src/network/GamestateManager.cc	(revision 2170)
+++ /code/trunk/src/network/GamestateManager.cc	(revision 2171)
@@ -51,5 +51,5 @@
 #include "Synchronisable.h"
 
-namespace network
+namespace orxonox
 {
   GamestateManager::GamestateManager() {
Index: /code/trunk/src/network/GamestateManager.h
===================================================================
--- /code/trunk/src/network/GamestateManager.h	(revision 2170)
+++ /code/trunk/src/network/GamestateManager.h	(revision 2171)
@@ -47,5 +47,5 @@
 #include "packet/Gamestate.h"
 
-namespace network
+namespace orxonox
 {
 
Index: /code/trunk/src/network/Host.cc
===================================================================
--- /code/trunk/src/network/Host.cc	(revision 2170)
+++ /code/trunk/src/network/Host.cc	(revision 2171)
@@ -34,5 +34,5 @@
 #include "ChatListener.h"
 
-namespace network {
+namespace orxonox {
 
 SetConsoleCommandShortcut(Host, Chat);
@@ -80,5 +80,5 @@
 // }
 
-// bool Host::receiveChat(network::packet::Chat *message, unsigned int clientID){
+// bool Host::receiveChat(packet::Chat *message, unsigned int clientID){
 //   if(instance_)
 //     return instance_->processChat(message, clientID);
@@ -110,5 +110,5 @@
 
 bool Host::incomingChat(const std::string& message, unsigned int playerID){
-  for (orxonox::ObjectList<ChatListener>::iterator it = orxonox::ObjectList<ChatListener>::begin(); it != orxonox::ObjectList<ChatListener>::end(); ++it)
+  for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
     it->incomingChat(message, playerID);
 
@@ -116,3 +116,3 @@
 }
 
-}//namespace network
+}//namespace orxonox
Index: /code/trunk/src/network/Host.h
===================================================================
--- /code/trunk/src/network/Host.h	(revision 2170)
+++ /code/trunk/src/network/Host.h	(revision 2171)
@@ -34,5 +34,5 @@
 #include "packet/Chat.h"
 
-namespace network {
+namespace orxonox {
 
 /**
Index: /code/trunk/src/network/NetworkCallback.h
===================================================================
--- /code/trunk/src/network/NetworkCallback.h	(revision 2170)
+++ /code/trunk/src/network/NetworkCallback.h	(revision 2171)
@@ -4,5 +4,5 @@
 #include "NetworkPrereqs.h"
 
-namespace network{
+namespace orxonox{
   class _NetworkExport NetworkCallbackBase
   {
Index: /code/trunk/src/network/NetworkPrereqs.h
===================================================================
--- /code/trunk/src/network/NetworkPrereqs.h	(revision 2170)
+++ /code/trunk/src/network/NetworkPrereqs.h	(revision 2171)
@@ -59,5 +59,5 @@
 // Forward declarations
 //-----------------------------------------------------------------------
-namespace network
+namespace orxonox
 {
   class Client;
Index: /code/trunk/src/network/PacketBuffer.cc
===================================================================
--- /code/trunk/src/network/PacketBuffer.cc	(revision 2170)
+++ /code/trunk/src/network/PacketBuffer.cc	(revision 2171)
@@ -39,5 +39,5 @@
 #include <boost/thread/mutex.hpp>
 
-namespace network
+namespace orxonox
 {
    boost::recursive_mutex PacketBuffer::mutex_;
@@ -147,3 +147,3 @@
   }
 
-} // namespace network
+} // namespace orxonox
Index: /code/trunk/src/network/PacketBuffer.h
===================================================================
--- /code/trunk/src/network/PacketBuffer.h	(revision 2170)
+++ /code/trunk/src/network/PacketBuffer.h	(revision 2171)
@@ -47,5 +47,5 @@
 #include <boost/thread/recursive_mutex.hpp>
 
-namespace network
+namespace orxonox
 {
   struct _NetworkExport PacketEnvelope{
Index: /code/trunk/src/network/Server.cc
===================================================================
--- /code/trunk/src/network/Server.cc	(revision 2170)
+++ /code/trunk/src/network/Server.cc	(revision 2171)
@@ -60,5 +60,5 @@
 #include "ChatListener.h"
 
-namespace network
+namespace orxonox
 {
   const unsigned int MAX_FAILURES = 20;
@@ -317,5 +317,5 @@
 
     // inform all the listeners
-    orxonox::ObjectList<ClientConnectionListener>::iterator listener = orxonox::ObjectList<ClientConnectionListener>::begin();
+    ObjectList<ClientConnectionListener>::iterator listener = ObjectList<ClientConnectionListener>::begin();
     while(listener){
       listener->clientConnected(newid);
@@ -366,5 +366,5 @@
 
 // inform all the listeners
-    orxonox::ObjectList<ClientConnectionListener>::iterator listener = orxonox::ObjectList<ClientConnectionListener>::begin();
+    ObjectList<ClientConnectionListener>::iterator listener = ObjectList<ClientConnectionListener>::begin();
     while(listener){
       listener->clientDisconnected(client->getID());
@@ -404,5 +404,5 @@
     }
 //    COUT(1) << "Player " << Host::getPlayerID() << ": " << message << std::endl;
-    for (orxonox::ObjectList<ChatListener>::iterator it = orxonox::ObjectList<ChatListener>::begin(); it != orxonox::ObjectList<ChatListener>::end(); ++it)
+    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
       it->incomingChat(message, clientID);
 
Index: /code/trunk/src/network/Server.h
===================================================================
--- /code/trunk/src/network/Server.h	(revision 2170)
+++ /code/trunk/src/network/Server.h	(revision 2171)
@@ -49,5 +49,5 @@
 #include "GamestateManager.h"
 
-namespace network
+namespace orxonox
 {
   const int CLIENTID_SERVER = 0;
Index: /code/trunk/src/network/Synchronisable.cc
===================================================================
--- /code/trunk/src/network/Synchronisable.cc	(revision 2170)
+++ /code/trunk/src/network/Synchronisable.cc	(revision 2171)
@@ -50,5 +50,6 @@
 // #include "core/Identifier.h"
 
-namespace network
+#include "Host.h"
+namespace orxonox
 {
 
@@ -57,5 +58,5 @@
   std::queue<unsigned int> Synchronisable::deletedObjects_;
 
-  int Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
+  uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
 
   /**
@@ -63,12 +64,28 @@
   * Initializes all Variables and sets the right objectID
   */
-  Synchronisable::Synchronisable(orxonox::BaseObject* creator){
+  Synchronisable::Synchronisable(BaseObject* creator){
     RegisterRootObject(Synchronisable);
     static uint32_t idCounter=0;
     objectFrequency_=1;
     objectMode_=0x1; // by default do not send data to server
-    objectID=idCounter++;
+    if ( !Host::running() || ( Host::running() && Host::isServer() ) )
+    {
+      this->objectID = idCounter++; //this is only needed when running a server
+    //add synchronisable to the objectMap
+      objectMap_[this->objectID] = this;
+    }
+    else
+      objectID=OBJECTID_UNKNOWN;
     classID = (unsigned int)-1;
     syncList = new std::list<synchronisableVariable *>;
+
+
+#ifndef NDEBUG
+    ObjectList<Synchronisable>::iterator it;
+    for(it = ObjectList<Synchronisable>::begin(); it!=ObjectList<Synchronisable>::end(); ++it){
+      if( it->getObjectID()==this->objectID )
+        assert(*it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0));
+    }
+#endif
 
     this->creatorID = OBJECTID_UNKNOWN;
@@ -96,8 +113,8 @@
   Synchronisable::~Synchronisable(){
     // delete callback function objects
-    if(!orxonox::Identifier::isCreatingHierarchy()){
+    if(!Identifier::isCreatingHierarchy()){
       for(std::list<synchronisableVariable *>::iterator it = syncList->begin(); it!=syncList->end(); it++)
         delete (*it)->callback;
-      if (this->objectMode_ != 0x0)
+      if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer()))
         deletedObjects_.push(objectID);
 //       COUT(3) << "destruct synchronisable +++" << objectID << " | " << classID << std::endl;
@@ -106,4 +123,8 @@
 //       objectMap_.erase(objectID);
     }
+    std::map<unsigned int, Synchronisable*>::iterator it;
+    it = objectMap_.find(objectID);
+    if (it != objectMap_.end())
+      objectMap_.erase(it);
   }
 
@@ -143,5 +164,5 @@
    * @return pointer to the newly created synchronisable
    */
-  Synchronisable *Synchronisable::fabricate(uint8_t*& mem, int mode)
+  Synchronisable *Synchronisable::fabricate(uint8_t*& mem, uint8_t mode)
   {
     synchronisableHeader *header = (synchronisableHeader *)mem;
@@ -152,10 +173,10 @@
       return 0;
     }
-    
+
     COUT(4) << "fabricating object with id: " << header->objectID << std::endl;
 
-    orxonox::Identifier* id = ClassByID(header->classID);
+    Identifier* id = ClassByID(header->classID);
     assert(id);
-    orxonox::BaseObject* creator = 0;
+    BaseObject* creator = 0;
     if (header->creatorID != OBJECTID_UNKNOWN)
     {
@@ -167,7 +188,8 @@
       }
       else
-        creator = dynamic_cast<orxonox::BaseObject*>(synchronisable_creator);
-    }
-    orxonox::BaseObject *bo = id->fabricate(creator);
+        creator = dynamic_cast<BaseObject*>(synchronisable_creator);
+    }
+    assert(getSynchronisable(header->objectID)==0);   //make sure no object with this id exists
+    BaseObject *bo = id->fabricate(creator);
     assert(bo);
     Synchronisable *no = dynamic_cast<Synchronisable *>(bo);
@@ -214,16 +236,17 @@
    */
   Synchronisable* Synchronisable::getSynchronisable(unsigned int objectID){
-    orxonox::ObjectList<Synchronisable>::iterator it;
-    for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
-      if( it->getObjectID()==objectID )
-           return *it;
+    std::map<unsigned int, Synchronisable*>::iterator it1;
+    it1 = objectMap_.find(objectID);
+    if (it1 != objectMap_.end())
+      return it1->second;
+
+    ObjectList<Synchronisable>::iterator it;
+    for(it = ObjectList<Synchronisable>::begin(); it; ++it){
+      if( it->getObjectID()==objectID ){
+        objectMap_[objectID] = *it;
+        return *it;
+      }
     }
     return NULL;
-
-//     std::map<unsigned int, Synchronisable *>::iterator i = objectMap_.find(objectID);
-//     if(i==objectMap_.end())
-//       return NULL;
-//     assert(i->second->objectID==objectID);
-//     return (*i).second;
   }
 
@@ -234,9 +257,9 @@
   * @param var pointer to the variable
   * @param size size of the datatype the variable consists of
-  * @param t the type of the variable (network::DATA or network::STRING
+  * @param t the type of the variable (DATA or STRING
   * @param mode same as in getData
   * @param cb callback object that should get called, if the value of the variable changes
   */
-  void Synchronisable::registerVar(void *var, int size, variableType t, int mode, NetworkCallbackBase *cb){
+  void Synchronisable::registerVariable(void *var, int size, variableType t, uint8_t mode, NetworkCallbackBase *cb){
     assert( mode==direction::toclient || mode==direction::toserver || mode==direction::serverMaster || mode==direction::clientMaster);
     // create temporary synch.Var struct
@@ -249,6 +272,13 @@
     if( ( mode & direction::bidirectional ) )
     {
-      temp->varBuffer = new uint8_t[size];
-      memcpy(temp->varBuffer, temp->var, size); //now fill the buffer for the first time
+      if(t!=STRING)
+      {
+        temp->varBuffer = new uint8_t[size];
+        memcpy(temp->varBuffer, temp->var, size); //now fill the buffer for the first time
+      }
+      else
+      {
+        temp->varBuffer=new std::string( *static_cast<std::string*>(var) );
+      }
       temp->varReference = 0;
     }
@@ -265,4 +295,21 @@
 #endif
   }
+
+  void Synchronisable::unregisterVariable(void *var){
+    std::list<synchronisableVariable *>::iterator it = syncList->begin();
+    while(it!=syncList->end()){
+      if( (*it)->var == var ){
+        delete *it;
+        syncList->erase(it);
+        return;
+      }
+      else
+        it++;
+    }
+    bool unregistered_nonexistent_variable = false;
+    assert(unregistered_nonexistent_variable); //if we reach this point something went wrong:
+    // the variable has not been registered before
+  }
+
 
   /**
@@ -280,12 +327,12 @@
    * @return true: if !doSync or if everything was successfully saved
    */
-  bool Synchronisable::getData(uint8_t*& mem, unsigned int id, int mode){
+  bool Synchronisable::getData(uint8_t*& mem, unsigned int id, uint8_t mode){
+    if(mode==0x0)
+      mode=state_;
     //if this tick is we dont synchronise, then abort now
-    if(!doSync(id))
+    if(!doSync(id, mode))
       return true;
     //std::cout << "inside getData" << std::endl;
     unsigned int tempsize = 0;
-    if(mode==0x0)
-      mode=state_;
     if(classID==0)
       COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
@@ -307,6 +354,6 @@
     header->classID = this->classID;
     header->dataAvailable = true;
-    tempsize+=sizeof(synchronisableHeader);
-    mem+=sizeof(synchronisableHeader);
+    tempsize += sizeof(synchronisableHeader);
+    mem += sizeof(synchronisableHeader);
     // end copy header
 
@@ -319,25 +366,50 @@
         continue;  // this variable should only be received
       }
+
+      // =========== start bidirectional stuff =============
       // if the variable gets synchronised bidirectional, then add the reference to the bytestream
       if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
       {
+        if( ( ((*i)->mode == direction::serverMaster) && (mode == 0x1) ) || \
+            ( ((*i)->mode == direction::clientMaster) && (mode == 0x2) ) )
+        {
+          // MASTER
+          if((*i)->type==DATA){
+            if( memcmp((*i)->var,(*i)->varBuffer,(*i)->size) != 0 ) //check whether the variable changed during the last tick
+            {
+              ((*i)->varReference)++;   //the variable changed so increase the refnr
+              memcpy((*i)->varBuffer, (*i)->var, (*i)->size); //set the buffer to the new value
+            }
+          }
+          else //STRING
+          {
+            if( *static_cast<std::string*>((*i)->var) != *static_cast<std::string*>((*i)->varBuffer) ) //the string changed
+            {
+              ((*i)->varReference)++;   //the variable changed
+              *static_cast<std::string*>((*i)->varBuffer) = *static_cast<std::string*>((*i)->var);  //now set the buffer to the new value
+            }
+          }
+        }
+        // copy the reference number to the stream
         *(uint8_t*)mem = (*i)->varReference;
         mem += sizeof( (*i)->varReference );
         tempsize += sizeof( (*i)->varReference );
       }
+      // ================== end bidirectional stuff
+
       switch((*i)->type){
         case DATA:
           memcpy( (void *)(mem), (void*)((*i)->var), (*i)->size);
-          mem+=(*i)->size;
-          tempsize+=(*i)->size;
+          mem += (*i)->size;
+          tempsize += (*i)->size;
           break;
         case STRING:
           memcpy( (void *)(mem), (void *)&((*i)->size), sizeof(size_t) );
-          mem+=sizeof(size_t);
+          mem += sizeof(size_t);
           const char *data = ( ( *(std::string *) (*i)->var).c_str());
           memcpy( mem, (void*)data, (*i)->size);
           COUT(5) << "synchronisable: char: " << (const char *)(mem) << " data: " << data << " string: " << *(std::string *)((*i)->var) << std::endl;
-          mem+=(*i)->size;
-          tempsize+=(*i)->size + sizeof(size_t);
+          mem += (*i)->size;
+          tempsize += (*i)->size + sizeof(size_t);
           break;
       }
@@ -354,8 +426,10 @@
    * @return true/false
    */
-  bool Synchronisable::updateData(uint8_t*& mem, int mode, bool forceCallback){
+  bool Synchronisable::updateData(uint8_t*& mem, uint8_t mode, bool forceCallback){
     if(mode==0x0)
       mode=state_;
     std::list<synchronisableVariable *>::iterator i;
+    //assert(objectMode_!=0x0);
+    //assert( (mode ^ objectMode_) != 0);
     if(syncList->empty()){
       COUT(4) << "Synchronisable::updateData syncList is empty" << std::endl;
@@ -367,14 +441,13 @@
     synchronisableHeader *syncHeader = (synchronisableHeader *)mem;
     assert(syncHeader->objectID==this->objectID);
-//    assert(syncHeader->creatorID==this->creatorID);
+    assert(syncHeader->creatorID==this->creatorID);
+    assert(this->classID==syncHeader->classID); //TODO: fix this!!! maybe a problem with the identifier ?
     if(syncHeader->dataAvailable==false){
-      mem+=syncHeader->size;
+      mem += syncHeader->size;
       return true;
     }
 
-    mem+=sizeof(synchronisableHeader);
+    mem += sizeof(synchronisableHeader);
     // stop extract header
-    assert(this->objectID==syncHeader->objectID);
-//    assert(this->classID==syncHeader->classID); //TODO: fix this!!! maybe a problem with the identifier ?
 
     COUT(5) << "Synchronisable: objectID " << syncHeader->objectID << ", classID " << syncHeader->classID << " size: " << syncHeader->size << " synchronising data" << std::endl;
@@ -382,59 +455,85 @@
       if( ((*i)->mode ^ mode) == 0 ){
         COUT(5) << "synchronisable: not updating variable " << std::endl;
+        // if we have a forcecallback then do the callback
         continue;  // this variable should only be set
       }
       COUT(5) << "Synchronisable: element size: " << (*i)->size << " type: " << (*i)->type << std::endl;
       bool callback=false;
+      bool master=false;
+
+      if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
+      {
+        uint8_t refNr = *(uint8_t *)mem;
+        if( ( ((*i)->mode == direction::serverMaster) && (mode == 0x1) ) || \
+            ( ((*i)->mode == direction::clientMaster) && (mode == 0x2) ) )
+        { // MASTER
+          master=true;
+          if( refNr != (*i)->varReference || ( memcmp((*i)->var, (*i)->varBuffer, (*i)->size) != 0 ) )
+          { // DISCARD data
+            if( (*i)->type == DATA )
+            {
+              mem += sizeof((*i)->varReference) + (*i)->size;
+            }
+            else //STRING
+            {
+              mem += sizeof(size_t) + *(size_t *)mem;
+            }
+            if( forceCallback && (*i)->callback)
+              (*i)->callback->call();
+            continue;
+          }//otherwise everything is ok and we update the value
+        }
+        else // SLAVE
+        {
+          if( (*i)->varReference == refNr ){
+            //discard data because it's outdated or not different to what we've got
+            if( (*i)->type == DATA )
+            {
+              mem += sizeof((*i)->varReference) + (*i)->size;
+            }
+            else //STRING
+            {
+              mem += sizeof(size_t) + *(size_t *)mem;
+            }
+            if( forceCallback && (*i)->callback)
+              (*i)->callback->call();
+            continue;
+          }
+          else
+            (*i)->varReference = refNr; //copy the reference value for this variable
+        }
+        mem += sizeof((*i)->varReference);
+      }
+
       switch((*i)->type){
         case DATA:
-          if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
+          if((*i)->callback) // check whether this variable changed (but only if callback was set)
           {
-            if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \
-                  ( mode == 0x2 && (*i)->mode == direction::clientMaster ) )    // if true we are master on this variable
-            {
-              uint8_t refNr = *(uint8_t *)mem;
-              if( refNr != (*i)->varReference )
-              {
-                mem += sizeof((*i)->varReference) + (*i)->size; // the reference for this variable is not recent, discard data
-                break;
-              }
-            }
-            else //we are slave for this variable
-            {
-              (*i)->varReference = *(uint8_t *)mem; //copy the reference value for this variable
-            }
-            mem += sizeof((*i)->varReference);
+            if(memcmp((*i)->var, mem, (*i)->size) != 0)
+              callback=true;
           }
-          if((*i)->callback) // check whether this variable changed (but only if callback was set)
-            if(strncmp((char *)(*i)->var, (char *)mem, (*i)->size)!=0)
-              callback=true;
-          memcpy((void*)(*i)->var, mem, (*i)->size);
-          mem+=(*i)->size;
+          if( master )
+          {
+            if( callback || memcmp((*i)->var, mem, (*i)->size) != 0 )
+              //value changed, so set the buffer to the new value
+              memcpy((*i)->varBuffer, mem, (*i)->size);
+          }
+          memcpy((*i)->var, mem, (*i)->size);
+          mem += (*i)->size;
           break;
         case STRING:
-          if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
+          (*i)->size = *(size_t *)mem;
+          mem += sizeof(size_t);
+
+          if( (*i)->callback) // check whether this string changed
+            if( *static_cast<std::string*>((*i)->var) != std::string((char *)mem) )
+              callback=true;
+          if( master )
           {
-            if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \
-                  ( mode == 0x2 && (*i)->mode == direction::clientMaster ) )    // if true we are master for this variable
-            {
-              uint8_t refNr = *(uint8_t *)mem;
-              mem += sizeof( (*i)->varReference );
-              if( refNr != (*i)->varReference ){
-                mem += sizeof(size_t) + *(size_t *)mem; // the reference for this variable is not recent, discard data
-                break;
-              }
-            }
-            else //we are slave for this variable
-            {
-              (*i)->varReference = *(uint8_t *)mem; //copy the reference value for this variable
-            }
-            mem += sizeof( (*i)->varReference );
+            if( callback || *static_cast<std::string*>((*i)->var) != std::string((char *)mem) )
+              //string changed. set the buffer to the new one
+              *static_cast<std::string*>((*i)->varBuffer)=*static_cast<std::string*>( (void*)(mem+sizeof(size_t)) );
           }
-          (*i)->size = *(size_t *)mem;
-          COUT(5) << "string size: " << (*i)->size << std::endl;
-          mem += sizeof(size_t);
-          if((*i)->callback) // check whether this string changed
-            if( *(std::string *)((*i)->var) != std::string((char *)mem) )
-              callback=true;
+
           *((std::string *)((*i)->var)) = std::string((const char*)mem);
           COUT(5) << "synchronisable: char: " << (const char*)mem << " string: " << std::string((const char*)mem) << std::endl;
@@ -446,4 +545,5 @@
         (*i)->callback->call();
     }
+    assert(mem == data+syncHeader->size);
     return true;
   }
@@ -455,10 +555,10 @@
   * @return amount of bytes
   */
-  uint32_t Synchronisable::getSize(unsigned int id, int mode){
-    if(!doSync(id))
-      return 0;
+  uint32_t Synchronisable::getSize(unsigned int id, uint8_t mode){
     int tsize=sizeof(synchronisableHeader);
     if(mode==0x0)
       mode=state_;
+    if(!doSync(id, mode))
+      return 0;
     std::list<synchronisableVariable *>::iterator i;
     for(i=syncList->begin(); i!=syncList->end(); i++){
@@ -489,10 +589,13 @@
    * @return true/false
    */
-  bool Synchronisable::doSync(unsigned int id){
-    return ( (objectMode_&state_)!=0 && (!syncList->empty() ) );
+  bool Synchronisable::doSync(unsigned int id, uint8_t mode){
+    if(mode==0x0)
+      mode=state_;
+    return ( (objectMode_&mode)!=0 && (!syncList->empty() ) );
   }
 
   bool Synchronisable::doSelection(unsigned int id){
-    return ( id==0 || id%objectFrequency_==objectID%objectFrequency_ ) && ((objectMode_&state_)!=0);
+    return true; //TODO: change this
+    //return ( id==0 || id%objectFrequency_==objectID%objectFrequency_ ) && ((objectMode_&state_)!=0);
   }
 
@@ -510,4 +613,5 @@
   /**
    * This function sets the synchronisation mode of the object
+   * If set to 0x0 variables will not be synchronised at all
    * If set to 0x1 variables will only be synchronised to the client
    * If set to 0x2 variables will only be synchronised to the server
@@ -515,5 +619,5 @@
    * @param mode same as in registerVar
    */
-  void Synchronisable::setObjectMode(int mode){
+  void Synchronisable::setObjectMode(uint8_t mode){
     assert(mode==0x0 || mode==0x1 || mode==0x2 || mode==0x3);
     objectMode_=mode;
Index: /code/trunk/src/network/Synchronisable.h
===================================================================
--- /code/trunk/src/network/Synchronisable.h	(revision 2170)
+++ /code/trunk/src/network/Synchronisable.h	(revision 2171)
@@ -42,9 +42,9 @@
 
 #define REGISTERDATA(varname, ...) \
-    registerVar((void*)&varname, sizeof(varname), network::DATA, __VA_ARGS__)
+    registerVariable((void*)&varname, sizeof(varname), DATA, __VA_ARGS__)
 #define REGISTERSTRING(stringname, ...) \
-    registerVar(&stringname, stringname.length()+1, network::STRING, __VA_ARGS__)
+    registerVariable(&stringname, stringname.length()+1, STRING, __VA_ARGS__)
 
-namespace network
+namespace orxonox
 {
   static const unsigned int OBJECTID_UNKNOWN = (unsigned int)-1;
@@ -62,5 +62,5 @@
   namespace syncmode{
     enum mode{
-      one=0,
+      once=0,
       always=1
     };
@@ -81,6 +81,6 @@
 
   struct _NetworkExport synchronisableVariable{
-    unsigned int size;
-    int mode; // this determines in which direction the variable gets synchronised
+    size_t size;
+    uint8_t mode; // this determines in which direction the variable gets synchronised
     void *var;
     variableType type;
@@ -95,9 +95,8 @@
   * @author Oliver Scheuss
   */
-  class _NetworkExport Synchronisable : virtual public orxonox::OrxonoxClass{
+  class _NetworkExport Synchronisable : virtual public OrxonoxClass{
   public:
     friend class packet::Gamestate;
-    friend class GamestateClient;
-    friend class Server;
+//     friend class Server;
     virtual ~Synchronisable();
 
@@ -106,5 +105,5 @@
     static void setClient(bool b);
 
-    static Synchronisable *fabricate(uint8_t*& mem, int mode=0x0);
+    static Synchronisable *fabricate(uint8_t*& mem, uint8_t mode=0x0);
     static bool deleteObject(unsigned int objectID);
     static Synchronisable *getSynchronisable(unsigned int objectID);
@@ -115,17 +114,18 @@
     inline unsigned int getClassID(){return classID;}
   protected:
-    Synchronisable(orxonox::BaseObject* creator);
-    void registerVar(void *var, int size, variableType t, int mode=1, NetworkCallbackBase *cb=0);
-    void setObjectMode(int mode);
+    Synchronisable(BaseObject* creator);
+    void registerVariable(void *var, int size, variableType t, uint8_t mode=0x1, NetworkCallbackBase *cb=0);
+    void unregisterVariable(void *var);
+    void setObjectMode(uint8_t mode);
     void setObjectFrequency(unsigned int freq){ objectFrequency_ = freq; }
 
 
   private:
-    bool getData(uint8_t*& men, unsigned int id, int mode=0x0);
-    uint32_t getSize(unsigned int id, int mode=0x0);
-    bool updateData(uint8_t*& mem, int mode=0x0, bool forceCallback=false);
+    bool getData(uint8_t*& men, unsigned int id, uint8_t mode=0x0);
+    uint32_t getSize(unsigned int id, uint8_t mode=0x0);
+    bool updateData(uint8_t*& mem, uint8_t mode=0x0, bool forceCallback=false);
     bool isMyData(uint8_t* mem);
     bool doSelection(unsigned int id);
-    bool doSync(unsigned int id);
+    bool doSync(unsigned int id, uint8_t mode=0x0);
 
     unsigned int objectID;
@@ -134,5 +134,5 @@
 
     std::list<synchronisableVariable *> *syncList;
-    static int state_; // detemines wheter we are server (default) or client
+    static uint8_t state_; // detemines wheter we are server (default) or client
     bool backsync_; // if true the variables with mode > 1 will be synchronised to server (client -> server)
     unsigned int objectFrequency_;
Index: /code/trunk/src/network/packet/Acknowledgement.cc
===================================================================
--- /code/trunk/src/network/packet/Acknowledgement.cc	(revision 2170)
+++ /code/trunk/src/network/packet/Acknowledgement.cc	(revision 2171)
@@ -33,10 +33,10 @@
 #include "core/CoreIncludes.h"
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
 #define PACKET_FLAGS_ACK    0
 #define _PACKETID           0
-#define _ACKID              _PACKETID + sizeof(network::packet::ENUM::Type)
+#define _ACKID              _PACKETID + sizeof(packet::ENUM::Type)
   
 Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID )
@@ -74,3 +74,3 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
Index: /code/trunk/src/network/packet/Acknowledgement.h
===================================================================
--- /code/trunk/src/network/packet/Acknowledgement.h	(revision 2170)
+++ /code/trunk/src/network/packet/Acknowledgement.h	(revision 2171)
@@ -33,5 +33,5 @@
 
 
-namespace network {
+namespace orxonox {
 namespace packet {
 /**
@@ -53,5 +53,5 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/network/packet/Chat.cc
===================================================================
--- /code/trunk/src/network/packet/Chat.cc	(revision 2170)
+++ /code/trunk/src/network/packet/Chat.cc	(revision 2171)
@@ -31,5 +31,5 @@
 #include "network/Host.h"
 
-namespace network {
+namespace orxonox {
 namespace packet {
   
@@ -77,3 +77,3 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
Index: /code/trunk/src/network/packet/Chat.h
===================================================================
--- /code/trunk/src/network/packet/Chat.h	(revision 2170)
+++ /code/trunk/src/network/packet/Chat.h	(revision 2171)
@@ -10,5 +10,5 @@
 #include "Packet.h"
 
-namespace network {
+namespace orxonox {
 namespace packet {
 /**
@@ -33,5 +33,5 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/network/packet/ClassID.cc
===================================================================
--- /code/trunk/src/network/packet/ClassID.cc	(revision 2170)
+++ /code/trunk/src/network/packet/ClassID.cc	(revision 2171)
@@ -34,5 +34,5 @@
 #include <assert.h>
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
@@ -68,10 +68,10 @@
 
 unsigned int ClassID::getSize() const{
-  return sizeof(network::packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_;
+  return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_;
 }
 
 bool ClassID::process(){
   COUT(3) << "processing classid: " << getClassID() << " name: " << (const char*)(data_+_CLASSNAME) << std::endl;
-  orxonox::Identifier *id=ClassByID( std::string((const char*)(data_+_CLASSNAME) ));
+  Identifier *id=ClassByID( std::string((const char*)(data_+_CLASSNAME) ));
   if(id==NULL)
     return false;
@@ -86,3 +86,3 @@
 
 } //namespace packet
-}//namespace network
+}//namespace orxonox
Index: /code/trunk/src/network/packet/ClassID.h
===================================================================
--- /code/trunk/src/network/packet/ClassID.h	(revision 2170)
+++ /code/trunk/src/network/packet/ClassID.h	(revision 2171)
@@ -35,5 +35,5 @@
 #include "Packet.h"
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
@@ -59,5 +59,5 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/network/packet/DeleteObjects.cc
===================================================================
--- /code/trunk/src/network/packet/DeleteObjects.cc	(revision 2170)
+++ /code/trunk/src/network/packet/DeleteObjects.cc	(revision 2171)
@@ -34,5 +34,5 @@
 #include <assert.h>
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
@@ -95,3 +95,3 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
Index: /code/trunk/src/network/packet/DeleteObjects.h
===================================================================
--- /code/trunk/src/network/packet/DeleteObjects.h	(revision 2170)
+++ /code/trunk/src/network/packet/DeleteObjects.h	(revision 2171)
@@ -34,5 +34,5 @@
 
 
-namespace network {
+namespace orxonox {
 namespace packet {
 /**
@@ -55,5 +55,5 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/network/packet/Gamestate.cc
===================================================================
--- /code/trunk/src/network/packet/Gamestate.cc	(revision 2170)
+++ /code/trunk/src/network/packet/Gamestate.cc	(revision 2171)
@@ -38,5 +38,5 @@
 
 
-namespace network {
+namespace orxonox {
 
 namespace packet {
@@ -71,9 +71,9 @@
 }
 
-bool Gamestate::collectData(int id, int mode)
-{
-  int tempsize=0, currentsize=0;
+bool Gamestate::collectData(int id, uint8_t mode)
+{
+  unsigned int tempsize=0, currentsize=0;
   assert(data_==0);
-  int size = calcGamestateSize(id, mode);
+  unsigned int size = calcGamestateSize(id, mode);
 
   COUT(4) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
@@ -86,19 +86,16 @@
   }
 
-#ifndef NDEBUG
-  std::list<Synchronisable*> slist;
-  std::list<Synchronisable*>::iterator iit;
-#endif
   //start collect data synchronisable by synchronisable
   uint8_t *mem=data_;
   mem+=sizeof(GamestateHeader);
-  orxonox::ObjectList<Synchronisable>::iterator it;
-  for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
+  ObjectList<Synchronisable>::iterator it;
+  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
     tempsize=it->getSize(id, mode);
 
     if(currentsize+tempsize > size){
+      assert(0); // if we don't use multithreading this part shouldn't be neccessary
       // start allocate additional memory
       COUT(3) << "G.St.Man: need additional memory" << std::endl;
-      orxonox::ObjectList<Synchronisable>::iterator temp = it;
+      ObjectList<Synchronisable>::iterator temp = it;
       int addsize=tempsize;
       while(++temp)
@@ -110,9 +107,4 @@
     }// stop allocate additional memory
 
-#ifndef NDEBUG
-    for(iit=slist.begin(); iit!=slist.end(); iit++)
-      assert((*iit)!=*it);
-    slist.push_back(*it);
-#endif
 
     //if(it->doSelection(id))
@@ -127,5 +119,4 @@
   //start write gamestate header
   HEADER->packetType = ENUM::Gamestate;
-  assert( *(ENUM::Type *)(data_) == ENUM::Gamestate);
   HEADER->datasize = currentsize;
   HEADER->id = id;
@@ -140,5 +131,5 @@
 }
 
-bool Gamestate::spreadData(int mode)
+bool Gamestate::spreadData(uint8_t mode)
 {
   assert(data_);
@@ -147,5 +138,5 @@
   uint8_t *mem=data_+sizeof(GamestateHeader);
     // get the start of the Synchronisable list
-  //orxonox::ObjectList<Synchronisable>::iterator it=orxonox::ObjectList<Synchronisable>::begin();
+  //ObjectList<Synchronisable>::iterator it=ObjectList<Synchronisable>::begin();
   Synchronisable *s;
 
@@ -163,6 +154,4 @@
       bool b = s->updateData(mem, mode);
       assert(b);
-      //if(!s->updateData(mem, mode))
-        //return false;
     }
   }
@@ -367,17 +356,11 @@
     assert(it->second->objectID==oldobjectheader->objectID);
     *newobjectheader = *oldobjectheader;
-    objectOffset=sizeof(uint8_t)+sizeof(bool); //skip the size and the availableData variables in the objectheader
+    objectOffset=sizeof(synchronisableHeader); //skip the size and the availableData variables in the objectheader
     if(it->second->doSelection(HEADER->id)){
-      newobjectheader->dataAvailable=true; //TODO: probably not neccessary
-      while(objectOffset<objectsize){
-        *(newdata + objectOffset)=*(origdata + objectOffset);    // copy the data
-        objectOffset++;
-      }
+      assert(newobjectheader->dataAvailable==true);
+      memcpy(newdata+objectOffset, origdata+objectOffset, objectsize-objectOffset);
     }else{
       newobjectheader->dataAvailable=false;
-      while(objectOffset<objectsize){
-        *(newdata+objectOffset)=0;    // set to 0
-        objectOffset++;
-      }
+      memset(newdata+objectOffset, 0, objectsize-objectOffset);
       assert(objectOffset==objectsize);
     }
@@ -565,11 +548,11 @@
 
 
-unsigned int Gamestate::calcGamestateSize(unsigned int id, int mode)
-{
-  int size=0;
+unsigned int Gamestate::calcGamestateSize(unsigned int id, uint8_t mode)
+{
+  unsigned int size=0;
     // get the start of the Synchronisable list
-  orxonox::ObjectList<Synchronisable>::iterator it;
+  ObjectList<Synchronisable>::iterator it;
     // get total size of gamestate
-  for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it)
+  for(it = ObjectList<Synchronisable>::begin(); it; ++it)
     size+=it->getSize(id, mode); // size of the actual data of the synchronisable
 //  size+=sizeof(GamestateHeader);
@@ -582,6 +565,6 @@
  * @return iterator pointing to the next object in the list
  */
-  void Gamestate::removeObject(orxonox::ObjectList<Synchronisable>::iterator &it) {
-    orxonox::ObjectList<Synchronisable>::iterator temp=it;
+  void Gamestate::removeObject(ObjectList<Synchronisable>::iterator &it) {
+    ObjectList<Synchronisable>::iterator temp=it;
     ++it;
     delete  *temp;
Index: /code/trunk/src/network/packet/Gamestate.h
===================================================================
--- /code/trunk/src/network/packet/Gamestate.h	(revision 2170)
+++ /code/trunk/src/network/packet/Gamestate.h	(revision 2171)
@@ -40,5 +40,5 @@
 #endif
 
-namespace network {
+namespace orxonox {
 
 namespace packet {
@@ -69,6 +69,6 @@
     ~Gamestate();
 
-    bool collectData(int id, int mode=0x0);
-    bool spreadData(int mode=0x0);
+    bool collectData(int id, uint8_t mode=0x0);
+    bool spreadData( uint8_t mode=0x0);
     int getID();
     bool isDiffed();
@@ -90,6 +90,6 @@
     bool operator ==(packet::Gamestate gs);
   private:
-    unsigned int calcGamestateSize(unsigned int id, int mode=0x0);
-    void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
+    unsigned int calcGamestateSize(unsigned int id, uint8_t mode=0x0);
+    void removeObject(ObjectListIterator<Synchronisable> &it);
     std::map<unsigned int, Synchronisable*> dataMap_;
 };
Index: /code/trunk/src/network/packet/Packet.cc
===================================================================
--- /code/trunk/src/network/packet/Packet.cc	(revision 2170)
+++ /code/trunk/src/network/packet/Packet.cc	(revision 2171)
@@ -46,5 +46,5 @@
 #include "core/CoreIncludes.h"
 
-namespace network{
+namespace orxonox{
 
 namespace packet{
@@ -53,5 +53,6 @@
 #define _PACKETID           0
 
-std::map<ENetPacket *, Packet *> Packet::packetMap_;
+std::map<size_t, Packet *> Packet::packetMap_;
+boost::recursive_mutex Packet::packetMap_mutex;
 
 Packet::Packet(){
@@ -128,4 +129,7 @@
       return false;
     }
+    // Assures we don't create a packet and destroy it right after in another thread
+    // without having a reference in the packetMap_
+    boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
     // We deliver ENet the data address so that it doesn't memcpy everything again.
     // --> We have to delete data_ ourselves!
@@ -134,5 +138,5 @@
     // Add the packet to a global list so we can access it again once enet calls our
     // deletePacket method. We can of course only give a one argument function to the ENet C library.
-    packetMap_[enetPacket_] = this;
+    packetMap_[(size_t)(void*)enetPacket_] = this;
   }
 #ifndef NDEBUG
@@ -153,5 +157,5 @@
 //  ENetPacket *temp = enetPacket_;
 //  enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet
-  network::Host::addPacket( enetPacket_, clientID_);
+  Host::addPacket( enetPacket_, clientID_);
   return true;
 }
@@ -207,11 +211,12 @@
 */
 void Packet::deletePacket(ENetPacket *enetPacket){
+  boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
   // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
-  std::map<ENetPacket*, Packet*>::iterator it = packetMap_.find(enetPacket);
+  std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
   assert(it != packetMap_.end());
   // Make sure we don't delete it again in the destructor
   it->second->enetPacket_ = 0;
   delete it->second;
-  //packetMap_.erase(it);
+  packetMap_.erase(it);
   COUT(4) << "PacketMap size: " << packetMap_.size() << std::endl;
 }
@@ -219,4 +224,4 @@
 } // namespace packet
 
-} // namespace network
-
+} // namespace orxonox
+
Index: /code/trunk/src/network/packet/Packet.h
===================================================================
--- /code/trunk/src/network/packet/Packet.h	(revision 2170)
+++ /code/trunk/src/network/packet/Packet.h	(revision 2171)
@@ -29,12 +29,13 @@
 #define NETWORKPACKET_H
 
-#include "../NetworkPrereqs.h"
+#include "network/NetworkPrereqs.h"
 
 #include <map>
 #include <enet/enet.h>
+#include <boost/thread/recursive_mutex.hpp>
 
 #include "util/Integers.h"
 
-namespace network {
+namespace orxonox {
 
 namespace packet{
@@ -92,5 +93,7 @@
     bool bDataENetAllocated_;
   private:
-    static std::map<ENetPacket *, Packet *> packetMap_;
+    static std::map<size_t, Packet *> packetMap_;
+    //! Static mutex for any packetMap_ access
+    static boost::recursive_mutex packetMap_mutex;
     ENetPacket *enetPacket_;
 };
@@ -98,5 +101,5 @@
 } //namespace packet
 
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/network/packet/Welcome.cc
===================================================================
--- /code/trunk/src/network/packet/Welcome.cc	(revision 2170)
+++ /code/trunk/src/network/packet/Welcome.cc	(revision 2171)
@@ -36,5 +36,5 @@
 #include <assert.h>
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
@@ -70,5 +70,5 @@
 
 unsigned int Welcome::getSize() const{
-  return sizeof(network::packet::ENUM::Type) + 2*sizeof(uint32_t);
+  return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t);
 }
 
@@ -87,3 +87,3 @@
 
 } //namespace packet
-}//namespace network
+}//namespace orxonox
Index: /code/trunk/src/network/packet/Welcome.h
===================================================================
--- /code/trunk/src/network/packet/Welcome.h	(revision 2170)
+++ /code/trunk/src/network/packet/Welcome.h	(revision 2171)
@@ -33,5 +33,5 @@
 #include "Packet.h"
 
-namespace network {
+namespace orxonox {
 namespace packet {
 
@@ -54,5 +54,5 @@
 
 } //namespace packet
-} //namespace network
+} //namespace orxonox
 
 #endif
Index: /code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/CMakeLists.txt	(revision 2170)
+++ /code/trunk/src/orxonox/CMakeLists.txt	(revision 2171)
@@ -4,4 +4,5 @@
   LevelManager.cc
   Main.cc
+  PlayerManager.cc
   Settings.cc
   
Index: /code/trunk/src/orxonox/CameraManager.h
===================================================================
--- /code/trunk/src/orxonox/CameraManager.h	(revision 2170)
+++ /code/trunk/src/orxonox/CameraManager.h	(revision 2171)
@@ -28,5 +28,5 @@
 
  /**
- @file  CameraManager.h
+ @file
  @brief Handles the instances of Camera class
  @author Benjamin Knecht <beni_at_orxonox.net>
Index: /code/trunk/src/orxonox/LevelManager.cc
===================================================================
--- /code/trunk/src/orxonox/LevelManager.cc	(revision 2170)
+++ /code/trunk/src/orxonox/LevelManager.cc	(revision 2171)
@@ -28,10 +28,8 @@
 
 #include "OrxonoxStableHeaders.h"
-
 #include "LevelManager.h"
 
-#include "core/CoreIncludes.h"
-
-#include "objects/infos/Level.h"
+#include "PlayerManager.h"
+#include "objects/Level.h"
 #include "objects/infos/HumanPlayer.h"
 
@@ -42,10 +40,6 @@
     LevelManager::LevelManager()
     {
-        RegisterRootObject(LevelManager);
-
         assert(singletonRef_s == 0);
         singletonRef_s = this;
-
-        this->getConnectedClients();
     }
 
@@ -95,50 +89,7 @@
         {
             this->levels_s.front()->setActive(true);
-            for (std::map<unsigned int, PlayerInfo*>::iterator it = this->clients_.begin(); it != this->clients_.end(); ++it)
+            for (std::map<unsigned int, PlayerInfo*>::const_iterator it = PlayerManager::getInstance().getClients().begin(); it != PlayerManager::getInstance().getClients().end(); ++it)
                 this->levels_s.front()->playerEntered(it->second);
         }
     }
-
-
-    void LevelManager::clientConnected(unsigned int clientID)
-    {
-        COUT(3) << "client connected" << std::endl;
-
-        // create new HumanPlayer instance
-        HumanPlayer* player = new HumanPlayer(0);
-        player->setClientID(clientID);
-
-        // add to clients-map
-        assert(!this->clients_[clientID]);
-        this->clients_[clientID] = player;
-
-        if (this->getActiveLevel())
-            this->getActiveLevel()->playerEntered(player);
-    }
-
-    void LevelManager::clientDisconnected(unsigned int clientID)
-    {
-        COUT(3) << "client disconnected" << std::endl;
-
-        // remove from clients-map
-        PlayerInfo* player = this->clients_[clientID];
-        this->clients_.erase(clientID);
-
-        if (this->getActiveLevel())
-            this->getActiveLevel()->playerLeft(player);
-
-        // delete PlayerInfo instance
-        if (player)
-            delete player;
-    }
-
-
-    PlayerInfo* LevelManager::getClient(unsigned int clientID) const
-    {
-        std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
-        if (it != this->clients_.end())
-            return it->second;
-        else
-            return 0;
-    }
 }
Index: /code/trunk/src/orxonox/LevelManager.h
===================================================================
--- /code/trunk/src/orxonox/LevelManager.h	(revision 2170)
+++ /code/trunk/src/orxonox/LevelManager.h	(revision 2171)
@@ -36,9 +36,7 @@
 #include <cassert>
 
-#include "network/ClientConnectionListener.h"
-
 namespace orxonox
 {
-    class _OrxonoxExport LevelManager : public network::ClientConnectionListener
+    class _OrxonoxExport LevelManager
     {
         public:
@@ -50,8 +48,5 @@
             Level* getActiveLevel();
 
-            PlayerInfo* getClient(unsigned int clientID) const;
-            inline const std::map<unsigned int, PlayerInfo*>& getClients() const
-                { return this->clients_; }
-
+            static LevelManager* getInstancePtr() { return singletonRef_s; }
             static LevelManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
 
@@ -59,12 +54,7 @@
             LevelManager(const LevelManager&);
 
-            void clientConnected(unsigned int clientID);
-            void clientDisconnected(unsigned int clientID);
-
             void activateNextLevel();
 
             std::list<Level*> levels_s;
-            std::map<unsigned int, PlayerInfo*> clients_;
-
             static LevelManager* singletonRef_s;
     };
Index: /code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 2170)
+++ /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 2171)
@@ -82,6 +82,8 @@
     class CameraManager;
     class LevelManager;
+    class PlayerManager;
 
     // objects
+    class Level;
     class Scene;
 
@@ -142,5 +144,4 @@
 
     class Info;
-    class Level;
     class PlayerInfo;
     class HumanPlayer;
Index: /code/trunk/src/orxonox/PlayerManager.cc
===================================================================
--- /code/trunk/src/orxonox/PlayerManager.cc	(revision 2171)
+++ /code/trunk/src/orxonox/PlayerManager.cc	(revision 2171)
@@ -0,0 +1,112 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "PlayerManager.h"
+
+#include "LevelManager.h"
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "objects/Level.h"
+#include "objects/infos/HumanPlayer.h"
+
+namespace orxonox
+{
+    PlayerManager::PlayerManager()
+    {
+        RegisterRootObject(PlayerManager);
+
+        this->getConnectedClients();
+    }
+
+    PlayerManager::~PlayerManager()
+    {
+    }
+
+    PlayerManager& PlayerManager::getInstance()
+    {
+        static PlayerManager instance;
+        return instance;
+    }
+
+    void PlayerManager::clientConnected(unsigned int clientID)
+    {
+        if (Core::isMaster())
+        {
+            COUT(3) << "client connected" << std::endl;
+
+            // create new HumanPlayer instance
+            HumanPlayer* player = new HumanPlayer(0);
+            player->setClientID(clientID);
+
+            // add to clients-map
+            assert(!this->clients_[clientID]);
+            this->clients_[clientID] = player;
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerEntered(player);
+        }
+    }
+
+    void PlayerManager::clientDisconnected(unsigned int clientID)
+    {
+        if (Core::isMaster())
+        {
+            COUT(3) << "client disconnected" << std::endl;
+
+            // remove from clients-map
+            PlayerInfo* player = this->clients_[clientID];
+            this->clients_.erase(clientID);
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerLeft(player);
+
+            // delete PlayerInfo instance
+            if (player)
+                delete player;
+        }
+    }
+
+
+    PlayerInfo* PlayerManager::getClient(unsigned int clientID) const
+    {
+        if (Core::isMaster())
+        {
+            std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
+            if (it != this->clients_.end())
+                return it->second;
+        }
+        else
+        {
+            for (ObjectList<PlayerInfo>::iterator it = ObjectList<PlayerInfo>::begin(); it != ObjectList<PlayerInfo>::end(); ++it)
+                if (it->getClientID() == clientID)
+                    return (*it);
+        }
+        return 0;
+    }
+}
Index: /code/trunk/src/orxonox/PlayerManager.h
===================================================================
--- /code/trunk/src/orxonox/PlayerManager.h	(revision 2171)
+++ /code/trunk/src/orxonox/PlayerManager.h	(revision 2171)
@@ -0,0 +1,59 @@
+/*
+ *   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 _PlayerManager_H__
+#define _PlayerManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include "network/ClientConnectionListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PlayerManager : public ClientConnectionListener
+    {
+        public:
+            PlayerManager();
+            virtual ~PlayerManager();
+
+            static PlayerManager& getInstance();
+
+            PlayerInfo* getClient(unsigned int clientID) const;
+            inline const std::map<unsigned int, PlayerInfo*>& getClients() const
+                { return this->clients_; }
+
+        private:
+            void clientConnected(unsigned int clientID);
+            void clientDisconnected(unsigned int clientID);
+
+            std::map<unsigned int, PlayerInfo*> clients_;
+    };
+}
+
+#endif /* _PlayerManager_H__ */
Index: /code/trunk/src/orxonox/Settings.h
===================================================================
--- /code/trunk/src/orxonox/Settings.h	(revision 2170)
+++ /code/trunk/src/orxonox/Settings.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Core.h
+    @file
     @brief Declaration of the Settings class.
 
Index: /code/trunk/src/orxonox/gamestates/GSClient.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 2171)
@@ -53,5 +53,5 @@
         Core::setIsClient(true);
 
-        this->client_ = new network::Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
+        this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
 
         if(!client_->establishConnection())
Index: /code/trunk/src/orxonox/gamestates/GSClient.h
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSClient.h	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSClient.h	(revision 2171)
@@ -49,5 +49,5 @@
         void ticked(const Clock& time);
 
-        network::Client* client_;
+        Client* client_;
     };
 }
Index: /code/trunk/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSDedicated.cc	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSDedicated.cc	(revision 2171)
@@ -32,5 +32,7 @@
 #include "core/CommandLine.h"
 #include "core/Core.h"
+#include "core/Iterator.h"
 #include "network/Server.h"
+#include "objects/Tickable.h"
 
 namespace orxonox
@@ -50,5 +52,5 @@
         Core::setHasServer(true);
 
-        this->server_ = new network::Server(CommandLine::getValue("port"));
+        this->server_ = new Server(CommandLine::getValue("port"));
         COUT(0) << "Loading scene in server mode" << std::endl;
 
Index: /code/trunk/src/orxonox/gamestates/GSDedicated.h
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSDedicated.h	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSDedicated.h	(revision 2171)
@@ -48,5 +48,5 @@
         void ticked(const Clock& time);
 
-        network::Server*      server_;
+        Server*      server_;
     };
 }
Index: /code/trunk/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 2171)
@@ -56,5 +56,4 @@
 #include "gui/GUIManager.h"
 #include "tools/WindowEventListener.h"
-#include "objects/Tickable.h"
 #include "Settings.h"
 
@@ -242,10 +241,4 @@
         this->tickChild(time);
 
-        /*** HACK *** HACK ***/
-        // Call the Tickable objects
-        for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
-            it->tick(time.getDeltaTime());
-        /*** HACK *** HACK ***/
-
         if (this->bWindowEventListenerUpdateRequired_)
         {
Index: /code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2171)
@@ -41,4 +41,5 @@
 #include "core/TclThreadManager.h"
 #include "tools/Timer.h"
+#include "objects/Tickable.h"
 #include "Settings.h"
 
@@ -143,4 +144,10 @@
             it->tick(time);
 
+        /*** HACK *** HACK ***/
+        // Call the Tickable objects
+        for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
+            it->tick(time.getDeltaTime());
+        /*** HACK *** HACK ***/
+
         this->tickChild(time);
     }
Index: /code/trunk/src/orxonox/gamestates/GSServer.cc
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSServer.cc	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSServer.cc	(revision 2171)
@@ -52,5 +52,5 @@
         Core::setHasServer(true);
 
-        this->server_ = new network::Server(CommandLine::getValue("port"));
+        this->server_ = new Server(CommandLine::getValue("port"));
         COUT(0) << "Loading scene in server mode" << std::endl;
 
Index: /code/trunk/src/orxonox/gamestates/GSServer.h
===================================================================
--- /code/trunk/src/orxonox/gamestates/GSServer.h	(revision 2170)
+++ /code/trunk/src/orxonox/gamestates/GSServer.h	(revision 2171)
@@ -48,5 +48,5 @@
         void ticked(const Clock& time);
 
-        network::Server*      server_;
+        Server*      server_;
     };
 }
Index: /code/trunk/src/orxonox/objects/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 2170)
+++ /code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 2171)
@@ -3,4 +3,5 @@
   EventDispatcher.cc
   EventTarget.cc
+  Level.cc
   Radar.cc
   RadarListener.cc
Index: /code/trunk/src/orxonox/objects/Level.cc
===================================================================
--- /code/trunk/src/orxonox/objects/Level.cc	(revision 2171)
+++ /code/trunk/src/orxonox/objects/Level.cc	(revision 2171)
@@ -0,0 +1,152 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Level.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/Loader.h"
+#include "core/XMLFile.h"
+#include "core/Template.h"
+
+#include "Settings.h"
+#include "LevelManager.h"
+#include "objects/infos/PlayerInfo.h"
+#include "objects/gametypes/Gametype.h"
+#include "overlays/OverlayGroup.h"
+
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(Level);
+
+    Level::Level(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(Level);
+
+        this->registerVariables();
+        this->xmlfilename_ = this->getFilename();
+
+        if (this->xmlfilename_.length() >= Settings::getDataPath().length())
+            this->xmlfilename_ = this->xmlfilename_.substr(Settings::getDataPath().length());
+    }
+
+    Level::~Level()
+    {
+        if (this->isInitialized())
+        {
+            if (LevelManager::getInstancePtr())
+                LevelManager::getInstance().releaseActivity(this);
+
+            if (this->xmlfile_)
+                Loader::unload(this->xmlfile_);
+        }
+    }
+
+    void Level::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Level, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
+        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
+
+        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+    }
+
+    void Level::registerVariables()
+    {
+        REGISTERSTRING(this->xmlfilename_, direction::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
+        REGISTERSTRING(this->name_,        direction::toclient, new NetworkCallback<Level>(this, &Level::changedName));
+        REGISTERSTRING(this->description_, direction::toclient);
+    }
+
+    void Level::networkcallback_applyXMLFile()
+    {
+        COUT(0) << "Loading level \"" << this->xmlfilename_ << "\"..." << std::endl;
+
+        ClassTreeMask mask;
+        mask.exclude(Class(BaseObject));
+        mask.include(Class(Template));
+        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
+
+        this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
+
+        Loader::open(this->xmlfile_);
+    }
+
+    void Level::setGametypeString(const std::string& gametype)
+    {
+        Identifier* identifier = ClassByString(gametype);
+        if (identifier && identifier->isA(Class(Gametype)))
+        {
+            this->gametype_ = gametype;
+
+            Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
+            this->setGametype(rootgametype);
+
+            for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+                (*it)->setGametype(rootgametype);
+
+            if (LevelManager::getInstancePtr())
+                LevelManager::getInstance().requestActivity(this);
+        }
+    }
+
+
+    void Level::addObject(BaseObject* object)
+    {
+        this->objects_.push_back(object);
+        object->setGametype(this->getGametype());
+    }
+
+    BaseObject* Level::getObject(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    void Level::playerEntered(PlayerInfo* player)
+    {
+        COUT(3) << "player entered level" << std::endl;
+        player->setGametype(this->getGametype());
+    }
+
+    void Level::playerLeft(PlayerInfo* player)
+    {
+        COUT(3) << "player left level" << std::endl;
+        player->setGametype(0);
+    }
+}
Index: /code/trunk/src/orxonox/objects/Level.h
===================================================================
--- /code/trunk/src/orxonox/objects/Level.h	(revision 2171)
+++ /code/trunk/src/orxonox/objects/Level.h	(revision 2171)
@@ -0,0 +1,74 @@
+/*
+ *   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 _Level_H__
+#define _Level_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "network/Synchronisable.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Level : public BaseObject, public Synchronisable
+    {
+        public:
+            Level(BaseObject* creator);
+            virtual ~Level();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline void setDescription(const std::string& description)
+                { this->description_ = description; }
+            inline const std::string& getDescription() const
+                { return this->description_; }
+
+            void playerEntered(PlayerInfo* player);
+            void playerLeft(PlayerInfo* player);
+
+        private:
+            void addObject(BaseObject* object);
+            BaseObject* getObject(unsigned int index) const;
+
+            void setGametypeString(const std::string& gametype);
+            inline const std::string& getGametypeString() const
+                { return this->gametype_; }
+
+            void networkcallback_applyXMLFile();
+
+            std::string            description_;
+            std::string            gametype_;
+            std::string            xmlfilename_;
+            XMLFile*               xmlfile_;
+            std::list<BaseObject*> objects_;
+    };
+}
+
+#endif /* _Level_H__ */
Index: /code/trunk/src/orxonox/objects/Scene.cc
===================================================================
--- /code/trunk/src/orxonox/objects/Scene.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/Scene.cc	(revision 2171)
@@ -43,5 +43,5 @@
     CreateFactory(Scene);
 
-    Scene::Scene(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    Scene::Scene(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     {
         RegisterObject(Scene);
@@ -114,6 +114,6 @@
     void Scene::registerVariables()
     {
-        REGISTERSTRING(this->skybox_,     network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
-        REGISTERDATA(this->ambientLight_, network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
+        REGISTERSTRING(this->skybox_,     direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
+        REGISTERDATA(this->ambientLight_, direction::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
     }
 
@@ -164,3 +164,12 @@
         return 0;
     }
+
+    void Scene::tick(float dt)
+    {
+        if (!Core::showsGraphics())
+        {
+            // We need to update the scene nodes if we don't render
+            this->rootSceneNode_->_update(true, false);
+        }
+    }
 }
Index: /code/trunk/src/orxonox/objects/Scene.h
===================================================================
--- /code/trunk/src/orxonox/objects/Scene.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/Scene.h	(revision 2171)
@@ -35,8 +35,9 @@
 #include "core/BaseObject.h"
 #include "util/Math.h"
+#include "objects/Tickable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Scene : public BaseObject, public network::Synchronisable
+    class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable
     {
         public:
@@ -64,4 +65,6 @@
                 { return this->bShadows_; }
 
+            virtual void tick(float dt);
+
         private:
             void addObject(BaseObject* object);
Index: /code/trunk/src/orxonox/objects/Test.cc
===================================================================
--- /code/trunk/src/orxonox/objects/Test.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/Test.cc	(revision 2171)
@@ -30,4 +30,5 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
+#include "core/ConsoleCommand.h"
 #include "Test.h"
 
@@ -35,10 +36,19 @@
 {
 	CreateFactory ( Test );
+  
+  SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
+  
+  Test* Test::instance_ = 0;
 
-	Test::Test(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+	Test::Test(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
 	{
+    assert(instance_==0);
+    instance_=this;
 		RegisterObject ( Test );
-                setConfigValues();
-                registerVariables();
+    setConfigValues();
+    registerVariables();
 		setObjectMode(0x3);
 	}
@@ -46,12 +56,13 @@
 	Test::~Test()
 	{
-
+    instance_=0;
 	}
 
 	void Test::setConfigValues()
 	{
-		SetConfigValue ( v1, 1 ).callback ( this, &Test::checkV1 );
-                SetConfigValue ( v2, 2 ).callback ( this, &Test::checkV2 );
-                SetConfigValue ( v3, 3 ).callback ( this, &Test::checkV3 );
+		SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/;
+    SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/;
+    SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/;
+    SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/;
 	}
 
@@ -59,20 +70,25 @@
 	void Test::registerVariables()
 	{
-		REGISTERDATA ( v1,network::direction::toclient, new network::NetworkCallback<Test> ( this, &Test::checkV1 ) );
-                REGISTERDATA ( v2,network::direction::toserver, new network::NetworkCallback<Test> ( this, &Test::checkV2 ) );
-		REGISTERDATA ( v3,network::direction::bidirectional, new network::NetworkCallback<Test> ( this, &Test::checkV3 ) );
+		REGISTERDATA ( v1,direction::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 ) );
+    REGISTERDATA ( v2,direction::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 ) );
+		REGISTERDATA ( v3,direction::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ) );
+    REGISTERDATA ( v4,direction::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ) );
 	}
 
-        void Test::checkV1(){
-                COUT(1) << "V1 changed: " << v1 << std::endl;
-        }
+  void Test::checkV1(){
+    COUT(1) << "V1 changed: " << v1 << std::endl;
+  }
 
-        void Test::checkV2(){
-                COUT(1) << "V2 changed: " << v2 << std::endl;
-        }
+  void Test::checkV2(){
+    COUT(1) << "V2 changed: " << v2 << std::endl;
+  }
 
-        void Test::checkV3(){
-                COUT(1) << "V3 changed: " << v3 << std::endl;
-        }
+  void Test::checkV3(){
+    COUT(1) << "V3 changed: " << v3 << std::endl;
+  }
+  
+  void Test::checkV4(){
+    COUT(1) << "V4 changed: " << v4 << std::endl;
+  }
 
 
Index: /code/trunk/src/orxonox/objects/Test.h
===================================================================
--- /code/trunk/src/orxonox/objects/Test.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/Test.h	(revision 2171)
@@ -36,5 +36,5 @@
 namespace orxonox
 {
-  class _OrxonoxExport Test: public BaseObject, public network::Synchronisable
+  class _OrxonoxExport Test: public BaseObject, public Synchronisable
   {
     public:
@@ -48,8 +48,15 @@
       void setV2(unsigned int value){ v2 = value; }
       void setV3(unsigned int value){ v3 = value; }
+      void setV4(unsigned int value){ v4 = value; }
 
       void checkV1();
       void checkV2();
       void checkV3();
+      void checkV4();
+      
+      void printV1(){ instance_->checkV1(); }
+      void printV2(){ instance_->checkV2(); }
+      void printV3(){ instance_->checkV3(); }
+      void printV4(){ instance_->checkV4(); }
 
     private:
@@ -57,4 +64,7 @@
       unsigned int v2;
       unsigned int v3;
+      unsigned int v4;
+      
+      static Test* instance_;
   };
 }
Index: /code/trunk/src/orxonox/objects/Tickable.h
===================================================================
--- /code/trunk/src/orxonox/objects/Tickable.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/Tickable.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /*!
-    @file Tickable.h
+    @file
     @brief Declaration of the Tickable interface.
 
Index: /code/trunk/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- /code/trunk/src/orxonox/objects/gametypes/Gametype.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/gametypes/Gametype.cc	(revision 2171)
@@ -67,7 +67,8 @@
         if (!this->bStarted_)
             this->checkStart();
+        else
+            this->spawnDeadPlayersIfRequested();
 
         this->assignDefaultPawnsIfNeeded();
-        this->spawnDeadPlayersIfRequested();
     }
 
@@ -88,14 +89,14 @@
     void Gametype::playerEntered(PlayerInfo* player)
     {
-        this->players_.insert(player);
+        this->players_[player] = PlayerState::Joined;
 
         std::string message = player->getName() + " entered the game";
         COUT(0) << message << std::endl;
-        network::Host::Broadcast(message);
+        Host::Broadcast(message);
     }
 
     void Gametype::playerLeft(PlayerInfo* player)
     {
-        std::set<PlayerInfo*>::iterator it = this->players_.find(player);
+        std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(player);
         if (it != this->players_.end())
         {
@@ -104,5 +105,5 @@
             std::string message = player->getName() + " left the game";
             COUT(0) << message << std::endl;
-            network::Host::Broadcast(message);
+            Host::Broadcast(message);
         }
     }
@@ -124,5 +125,5 @@
                 std::string message = player->getOldName() + " changed name to " + player->getName();
                 COUT(0) << message << std::endl;
-                network::Host::Broadcast(message);
+                Host::Broadcast(message);
             }
         }
@@ -165,11 +166,11 @@
     }
 
-    void Gametype::assignDefaultPawnsIfNeeded() const
-    {
-        for (std::set<PlayerInfo*>::const_iterator it = this->players_.begin(); it != this->players_.end(); ++it)
-        {
-            if (!(*it)->getControllableEntity() && (!(*it)->isReadyToSpawn() || !this->bStarted_))
-            {
-                SpawnPoint* spawn = this->getBestSpawnPoint(*it);
+    void Gametype::assignDefaultPawnsIfNeeded()
+    {
+        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if (!it->first->getControllableEntity() && (!it->first->isReadyToSpawn() || !this->bStarted_))
+            {
+                SpawnPoint* spawn = this->getBestSpawnPoint(it->first);
                 if (spawn)
                 {
@@ -177,5 +178,6 @@
                     ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn);
                     spawn->spawn(entity);
-                    (*it)->startControl(entity);
+                    it->first->startControl(entity);
+                    it->second = PlayerState::Dead;
                 }
                 else
@@ -210,7 +212,7 @@
                 {
                     bool allplayersready = true;
-                    for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+                    for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
                     {
-                        if (!(*it)->isReadyToSpawn())
+                        if (!it->first->isReadyToSpawn())
                             allplayersready = false;
                     }
@@ -227,15 +229,15 @@
     void Gametype::spawnPlayersIfRequested()
     {
-        for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
-            if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
-                this->spawnPlayer(*it);
+        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->first->isReadyToSpawn() || this->bForceSpawn_)
+                this->spawnPlayer(it->first);
     }
 
     void Gametype::spawnDeadPlayersIfRequested()
     {
-        for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
-            if (!(*it)->getControllableEntity())
-                if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
-                    this->spawnPlayer(*it);
+        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->second == PlayerState::Dead)
+                if (it->first->isReadyToSpawn() || this->bForceSpawn_)
+                    this->spawnPlayer(it->first);
     }
 
@@ -246,4 +248,5 @@
         {
             player->startControl(spawnpoint->spawn());
+            this->players_[player] = PlayerState::Alive;
         }
         else
Index: /code/trunk/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- /code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 2171)
@@ -41,4 +41,15 @@
 namespace orxonox
 {
+    namespace PlayerState
+    {
+        enum Enum
+        {
+            Uninitialized,
+            Joined,
+            Alive,
+            Dead
+        };
+    }
+
     class _OrxonoxExport Gametype : public BaseObject, public Tickable
     {
@@ -70,5 +81,5 @@
             virtual void pawnPostSpawn(Pawn* pawn);
 
-            inline const std::set<PlayerInfo*>& getPlayers() const
+            inline const std::map<PlayerInfo*, PlayerState::Enum>& getPlayers() const
                 { return this->players_; }
 
@@ -87,5 +98,5 @@
             void removePlayer(PlayerInfo* player);
 
-            void assignDefaultPawnsIfNeeded() const;
+            void assignDefaultPawnsIfNeeded();
             void checkStart();
             void spawnPlayer(PlayerInfo* player);
@@ -102,5 +113,5 @@
             bool bStartCountdownRunning_;
 
-            std::set<PlayerInfo*> players_;
+            std::map<PlayerInfo*, PlayerState::Enum> players_;
             std::set<SpawnPoint*> spawnpoints_;
             SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
Index: /code/trunk/src/orxonox/objects/infos/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/infos/CMakeLists.txt	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/CMakeLists.txt	(revision 2171)
@@ -1,5 +1,4 @@
 SET( SRC_FILES
   Info.cc
-  Level.cc
   PlayerInfo.cc
   HumanPlayer.cc
Index: /code/trunk/src/orxonox/objects/infos/HumanPlayer.cc
===================================================================
--- /code/trunk/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2171)
@@ -46,6 +46,6 @@
         RegisterObject(HumanPlayer);
 
-        this->server_ready_ = Core::isMaster();
-        this->client_ready_ = false;
+        this->server_initialized_ = Core::isMaster();
+        this->client_initialized_ = false;
 
         this->bHumanPlayer_ = true;
@@ -67,9 +67,9 @@
     void HumanPlayer::registerVariables()
     {
-        REGISTERSTRING(this->synchronize_nick_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
+        REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
 
-        REGISTERDATA(this->clientID_,     network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
-        REGISTERDATA(this->server_ready_, network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_ready));
-        REGISTERDATA(this->client_ready_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_ready));
+        REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
+        REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
+        REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
     }
 
@@ -92,12 +92,12 @@
     void HumanPlayer::networkcallback_clientIDchanged()
     {
-        if (this->clientID_ == network::Host::getPlayerID())
+        if (this->clientID_ == Host::getPlayerID())
         {
             this->bLocalPlayer_ = true;
             this->synchronize_nick_ = this->nick_;
-            this->client_ready_ = true;
+            this->client_initialized_ = true;
 
             if (!Core::isMaster())
-                this->setObjectMode(network::direction::bidirectional);
+                this->setObjectMode(direction::bidirectional);
             else
                 this->setName(this->nick_);
@@ -107,10 +107,10 @@
     }
 
-    void HumanPlayer::networkcallback_server_ready()
+    void HumanPlayer::networkcallback_server_initialized()
     {
-        this->client_ready_ = true;
+        this->client_initialized_ = true;
     }
 
-    void HumanPlayer::networkcallback_client_ready()
+    void HumanPlayer::networkcallback_client_initialized()
     {
         if (this->getGametype())
@@ -118,17 +118,17 @@
     }
 
-    bool HumanPlayer::isReady() const
+    bool HumanPlayer::isInitialized() const
     {
-        return (this->server_ready_ && this->client_ready_);
+        return (this->server_initialized_ && this->client_initialized_);
     }
 
     float HumanPlayer::getPing() const
     {
-        return network::ClientInformation::findClient(this->getClientID())->getRTT();
+        return ClientInformation::findClient(this->getClientID())->getRTT();
     }
 
     float HumanPlayer::getPacketLossRatio() const
     {
-        return network::ClientInformation::findClient(this->getClientID())->getPacketLoss();
+        return ClientInformation::findClient(this->getClientID())->getPacketLoss();
     }
 
Index: /code/trunk/src/orxonox/objects/infos/HumanPlayer.h
===================================================================
--- /code/trunk/src/orxonox/objects/infos/HumanPlayer.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/HumanPlayer.h	(revision 2171)
@@ -47,5 +47,5 @@
             void setConfigValues();
 
-            bool isReady() const;
+            bool isInitialized() const;
             float getPing() const;
             float getPacketLossRatio() const;
@@ -57,11 +57,11 @@
             void networkcallback_changednick();
             void networkcallback_clientIDchanged();
-            void networkcallback_server_ready();
-            void networkcallback_client_ready();
+            void networkcallback_server_initialized();
+            void networkcallback_client_initialized();
 
             std::string nick_;
             std::string synchronize_nick_;
-            bool server_ready_;
-            bool client_ready_;
+            bool server_initialized_;
+            bool client_initialized_;
     };
 }
Index: /code/trunk/src/orxonox/objects/infos/Info.cc
===================================================================
--- /code/trunk/src/orxonox/objects/infos/Info.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/Info.cc	(revision 2171)
@@ -34,5 +34,5 @@
 namespace orxonox
 {
-    Info::Info(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     {
         RegisterObject(Info);
Index: /code/trunk/src/orxonox/objects/infos/Info.h
===================================================================
--- /code/trunk/src/orxonox/objects/infos/Info.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/Info.h	(revision 2171)
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport Info : public BaseObject, public network::Synchronisable
+    class _OrxonoxExport Info : public BaseObject, public Synchronisable
     {
         public:
Index: de/trunk/src/orxonox/objects/infos/Level.cc
===================================================================
--- /code/trunk/src/orxonox/objects/infos/Level.cc	(revision 2170)
+++ 	(revision )
@@ -1,148 +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:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Level.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "core/Loader.h"
-#include "core/XMLFile.h"
-#include "core/Template.h"
-
-#include "Settings.h"
-#include "LevelManager.h"
-#include "PlayerInfo.h"
-#include "objects/gametypes/Gametype.h"
-
-#include "util/Math.h"
-
-namespace orxonox
-{
-    CreateFactory(Level);
-
-    Level::Level(BaseObject* creator) : Info(creator)
-    {
-        RegisterObject(Level);
-
-        this->registerVariables();
-        this->xmlfilename_ = this->getFilename();
-
-        if (this->xmlfilename_.length() >= Settings::getDataPath().length())
-            this->xmlfilename_ = this->xmlfilename_.substr(Settings::getDataPath().length());
-    }
-
-    Level::~Level()
-    {
-        if (this->isInitialized())
-        {
-            LevelManager::getInstance().releaseActivity(this);
-
-            if (this->xmlfile_)
-                Loader::unload(this->xmlfile_);
-        }
-    }
-
-    void Level::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Level, XMLPort, xmlelement, mode);
-
-        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
-        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
-
-        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
-    }
-
-    void Level::registerVariables()
-    {
-        REGISTERSTRING(this->xmlfilename_, network::direction::toclient, new network::NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
-        REGISTERSTRING(this->name_,        network::direction::toclient, new network::NetworkCallback<Level>(this, &Level::changedName));
-        REGISTERSTRING(this->description_, network::direction::toclient);
-    }
-
-    void Level::networkcallback_applyXMLFile()
-    {
-        COUT(0) << "Loading level \"" << this->xmlfilename_ << "\"..." << std::endl;
-
-        ClassTreeMask mask;
-        mask.exclude(Class(BaseObject));
-        mask.include(Class(Template));
-
-        this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
-
-        Loader::open(this->xmlfile_);
-    }
-
-    void Level::setGametypeString(const std::string& gametype)
-    {
-        Identifier* identifier = ClassByString(gametype);
-        if (identifier && identifier->isA(Class(Gametype)))
-        {
-            this->gametype_ = gametype;
-
-            Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
-            this->setGametype(rootgametype);
-
-            for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
-                (*it)->setGametype(rootgametype);
-
-            LevelManager::getInstance().requestActivity(this);
-        }
-    }
-
-
-    void Level::addObject(BaseObject* object)
-    {
-        this->objects_.push_back(object);
-        object->setGametype(this->getGametype());
-    }
-
-    BaseObject* Level::getObject(unsigned int index) const
-    {
-        unsigned int i = 0;
-        for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
-        {
-            if (i == index)
-                return (*it);
-            ++i;
-        }
-        return 0;
-    }
-
-    void Level::playerEntered(PlayerInfo* player)
-    {
-        COUT(3) << "player entered level" << std::endl;
-        player->setGametype(this->getGametype());
-    }
-
-    void Level::playerLeft(PlayerInfo* player)
-    {
-        COUT(3) << "player left level" << std::endl;
-        player->setGametype(0);
-    }
-}
Index: de/trunk/src/orxonox/objects/infos/Level.h
===================================================================
--- /code/trunk/src/orxonox/objects/infos/Level.h	(revision 2170)
+++ 	(revision )
@@ -1,73 +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:
- *      ...
- *
- */
-
-#ifndef _Level_H__
-#define _Level_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "Info.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Level : public Info
-    {
-        public:
-            Level(BaseObject* creator);
-            virtual ~Level();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            void registerVariables();
-
-            inline void setDescription(const std::string& description)
-                { this->description_ = description; }
-            inline const std::string& getDescription() const
-                { return this->description_; }
-
-            void playerEntered(PlayerInfo* player);
-            void playerLeft(PlayerInfo* player);
-
-        private:
-            void addObject(BaseObject* object);
-            BaseObject* getObject(unsigned int index) const;
-
-            void setGametypeString(const std::string& gametype);
-            inline const std::string& getGametypeString() const
-                { return this->gametype_; }
-
-            void networkcallback_applyXMLFile();
-
-            std::string            description_;
-            std::string            gametype_;
-            std::string            xmlfilename_;
-            XMLFile*               xmlfile_;
-            std::list<BaseObject*> objects_;
-    };
-}
-
-#endif /* _Level_H__ */
Index: /code/trunk/src/orxonox/objects/infos/PlayerInfo.cc
===================================================================
--- /code/trunk/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2171)
@@ -42,5 +42,5 @@
         RegisterObject(PlayerInfo);
 
-        this->clientID_ = network::CLIENTID_UNKNOWN;
+        this->clientID_ = CLIENTID_UNKNOWN;
         this->bHumanPlayer_ = false;
         this->bLocalPlayer_ = false;
@@ -48,5 +48,5 @@
         this->controller_ = 0;
         this->controllableEntity_ = 0;
-        this->controllableEntityID_ = network::CLIENTID_UNKNOWN;
+        this->controllableEntityID_ = CLIENTID_UNKNOWN;
 
         this->registerVariables();
@@ -55,5 +55,5 @@
     PlayerInfo::~PlayerInfo()
     {
-        if (this->isInitialized())
+        if (this->BaseObject::isInitialized())
         {
             this->stopControl(this->controllableEntity_);
@@ -69,12 +69,12 @@
     void PlayerInfo::registerVariables()
     {
-        REGISTERSTRING(this->name_,                 network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
-        REGISTERDATA  (this->controllableEntityID_, network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
-        REGISTERDATA  (this->bReadyToSpawn_,        network::direction::toserver);
+        REGISTERSTRING(this->name_,                 direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
+        REGISTERDATA  (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
+        REGISTERDATA  (this->bReadyToSpawn_,        direction::toserver);
     }
 
     void PlayerInfo::changedName()
     {
-        if (this->isReady() && this->getGametype())
+        if (this->isInitialized() && this->getGametype())
             this->getGametype()->playerChangedName(this);
     }
@@ -82,5 +82,5 @@
     void PlayerInfo::changedGametype()
     {
-        if (this->isReady())
+        if (this->isInitialized())
         {
             if (this->getOldGametype())
@@ -126,5 +126,5 @@
         else
         {
-            this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
+            this->controllableEntityID_ = OBJECTID_UNKNOWN;
         }
 
@@ -138,5 +138,5 @@
         {
             this->controllableEntity_ = 0;
-            this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
+            this->controllableEntityID_ = OBJECTID_UNKNOWN;
 
             if (this->controller_)
@@ -150,5 +150,5 @@
     void PlayerInfo::networkcallback_changedcontrollableentityID()
     {
-        if (this->controllableEntityID_ != network::OBJECTID_UNKNOWN)
+        if (this->controllableEntityID_ != OBJECTID_UNKNOWN)
         {
             Synchronisable* temp = Synchronisable::getSynchronisable(this->controllableEntityID_);
Index: /code/trunk/src/orxonox/objects/infos/PlayerInfo.h
===================================================================
--- /code/trunk/src/orxonox/objects/infos/PlayerInfo.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/infos/PlayerInfo.h	(revision 2171)
@@ -55,8 +55,6 @@
             inline unsigned int getClientID() const
                 { return this->clientID_; }
-            inline bool isReadyToSpawn() const
-                { return this->bReadyToSpawn_; }
 
-            virtual bool isReady() const = 0;
+            virtual bool isInitialized() const = 0;
             virtual float getPing() const = 0;
             virtual float getPacketLossRatio() const = 0;
@@ -64,4 +62,6 @@
             inline void setReadyToSpawn(bool bReady)
                 { this->bReadyToSpawn_ = bReady; }
+            inline bool isReadyToSpawn() const
+                { return this->bReadyToSpawn_; }
 
             void startControl(ControllableEntity* entity);
Index: /code/trunk/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 2171)
@@ -64,6 +64,6 @@
     void Billboard::registerVariables()
     {
-        REGISTERSTRING(this->material_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
-        REGISTERDATA  (this->colour_,   network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedColour));
+        REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
+        REGISTERDATA  (this->colour_,   direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
     }
 
@@ -75,5 +75,6 @@
             {
                 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
-                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+                if (this->billboard_.getBillboardSet())
+                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
                 this->billboard_.setVisible(this->isVisible());
             }
@@ -90,5 +91,6 @@
             {
                 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
-                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+                if (this->billboard_.getBillboardSet())
+                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
                 this->billboard_.setVisible(this->isVisible());
             }
Index: /code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2171)
@@ -68,7 +68,7 @@
     void BlinkingBillboard::registerVariables()
     {
-//        REGISTERDATA(this->amplitude_, network::direction::toclient);
-//        REGISTERDATA(this->frequency_, network::direction::toclient);
-//        REGISTERDATA(this->phase_,     network::direction::toclient);
+//        REGISTERDATA(this->amplitude_, direction::toclient);
+//        REGISTERDATA(this->frequency_, direction::toclient);
+//        REGISTERDATA(this->phase_,     direction::toclient);
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/Camera.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Camera.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/Camera.cc	(revision 2171)
@@ -38,4 +38,5 @@
 #include <OgreViewport.h>
 
+#include "util/Exception.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -51,6 +52,6 @@
         RegisterObject(Camera);
 
-        assert(this->getScene());
-        assert(this->getScene()->getSceneManager());
+        if (!this->getScene() || !this->getScene()->getSceneManager())
+            ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");
 
         this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
Index: /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2171)
@@ -52,5 +52,5 @@
         this->client_overwrite_ = 0;
         this->player_ = 0;
-        this->playerID_ = network::OBJECTID_UNKNOWN;
+        this->playerID_ = OBJECTID_UNKNOWN;
         this->hud_ = 0;
         this->camera_ = 0;
@@ -165,5 +165,5 @@
                 this->client_overwrite_ = this->server_overwrite_;
 COUT(0) << "CE: bidirectional synchronization" << std::endl;
-                this->setObjectMode(network::direction::bidirectional);
+                this->setObjectMode(direction::bidirectional);
             }
         }
@@ -176,7 +176,7 @@
 
         this->player_ = 0;
-        this->playerID_ = network::OBJECTID_UNKNOWN;
+        this->playerID_ = OBJECTID_UNKNOWN;
         this->bControlled_ = false;
-        this->setObjectMode(network::direction::toclient);
+        this->setObjectMode(direction::toclient);
 
         if (this->bDestroyWhenPlayerLeft_)
@@ -187,7 +187,7 @@
     {
         // just do this in case the entity wasn't yet synchronized when the corresponding PlayerInfo got our objectID
-        if (this->playerID_ != network::OBJECTID_UNKNOWN)
-        {
-            this->player_ = dynamic_cast<PlayerInfo*>(network::Synchronisable::getSynchronisable(this->playerID_));
+        if (this->playerID_ != OBJECTID_UNKNOWN)
+        {
+            this->player_ = dynamic_cast<PlayerInfo*>(Synchronisable::getSynchronisable(this->playerID_));
             if (this->player_ && (this->player_->getControllableEntity() != this))
                 this->player_->startControl(this);
@@ -248,19 +248,19 @@
     void ControllableEntity::registerVariables()
     {
-        REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient);
-
-        REGISTERDATA(this->server_position_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
-        REGISTERDATA(this->server_velocity_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
-        REGISTERDATA(this->server_orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
-
-        REGISTERDATA(this->server_overwrite_,   network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
-        REGISTERDATA(this->client_overwrite_,   network::direction::toserver);
-
-        REGISTERDATA(this->client_position_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
-        REGISTERDATA(this->client_velocity_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
-        REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
-
-
-        REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
+        REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient);
+
+        REGISTERDATA(this->client_overwrite_,   direction::toserver);
+        
+        REGISTERDATA(this->server_position_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
+        REGISTERDATA(this->server_velocity_,    direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
+        REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
+        REGISTERDATA(this->server_overwrite_,   direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
+
+        REGISTERDATA(this->client_position_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
+        REGISTERDATA(this->client_velocity_,    direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
+        REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
+
+
+        REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Light.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/Light.cc	(revision 2171)
@@ -79,8 +79,8 @@
     void Light::registerVariables()
     {
-        REGISTERDATA(this->type_, network::direction::toclient, new network::NetworkCallback<Light>(this, &Light::changedType));
-        REGISTERDATA(this->light_->getDiffuseColour(), network::direction::toclient);
-        REGISTERDATA(this->light_->getSpecularColour(), network::direction::toclient);
-        REGISTERDATA(this->light_->getDirection(), network::direction::toclient);
+        REGISTERDATA(this->type_, direction::toclient, new NetworkCallback<Light>(this, &Light::changedType));
+        REGISTERDATA(this->light_->getDiffuseColour(), direction::toclient);
+        REGISTERDATA(this->light_->getSpecularColour(), direction::toclient);
+        REGISTERDATA(this->light_->getDirection(), direction::toclient);
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/Model.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Model.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/Model.cc	(revision 2171)
@@ -61,6 +61,6 @@
     void Model::registerVariables()
     {
-        REGISTERSTRING(this->meshSrc_,    network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedMesh));
-        REGISTERDATA(this->bCastShadows_, network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedShadows));
+        REGISTERSTRING(this->meshSrc_,    direction::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
+        REGISTERDATA(this->bCastShadows_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2171)
@@ -84,16 +84,16 @@
     void MovableEntity::registerVariables()
     {
-        REGISTERDATA(this->velocity_.x, network::direction::toclient);
-        REGISTERDATA(this->velocity_.y, network::direction::toclient);
-        REGISTERDATA(this->velocity_.z, network::direction::toclient);
+        REGISTERDATA(this->velocity_.x, direction::toclient);
+        REGISTERDATA(this->velocity_.y, direction::toclient);
+        REGISTERDATA(this->velocity_.z, direction::toclient);
 
-        REGISTERDATA(this->rotationAxis_.x, network::direction::toclient);
-        REGISTERDATA(this->rotationAxis_.y, network::direction::toclient);
-        REGISTERDATA(this->rotationAxis_.z, network::direction::toclient);
+        REGISTERDATA(this->rotationAxis_.x, direction::toclient);
+        REGISTERDATA(this->rotationAxis_.y, direction::toclient);
+        REGISTERDATA(this->rotationAxis_.z, direction::toclient);
 
-        REGISTERDATA(this->rotationRate_, network::direction::toclient);
+        REGISTERDATA(this->rotationRate_, direction::toclient);
 
-        REGISTERDATA(this->overwrite_position_,    network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
-        REGISTERDATA(this->overwrite_orientation_, network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
+        REGISTERDATA(this->overwrite_position_,    direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
+        REGISTERDATA(this->overwrite_orientation_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/MovableEntity.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/MovableEntity.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/MovableEntity.h	(revision 2171)
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public network::ClientConnectionListener
+    class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public ClientConnectionListener
     {
         public:
Index: /code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-* @file ParticleInterface.cc
+* @file
 * @brief class to control praticle effects
 */
@@ -37,4 +37,5 @@
 
 #include "tools/ParticleInterface.h"
+#include "util/Exception.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -49,6 +50,6 @@
         RegisterObject(ParticleEmitter);
 
-        assert(this->getScene());
-        assert(this->getScene()->getSceneManager());
+        if (!this->getScene() || !this->getScene()->getSceneManager())
+            ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");
 
         this->particles_ = 0;
@@ -74,6 +75,6 @@
     void ParticleEmitter::registerVariables()
     {
-        REGISTERSTRING(this->source_, network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
-        REGISTERDATA  (this->LOD_,    network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
+        REGISTERSTRING(this->source_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
+        REGISTERDATA  (this->LOD_,    direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc	(revision 2171)
@@ -48,12 +48,12 @@
     void PositionableEntity::registerVariables()
     {
-        REGISTERDATA(this->getPosition().x, network::direction::toclient);
-        REGISTERDATA(this->getPosition().y, network::direction::toclient);
-        REGISTERDATA(this->getPosition().z, network::direction::toclient);
+        REGISTERDATA(this->getPosition().x, direction::toclient);
+        REGISTERDATA(this->getPosition().y, direction::toclient);
+        REGISTERDATA(this->getPosition().z, direction::toclient);
 
-        REGISTERDATA(this->getOrientation().w, network::direction::toclient);
-        REGISTERDATA(this->getOrientation().x, network::direction::toclient);
-        REGISTERDATA(this->getOrientation().y, network::direction::toclient);
-        REGISTERDATA(this->getOrientation().z, network::direction::toclient);
+        REGISTERDATA(this->getOrientation().w, direction::toclient);
+        REGISTERDATA(this->getOrientation().x, direction::toclient);
+        REGISTERDATA(this->getOrientation().y, direction::toclient);
+        REGISTERDATA(this->getOrientation().z, direction::toclient);
     }
 }
Index: /code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2171)
@@ -36,4 +36,5 @@
 #include "core/XMLPort.h"
 #include "util/Convert.h"
+#include "util/Exception.h"
 
 #include "objects/Scene.h"
@@ -48,15 +49,15 @@
     const Vector3 WorldEntity::UP    = Vector3::UNIT_Y;
 
-    WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     {
         RegisterObject(WorldEntity);
 
-        assert(this->getScene());
-        assert(this->getScene()->getRootSceneNode());
+        if (!this->getScene() || !this->getScene()->getRootSceneNode())
+            ThrowException(AbortLoading, "Can't create WorldEntity, no scene or no root-scenenode given.");
 
         this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
 
         this->parent_ = 0;
-        this->parentID_ = (unsigned int)-1;
+        this->parentID_ = OBJECTID_UNKNOWN;
 
         this->node_->setPosition(Vector3::ZERO);
@@ -95,19 +96,22 @@
     void WorldEntity::registerVariables()
     {
-        REGISTERDATA(this->bActive_,  network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
-        REGISTERDATA(this->bVisible_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
+        REGISTERDATA(this->bActive_,  direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
+        REGISTERDATA(this->bVisible_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
 
-        REGISTERDATA(this->getScale3D().x, network::direction::toclient);
-        REGISTERDATA(this->getScale3D().y, network::direction::toclient);
-        REGISTERDATA(this->getScale3D().z, network::direction::toclient);
+        REGISTERDATA(this->getScale3D().x, direction::toclient);
+        REGISTERDATA(this->getScale3D().y, direction::toclient);
+        REGISTERDATA(this->getScale3D().z, direction::toclient);
 
-        REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
+        REGISTERDATA(this->parentID_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
     }
 
     void WorldEntity::updateParent()
     {
-        WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
-        if (parent)
-            this->attachToParent(parent);
+        if (this->parentID_ != OBJECTID_UNKNOWN)
+        {
+            WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
+            if (parent)
+                this->attachToParent(parent);
+        }
     }
 
@@ -134,5 +138,5 @@
         this->children_.erase(object);
         object->parent_ = 0;
-        object->parentID_ = (unsigned int)-1;
+        object->parentID_ = OBJECTID_UNKNOWN;
 
 //        this->getScene()->getRootSceneNode()->addChild(object->node_);
Index: /code/trunk/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2171)
@@ -42,5 +42,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable
+    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable
     {
         public:
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2171)
@@ -80,6 +80,6 @@
     void Pawn::registerVariables()
     {
-        REGISTERDATA(this->bAlive_, network::direction::toclient);
-        REGISTERDATA(this->health_, network::direction::toclient);
+        REGISTERDATA(this->bAlive_, direction::toclient);
+        REGISTERDATA(this->health_, direction::toclient);
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2171)
@@ -82,10 +82,10 @@
     void SpaceShip::registerVariables()
     {
-        REGISTERDATA(this->maxSpeed_,                network::direction::toclient);
-        REGISTERDATA(this->maxSecondarySpeed_,       network::direction::toclient);
-        REGISTERDATA(this->maxRotation_,             network::direction::toclient);
-        REGISTERDATA(this->translationAcceleration_, network::direction::toclient);
-        REGISTERDATA(this->rotationAcceleration_,    network::direction::toclient);
-        REGISTERDATA(this->translationDamping_,      network::direction::toclient);
+        REGISTERDATA(this->maxSpeed_,                direction::toclient);
+        REGISTERDATA(this->maxSecondarySpeed_,       direction::toclient);
+        REGISTERDATA(this->maxRotation_,             direction::toclient);
+        REGISTERDATA(this->translationAcceleration_, direction::toclient);
+        REGISTERDATA(this->rotationAcceleration_,    direction::toclient);
+        REGISTERDATA(this->translationDamping_,      direction::toclient);
     }
 
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2171)
@@ -62,5 +62,6 @@
         this->greetingFlare_ = new BillboardSet();
         this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
-        this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
+        if (this->greetingFlare_->getBillboardSet())
+            this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
         this->greetingFlare_->setVisible(false);
         this->bGreetingFlareVisible_ = false;
@@ -76,5 +77,6 @@
             if (this->greetingFlare_)
             {
-                this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
+                if (this->greetingFlare_->getBillboardSet())
+                    this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
                 delete this->greetingFlare_;
             }
@@ -84,7 +86,7 @@
     void Spectator::registerVariables()
     {
-        REGISTERDATA(this->bGreetingFlareVisible_, network::direction::toclient, new network::NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
-        REGISTERDATA(this->bGreeting_,             network::direction::toserver, new network::NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
-        REGISTERDATA(this->hudmode_,               network::direction::toclient);
+        REGISTERDATA(this->bGreetingFlareVisible_, direction::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
+        REGISTERDATA(this->bGreeting_,             direction::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
+        REGISTERDATA(this->hudmode_,               direction::toclient);
     }
 
@@ -129,5 +131,5 @@
         ControllableEntity::setPlayer(player);
 
-//        this->setObjectMode(network::direction::toclient);
+//        this->setObjectMode(direction::toclient);
     }
 
@@ -203,5 +205,5 @@
                 {
                     if (this->getGametype()->isStartCountdownRunning())
-                        this->hudmode_ = 2 + 10*ceil(this->getGametype()->getStartCountdown());
+                        this->hudmode_ = 2 + 10*(int)ceil(this->getGametype()->getStartCountdown());
                     else
                         this->hudmode_ = 3;
Index: /code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2170)
+++ /code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2171)
@@ -69,7 +69,9 @@
       this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
       this->debugBillboard_.setVisible(false);
-    }
-
-    this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
+
+      if (this->debugBillboard_.getBillboardSet())
+        this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
+    }
+
     this->setObjectMode(0x0);
   }
@@ -310,5 +312,5 @@
   void Trigger::setBillboardColour(const ColourValue& colour)
   {
-    this->debugBillboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
+    this->debugBillboard_.setColour(colour);
   }
 
Index: /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 2170)
+++ /code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 2171)
@@ -40,5 +40,7 @@
 #include <OgrePanelOverlayElement.h>
 #include "util/Convert.h"
+#include "util/Exception.h"
 #include "util/String.h"
+#include "core/Core.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -58,4 +60,7 @@
     {
         RegisterObject(OrxonoxOverlay);
+
+        if (!Core::showsGraphics())
+            ThrowException(NoGraphics, "Can't create OrxonoxOverlay, graphics engine not initialized");
 
         // add this overlay to the static map of OrxonoxOverlays
Index: /code/trunk/src/orxonox/overlays/hud/ChatOverlay.cc
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/ChatOverlay.cc	(revision 2170)
+++ /code/trunk/src/orxonox/overlays/hud/ChatOverlay.cc	(revision 2171)
@@ -38,5 +38,5 @@
 #include "network/ClientInformation.h"
 
-#include "LevelManager.h"
+#include "PlayerManager.h"
 #include "objects/infos/PlayerInfo.h"
 #include "overlays/console/InGameConsole.h"
@@ -72,9 +72,9 @@
         std::string text;
 
-        if (senderID != network::CLIENTID_UNKNOWN)
+        if (senderID != CLIENTID_UNKNOWN)
         {
             std::string name = "unknown";
 
-            PlayerInfo* player = LevelManager::getInstance().getClient(senderID);
+            PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
             if (player)
                 name = player->getName();
Index: /code/trunk/src/orxonox/overlays/hud/ChatOverlay.h
===================================================================
--- /code/trunk/src/orxonox/overlays/hud/ChatOverlay.h	(revision 2170)
+++ /code/trunk/src/orxonox/overlays/hud/ChatOverlay.h	(revision 2171)
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport ChatOverlay : public OverlayText, public network::ChatListener
+    class _OrxonoxExport ChatOverlay : public OverlayText, public ChatListener
     {
         public:
Index: /code/trunk/src/orxonox/tools/BillboardSet.cc
===================================================================
--- /code/trunk/src/orxonox/tools/BillboardSet.cc	(revision 2170)
+++ /code/trunk/src/orxonox/tools/BillboardSet.cc	(revision 2171)
@@ -36,4 +36,5 @@
 #include <OgreBillboard.h>
 
+#include "core/Core.h"
 #include "util/Convert.h"
 #include "util/String.h"
@@ -70,11 +71,15 @@
         try
         {
-            this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
-            this->billboardSet_->createBillboard(position);
-            this->billboardSet_->setMaterialName(file);
+            if (Core::showsGraphics())
+            {
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_->createBillboard(position);
+                this->billboardSet_->setMaterialName(file);
+            }
         }
         catch (...)
         {
             COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
+            this->billboardSet_ = 0;
         }
 
@@ -89,11 +94,15 @@
         try
         {
-            this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
-            this->billboardSet_->createBillboard(position, colour);
-            this->billboardSet_->setMaterialName(file);
+            if (Core::showsGraphics())
+            {
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_->createBillboard(position, colour);
+                this->billboardSet_->setMaterialName(file);
+            }
         }
         catch (...)
         {
             COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
+            this->billboardSet_ = 0;
         }
 
@@ -105,4 +114,5 @@
         if (this->billboardSet_ && this->scenemanager_)
             this->scenemanager_->destroyBillboardSet(this->billboardSet_);
+        this->billboardSet_ = 0;
     }
 
Index: /code/trunk/src/orxonox/tools/Mesh.cc
===================================================================
--- /code/trunk/src/orxonox/tools/Mesh.cc	(revision 2170)
+++ /code/trunk/src/orxonox/tools/Mesh.cc	(revision 2171)
@@ -73,4 +73,5 @@
             {
                 COUT(1) << "Error: Couln't load mesh \"" << meshsource << "\"" << std::endl;
+                this->entity_ = 0;
             }
         }
Index: /code/trunk/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- /code/trunk/src/orxonox/tools/ParticleInterface.cc	(revision 2170)
+++ /code/trunk/src/orxonox/tools/ParticleInterface.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-* @file ParticleInterface.cc
+* @file
 * @brief class to control praticle effects
 */
@@ -41,4 +41,5 @@
 
 #include "GraphicsEngine.h"
+#include "core/Core.h"
 #include "core/CoreIncludes.h"
 #include "util/Convert.h"
@@ -57,4 +58,5 @@
         this->scenemanager_ = scenemanager;
         this->sceneNode_ = 0;
+        this->particleSystem_ = 0;
 
         this->bEnabled_ = true;
@@ -62,7 +64,18 @@
         this->bAllowedByLOD_ = true;
 
-        this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
-        this->particleSystem_->setSpeedFactor(1.0f);
-        //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
+        if (Core::showsGraphics())
+        {
+            try
+            {
+                this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
+                this->particleSystem_->setSpeedFactor(1.0f);
+//                this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle system \"" << templateName << "\"" << std::endl;
+                this->particleSystem_ = 0;
+            }
+        }
 
         this->setDetailLevel((unsigned int)detaillevel);
@@ -71,7 +84,10 @@
     ParticleInterface::~ParticleInterface()
     {
-        this->particleSystem_->removeAllEmitters();
-        this->detachFromSceneNode();
-        this->scenemanager_->destroyParticleSystem(particleSystem_);
+        if (this->particleSystem_)
+        {
+            this->particleSystem_->removeAllEmitters();
+            this->detachFromSceneNode();
+            this->scenemanager_->destroyParticleSystem(this->particleSystem_);
+        }
     }
 
@@ -81,6 +97,9 @@
             this->detachFromSceneNode();
 
-        this->sceneNode_ = sceneNode;
-        this->sceneNode_->attachObject(this->particleSystem_);
+        if (this->particleSystem_)
+        {
+            this->sceneNode_ = sceneNode;
+            this->sceneNode_->attachObject(this->particleSystem_);
+        }
     }
 
@@ -89,5 +108,6 @@
         if (this->sceneNode_)
         {
-            this->sceneNode_->detachObject(this->particleSystem_);
+            if (this->particleSystem_)
+                this->sceneNode_->detachObject(this->particleSystem_);
             this->sceneNode_ = 0;
         }
@@ -96,5 +116,5 @@
     Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
     {
-        if (this->particleSystem_->getNumEmitters() > 0)
+        if (this->particleSystem_ && this->particleSystem_->getNumEmitters() > 0)
         {
             Ogre::ParticleEmitter* newemitter = this->particleSystem_->addEmitter(this->particleSystem_->getEmitter(0)->getType());
@@ -107,5 +127,5 @@
     Ogre::ParticleEmitter* ParticleInterface::getEmitter(unsigned int emitterNr) const
     {
-        if (emitterNr < this->particleSystem_->getNumEmitters())
+        if (this->particleSystem_ && (emitterNr < this->particleSystem_->getNumEmitters()))
             return this->particleSystem_->getEmitter(emitterNr);
         else
@@ -114,23 +134,30 @@
     void ParticleInterface::removeEmitter(unsigned int emitterNr)
     {
-        if (emitterNr < this->particleSystem_->getNumEmitters())
+        if (this->particleSystem_ && (emitterNr < this->particleSystem_->getNumEmitters()))
             this->particleSystem_->removeEmitter(emitterNr);
     }
     void ParticleInterface::removeAllEmitters()
     {
-        this->particleSystem_->removeAllEmitters();
+        if (this->particleSystem_)
+            this->particleSystem_->removeAllEmitters();
     }
     unsigned int ParticleInterface::getNumEmitters() const
     {
-        return this->particleSystem_->getNumEmitters();
+        if (this->particleSystem_)
+            return this->particleSystem_->getNumEmitters();
+        else
+            return 0;
     }
 
     Ogre::ParticleAffector* ParticleInterface::addAffector(const std::string& name)
     {
-        return this->particleSystem_->addAffector(name);
+        if (this->particleSystem_)
+            return this->particleSystem_->addAffector(name);
+        else
+            return 0;
     }
     Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) const
     {
-        if (affectorNr < this->particleSystem_->getNumAffectors())
+        if (this->particleSystem_ && (affectorNr < this->particleSystem_->getNumAffectors()))
             return this->particleSystem_->getAffector(affectorNr);
         else
@@ -139,14 +166,18 @@
     void ParticleInterface::removeAffector(unsigned int affectorNr)
     {
-        if (affectorNr < this->particleSystem_->getNumAffectors())
+        if (this->particleSystem_ && (affectorNr < this->particleSystem_->getNumAffectors()))
             this->particleSystem_->removeAffector(affectorNr);
     }
     void ParticleInterface::removeAllAffectors()
     {
-        this->particleSystem_->removeAllAffectors();
+        if (this->particleSystem_)
+            this->particleSystem_->removeAllAffectors();
     }
     unsigned int ParticleInterface::getNumAffectors() const
     {
-        return this->particleSystem_->getNumAffectors();
+        if (this->particleSystem_)
+            return this->particleSystem_->getNumAffectors();
+        else
+            return 0;
     }
 
@@ -155,6 +186,7 @@
         this->bEnabled_ = enable;
 
-        for (unsigned int i = 0; i < this->particleSystem_->getNumEmitters(); i++)
-            this->particleSystem_->getEmitter(i)->setEnabled(this->bEnabled_ && this->bAllowedByLOD_);
+        if (this->particleSystem_)
+            for (unsigned int i = 0; i < this->particleSystem_->getNumEmitters(); i++)
+                this->particleSystem_->getEmitter(i)->setEnabled(this->bEnabled_ && this->bAllowedByLOD_);
     }
 
@@ -163,5 +195,6 @@
         this->bVisible_ = visible;
 
-        this->particleSystem_->setVisible(this->bVisible_ && this->bAllowedByLOD_);
+        if (this->particleSystem_)
+            this->particleSystem_->setVisible(this->bVisible_ && this->bAllowedByLOD_);
     }
 
@@ -169,5 +202,6 @@
     {
         this->detaillevel_ = level;
-        this->detailLevelChanged(GraphicsEngine::getInstance().getDetailLevelParticle());
+        if (GraphicsEngine::getInstancePtr())
+            this->detailLevelChanged(GraphicsEngine::getInstance().getDetailLevelParticle());
     }
 
@@ -190,20 +224,32 @@
     void ParticleInterface::setSpeedFactor(float factor)
     {
-        //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
-        this->particleSystem_->setSpeedFactor(1.0f * factor);
+        if (this->particleSystem_)
+        {
+//            this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
+            this->particleSystem_->setSpeedFactor(1.0f * factor);
+        }
     }
     float ParticleInterface::getSpeedFactor() const
     {
-        //return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
-        return (this->particleSystem_->getSpeedFactor() / 1.0f);
+        if (this->particleSystem_)
+        {
+//            return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
+            return (this->particleSystem_->getSpeedFactor() / 1.0f);
+        }
+        else
+            return 1.0f;
     }
 
     bool ParticleInterface::getKeepParticlesInLocalSpace() const
     {
-        return this->particleSystem_->getKeepParticlesInLocalSpace();
+        if (this->particleSystem_)
+            return this->particleSystem_->getKeepParticlesInLocalSpace();
+        else
+            return false;
     }
     void ParticleInterface::setKeepParticlesInLocalSpace(bool keep)
     {
-        this->particleSystem_->setKeepParticlesInLocalSpace(keep);
+        if (this->particleSystem_)
+            this->particleSystem_->setKeepParticlesInLocalSpace(keep);
     }
 }
Index: /code/trunk/src/orxonox/tools/Timer.h
===================================================================
--- /code/trunk/src/orxonox/tools/Timer.h	(revision 2170)
+++ /code/trunk/src/orxonox/tools/Timer.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /*!
-    @file Timer.h
+    @file
     @brief Definition and Implementation of the Timer class.
 
Index: /code/trunk/src/util/CRC32.cc
===================================================================
--- /code/trunk/src/util/CRC32.cc	(revision 2170)
+++ /code/trunk/src/util/CRC32.cc	(revision 2171)
@@ -29,28 +29,31 @@
 #include "CRC32.h"
 
+namespace orxonox
+{
+    void calcCRCBit(uint32_t &crc32, int bit)
+    {
+        int hbit = (crc32 & 0x80000000) ? 1 : 0;
+        if (hbit != bit)
+            crc32 = (crc32 << 1) ^ UTIL_CRC32POLY;
+        else
+            crc32 = crc32 << 1;
+      }
 
-void calcCRCBit(uint32_t &crc32, int bit){
-    int hbit;
+    uint32_t calcCRC(unsigned char *data, unsigned int dataLength)
+    {
+        uint32_t crc32 = 0;
+        for(unsigned int i = 0; i < dataLength; i++)
+        {
+            calcCRCBit(crc32, (data[i] & 0x1) >> 0); // 1st bit
+            calcCRCBit(crc32, (data[i] & 0x2) >> 1); // 2nd bit
+            calcCRCBit(crc32, (data[i] & 0x3) >> 2); // 3rd bit
+            calcCRCBit(crc32, (data[i] & 0x4) >> 3); // 4th bit
+            calcCRCBit(crc32, (data[i] & 0x5) >> 4); // 5th bit
+            calcCRCBit(crc32, (data[i] & 0x6) >> 5); // 6th bit
+            calcCRCBit(crc32, (data[i] & 0x7) >> 6); // 7th bit
+            calcCRCBit(crc32, (data[i] & 0x8) >> 7); // 8th bit
+        }
+        return crc32;
+    }
+}
 
-    hbit=(crc32 & 0x80000000) ? 1 : 0;
-    if (hbit != bit)
-      crc32=(crc32<<1) ^ UTIL_CRC32POLY;
-    else
-      crc32=crc32<<1;
-  }
-
-  uint32_t calcCRC(unsigned char *data, unsigned int dataLength){
-    uint32_t crc32=0;
-    for(unsigned int i=0; i<dataLength; i++){
-      calcCRCBit(crc32, (data[i]&0x1)>>0); // 1st bit
-      calcCRCBit(crc32, (data[i]&0x2)>>1); // 2nd bit
-      calcCRCBit(crc32, (data[i]&0x3)>>2); // 3rd bit
-      calcCRCBit(crc32, (data[i]&0x4)>>3); // 4th bit
-      calcCRCBit(crc32, (data[i]&0x5)>>4); // 5th bit
-      calcCRCBit(crc32, (data[i]&0x6)>>5); // 6th bit
-      calcCRCBit(crc32, (data[i]&0x7)>>6); // 7th bit
-      calcCRCBit(crc32, (data[i]&0x8)>>7); // 8th bit
-    }
-    return crc32;
-  }
-
Index: /code/trunk/src/util/CRC32.h
===================================================================
--- /code/trunk/src/util/CRC32.h	(revision 2170)
+++ /code/trunk/src/util/CRC32.h	(revision 2171)
@@ -34,10 +34,12 @@
 #include "Integers.h"
 
-const unsigned int UTIL_CRC32POLY = 0x04C11DB7; /* CRC-32 Polynom */
+namespace orxonox
+{
+    const unsigned int UTIL_CRC32POLY = 0x04C11DB7; /* CRC-32 Polynom */
 
-_UtilExport void calcCRCBit(uint32_t &crc32, int bit);
+    _UtilExport void calcCRCBit(uint32_t &crc32, int bit);
 
-_UtilExport uint32_t calcCRC(unsigned char *data, unsigned int dataLength);
-
+    _UtilExport uint32_t calcCRC(unsigned char *data, unsigned int dataLength);
+}
 
 #endif /* _Util_CRC_H__ */
Index: /code/trunk/src/util/Clipboard.cc
===================================================================
--- /code/trunk/src/util/Clipboard.cc	(revision 2170)
+++ /code/trunk/src/util/Clipboard.cc	(revision 2171)
@@ -30,5 +30,5 @@
 
 /**
-    @file Clipboard.cc
+    @file
     @brief OS-specific implementations of the clipboard functions.
 */
@@ -37,9 +37,14 @@
 
 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
-    /////////////
-    // Windows //
-    /////////////
-    #include <windows.h>
-    #include "Debug.h"
+
+/////////////
+// Windows //
+/////////////
+
+#include <windows.h>
+#include "Debug.h"
+
+namespace orxonox
+{
 
     /**
@@ -97,9 +102,14 @@
         return "";
     }
-#else
-    /////////////
-    // Default //
-    /////////////
+}
 
+#else /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 */
+
+/////////////
+// Default //
+/////////////
+
+namespace orxonox
+{
     std::string clipboard = ""; //!< Keeps the text of our internal clipboard
 
@@ -123,3 +133,5 @@
         return clipboard;
     }
-#endif
+}
+
+#endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 */
Index: /code/trunk/src/util/Clipboard.h
===================================================================
--- /code/trunk/src/util/Clipboard.h	(revision 2170)
+++ /code/trunk/src/util/Clipboard.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Clipboard.h
+    @file
     @brief Some functions to exchange text between the OS clipboard and Orxonox.
 
@@ -46,8 +46,9 @@
 #include <string>
 
-
-_UtilExport bool toClipboard(const std::string& text);
-_UtilExport std::string fromClipboard();
-
+namespace orxonox
+{
+    _UtilExport bool toClipboard(const std::string& text);
+    _UtilExport std::string fromClipboard();
+}
 
 #endif /* _Clipboard_H__ */
Index: /code/trunk/src/util/Convert.h
===================================================================
--- /code/trunk/src/util/Convert.h	(revision 2170)
+++ /code/trunk/src/util/Convert.h	(revision 2171)
@@ -68,20 +68,23 @@
 #endif
 
-template <class FromType, class ToType>
-class ImplicitConversion
-{
-private:
-    ImplicitConversion(); ImplicitConversion(const ImplicitConversion&); ~ImplicitConversion();
-    // Gets chosen only if there is an implicit conversion from FromType to ToType.
-    static char test(ToType);
-    // Accepts any argument. Why do we not use a template? The reason is that with templates,
-    // the function above is only taken iff it is an exact type match. But since we want to
-    // check for implicit conversion, we have to use the ellipsis.
-    static long long test(...);
-    static FromType object; // helper object to handle private c'tor and d'tor
-public:
-    // test(object) only has 'long long' return type iff the compiler doesn't choose test(...)
-    enum { exists = (sizeof(test(object)) == sizeof(char)) };
-};
+namespace orxonox
+{
+    template <class FromType, class ToType>
+    class ImplicitConversion
+    {
+    private:
+        ImplicitConversion(); ImplicitConversion(const ImplicitConversion&); ~ImplicitConversion();
+        // Gets chosen only if there is an implicit conversion from FromType to ToType.
+        static char test(ToType);
+        // Accepts any argument. Why do we not use a template? The reason is that with templates,
+        // the function above is only taken iff it is an exact type match. But since we want to
+        // check for implicit conversion, we have to use the ellipsis.
+        static long long test(...);
+        static FromType object; // helper object to handle private c'tor and d'tor
+    public:
+        // test(object) only has 'long long' return type iff the compiler doesn't choose test(...)
+        enum { exists = (sizeof(test(object)) == sizeof(char)) };
+    };
+}
 
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
@@ -118,44 +121,47 @@
 */
 
-namespace
-{
-    //! Little template that maps integers to entire types (Alexandrescu 2001)
-    template <int I>
-    struct Int2Type { };
+namespace orxonox
+{
+    namespace
+    {
+        //! Little template that maps integers to entire types (Alexandrescu 2001)
+        template <int I>
+        struct Int2Type { };
+    }
+
+
+    ///////////////////
+    // No Conversion //
+    ///////////////////
+
+    // Default template. No conversion available at all.
+    template <class FromType, class ToType>
+    struct ConverterFallback
+    {
+        static bool convert(ToType* output, const FromType& input)
+        {
+            COUT(2) << "Could not convert value of type " << typeid(FromType).name()
+                    << " to type " << typeid(ToType).name() << std::endl;
+            return false;
+        }
+    };
+
+    // If all else fails, try a dynamic_cast for pointer types.
+    template <class FromType, class ToType>
+    struct ConverterFallback<FromType*, ToType*>
+    {
+        static bool convert(ToType** output, FromType* const input)
+        {
+            ToType* temp = dynamic_cast<ToType*>(input);
+            if (temp)
+            {
+                *output = temp;
+                return true;
+            }
+            else
+                return false;
+        }
+    };
 }
-
-
-///////////////////
-// No Conversion //
-///////////////////
-
-// Default template. No conversion available at all.
-template <class FromType, class ToType>
-struct ConverterFallback
-{
-    static bool convert(ToType* output, const FromType& input)
-    {
-        COUT(2) << "Could not convert value of type " << typeid(FromType).name()
-                << " to type " << typeid(ToType).name() << std::endl;
-        return false;
-    }
-};
-
-// If all else fails, try a dynamic_cast for pointer types.
-template <class FromType, class ToType>
-struct ConverterFallback<FromType*, ToType*>
-{
-    static bool convert(ToType** output, FromType* const input)
-    {
-        ToType* temp = dynamic_cast<ToType*>(input);
-        if (temp)
-        {
-            *output = temp;
-            return true;
-        }
-        else
-            return false;
-    }
-};
 
 
@@ -170,5 +176,5 @@
     static bool convert(ToType* output, const FromType& input)
     {
-        return ConverterFallback<FromType, ToType>::convert(output, input);
+        return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
     }
 };
@@ -185,5 +191,5 @@
     {
         std::string temp;
-        if (ConverterFallback<FromType, std::string>::convert(&temp, input))
+        if (orxonox::ConverterFallback<FromType, std::string>::convert(&temp, input))
         {
             std::operator <<(outstream, temp);
@@ -224,5 +230,5 @@
     inline bool operator >>(std::istream& instream, ToType& output)
     {
-        return ConverterFallback<std::string, ToType>
+        return orxonox::ConverterFallback<std::string, ToType>
             ::convert(&output, static_cast<std::istringstream&>(instream).str());
     }
@@ -247,238 +253,241 @@
 };
 
-
-///////////////////
-// Implicit Cast //
-///////////////////
-
-// implicit cast not possible, try stringstream conversion next
-template <class FromType, class ToType>
-inline bool convertImplicitely(ToType* output, const FromType& input, ::Int2Type<false>)
-{
-    return ConverterStringStream<FromType, ToType>::convert(output, input);
+namespace orxonox
+{
+
+    ///////////////////
+    // Implicit Cast //
+    ///////////////////
+
+    // implicit cast not possible, try stringstream conversion next
+    template <class FromType, class ToType>
+    inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<false>)
+    {
+        return ConverterStringStream<FromType, ToType>::convert(output, input);
+    }
+
+    // We can cast implicitely
+    template <class FromType, class ToType>
+    inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<true>)
+    {
+        (*output) = static_cast<ToType>(input);
+        return true;
+    }
+
+
+    ////////////////////////////////
+    // ConverterExplicit Fallback //
+    ////////////////////////////////
+
+    // Default template if no specialisation is available
+    template <class FromType, class ToType>
+    struct ConverterExplicit
+    {
+        static bool convert(ToType* output, const FromType& input)
+        {
+            // Try implict cast and probe first. If a simple cast is not possible, it will not compile
+            // We therefore have to out source it into another template function
+            const bool probe = ImplicitConversion<FromType, ToType>::exists;
+            return convertImplicitely(output, input, orxonox::Int2Type<probe>());
+        }
+    };
+
+
+    //////////////////////
+    // Public Functions //
+    //////////////////////
+
+    /**
+    @brief
+        Converts any value to any other as long as there exists a conversion.
+        Otherwise, the conversion will generate a runtime warning and return false.
+        For information about the different conversion methods (user defined too), see the section
+        'Actual conversion sequence' in this file above.
+    */
+    template <class FromType, class ToType>
+    inline bool convertValue(ToType* output, const FromType& input)
+    {
+        return ConverterExplicit<FromType, ToType>::convert(output, input);
+    }
+
+    // For compatibility reasons. The same, but with capital ConvertValue
+    template<class FromType, class ToType>
+    inline bool ConvertValue(ToType* output, const FromType& input)
+    {
+        return convertValue(output, input);
+    }
+
+    // Calls convertValue and returns true if the conversion was successful.
+    // Otherwise the fallback is used.
+    /**
+    @brief
+        Converts any value to any other as long as there exists a conversion.
+        Otherwise, the conversion will generate a runtime warning and return false.
+        For information about the different conversion methods (user defined too), see the section
+        'Actual conversion sequence' in this file above.
+        If the conversion doesn't succeed, 'fallback' is written to '*output'.
+    @param fallback
+        A default value that gets written to '*output' if there is no conversion.
+    */
+    template<class FromType, class ToType>
+    inline bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
+    {
+        if (convertValue(output, input))
+            return true;
+        else
+        {
+            (*output) = fallback;
+            return false;
+        }
+    }
+
+    // for compatibility reason. (capital 'c' in ConvertValue)
+    template<class FromType, class ToType>
+    inline bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
+    {
+        return convertValue(output, input, fallback);
+    }
+
+    // Directly returns the converted value, even if the conversion was not successful.
+    template<class FromType, class ToType>
+    inline ToType getConvertedValue(const FromType& input)
+    {
+        ToType output;
+        convertValue(&output, input);
+        return output;
+    }
+
+    // Directly returns the converted value, but uses the fallback on failure.
+    template<class FromType, class ToType>
+    inline ToType getConvertedValue(const FromType& input, const ToType& fallback)
+    {
+        ToType output;
+        convertValue(&output, input, fallback);
+        return output;
+    }
+
+    // Like getConvertedValue, but the template argument order is in reverse.
+    // That means you can call it exactly like static_cast<ToType>(fromTypeValue).
+    template<class ToType, class FromType>
+    inline ToType omni_cast(const FromType& input)
+    {
+        ToType output;
+        convertValue(&output, input);
+        return output;
+    }
+
+    // convert to string Shortcut
+    template <class FromType>
+    inline std::string convertToString(FromType value)
+    {
+      return getConvertedValue<FromType, std::string>(value);
+    }
+
+    // convert from string Shortcut
+    template <class ToType>
+    inline ToType convertFromString(std::string str)
+    {
+      return getConvertedValue<std::string, ToType>(str);
+    }
+
+    ////////////////////////////////
+    // Special string conversions //
+    ////////////////////////////////
+
+    // Delegate conversion from const char* to std::string
+    template <class ToType>
+    struct ConverterExplicit<const char*, ToType>
+    {
+        static bool convert(ToType* output, const char* input)
+        {
+            return convertValue<std::string, ToType>(output, input);
+        }
+    };
+
+    // These conversions would exhibit ambiguous << or >> operators when using stringstream
+    template <>
+    struct ConverterExplicit<char, std::string>
+    {
+        static bool convert(std::string* output, const char input)
+        {
+            *output = std::string(1, input);
+            return true;
+        }
+    };
+    template <>
+    struct ConverterExplicit<unsigned char, std::string>
+    {
+        static bool convert(std::string* output, const unsigned char input)
+        {
+            *output = std::string(1, input);
+            return true;
+        }
+    };
+    template <>
+    struct ConverterExplicit<std::string, char>
+    {
+        static bool convert(char* output, const std::string input)
+        {
+            if (input != "")
+                *output = input[0];
+            else
+                *output = '\0';
+            return true;
+        }
+    };
+    template <>
+    struct ConverterExplicit<std::string, unsigned char>
+    {
+        static bool convert(unsigned char* output, const std::string input)
+        {
+            if (input != "")
+                *output = input[0];
+            else
+                *output = '\0';
+            return true;
+        }
+    };
+
+
+    // bool to std::string
+    template <>
+    struct ConverterExplicit<bool, std::string>
+    {
+        static bool convert(std::string* output, const bool& input)
+        {
+            if (input)
+              *output = "true";
+            else
+              *output = "false";
+            return false;
+        }
+    };
+
+    // std::string to bool
+    template <>
+    struct ConverterExplicit<std::string, bool>
+    {
+        static bool convert(bool* output, const std::string& input)
+        {
+            std::string stripped = getLowercase(removeTrailingWhitespaces(input));
+            if (stripped == "true" || stripped == "on" || stripped == "yes")
+            {
+              *output = true;
+              return true;
+            }
+            else if (stripped == "false" || stripped == "off" || stripped == "no")
+            {
+              *output = false;
+              return true;
+            }
+
+            std::istringstream iss(input);
+            if (iss >> (*output))
+                return true;
+            else
+                return false;
+        }
+    };
 }
 
-// We can cast implicitely
-template <class FromType, class ToType>
-inline bool convertImplicitely(ToType* output, const FromType& input, ::Int2Type<true>)
-{
-    (*output) = static_cast<ToType>(input);
-    return true;
-}
-
-
-////////////////////////////////
-// ConverterExplicit Fallback //
-////////////////////////////////
-
-// Default template if no specialisation is available
-template <class FromType, class ToType>
-struct ConverterExplicit
-{
-    static bool convert(ToType* output, const FromType& input)
-    {
-        // Try implict cast and probe first. If a simple cast is not possible, it will not compile
-        // We therefore have to out source it into another template function
-        const bool probe = ImplicitConversion<FromType, ToType>::exists;
-        return convertImplicitely(output, input, ::Int2Type<probe>());
-    }
-};
-
-
-//////////////////////
-// Public Functions //
-//////////////////////
-
-/**
-@brief
-    Converts any value to any other as long as there exists a conversion.
-    Otherwise, the conversion will generate a runtime warning and return false.
-    For information about the different conversion methods (user defined too), see the section
-    'Actual conversion sequence' in this file above.
-*/
-template <class FromType, class ToType>
-inline bool convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExplicit<FromType, ToType>::convert(output, input);
-}
-
-// For compatibility reasons. The same, but with capital ConvertValue
-template<class FromType, class ToType>
-inline bool ConvertValue(ToType* output, const FromType& input)
-{
-    return convertValue(output, input);
-}
-
-// Calls convertValue and returns true if the conversion was successful.
-// Otherwise the fallback is used.
-/**
-@brief
-    Converts any value to any other as long as there exists a conversion.
-    Otherwise, the conversion will generate a runtime warning and return false.
-    For information about the different conversion methods (user defined too), see the section
-    'Actual conversion sequence' in this file above.
-    If the conversion doesn't succeed, 'fallback' is written to '*output'.
-@param fallback
-    A default value that gets written to '*output' if there is no conversion.
-*/
-template<class FromType, class ToType>
-inline bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
-{
-    if (convertValue(output, input))
-        return true;
-    else
-    {
-        (*output) = fallback;
-        return false;
-    }
-}
-
-// for compatibility reason. (capital 'c' in ConvertValue)
-template<class FromType, class ToType>
-inline bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
-{
-    return convertValue(output, input, fallback);
-}
-
-// Directly returns the converted value, even if the conversion was not successful.
-template<class FromType, class ToType>
-inline ToType getConvertedValue(const FromType& input)
-{
-    ToType output;
-    convertValue(&output, input);
-    return output;
-}
-
-// Directly returns the converted value, but uses the fallback on failure.
-template<class FromType, class ToType>
-inline ToType getConvertedValue(const FromType& input, const ToType& fallback)
-{
-    ToType output;
-    convertValue(&output, input, fallback);
-    return output;
-}
-
-// Like getConvertedValue, but the template argument order is in reverse.
-// That means you can call it exactly like static_cast<ToType>(fromTypeValue).
-template<class ToType, class FromType>
-inline ToType omni_cast(const FromType& input)
-{
-    ToType output;
-    convertValue(&output, input);
-    return output;
-}
-
-// convert to string Shortcut
-template <class FromType>
-inline std::string convertToString(FromType value)
-{
-  return getConvertedValue<FromType, std::string>(value);
-}
-
-// convert from string Shortcut
-template <class ToType>
-inline ToType convertFromString(std::string str)
-{
-  return getConvertedValue<std::string, ToType>(str);
-}
-
-////////////////////////////////
-// Special string conversions //
-////////////////////////////////
-
-// Delegate conversion from const char* to std::string
-template <class ToType>
-struct ConverterExplicit<const char*, ToType>
-{
-    static bool convert(ToType* output, const char* input)
-    {
-        return convertValue<std::string, ToType>(output, input);
-    }
-};
-
-// These conversions would exhibit ambiguous << or >> operators when using stringstream
-template <>
-struct ConverterExplicit<char, std::string>
-{
-    static bool convert(std::string* output, const char input)
-    {
-        *output = std::string(1, input);
-        return true;
-    }
-};
-template <>
-struct ConverterExplicit<unsigned char, std::string>
-{
-    static bool convert(std::string* output, const unsigned char input)
-    {
-        *output = std::string(1, input);
-        return true;
-    }
-};
-template <>
-struct ConverterExplicit<std::string, char>
-{
-    static bool convert(char* output, const std::string input)
-    {
-        if (input != "")
-            *output = input[0];
-        else
-            *output = '\0';
-        return true;
-    }
-};
-template <>
-struct ConverterExplicit<std::string, unsigned char>
-{
-    static bool convert(unsigned char* output, const std::string input)
-    {
-        if (input != "")
-            *output = input[0];
-        else
-            *output = '\0';
-        return true;
-    }
-};
-
-
-// bool to std::string
-template <>
-struct ConverterExplicit<bool, std::string>
-{
-    static bool convert(std::string* output, const bool& input)
-    {
-        if (input)
-          *output = "true";
-        else
-          *output = "false";
-        return false;
-    }
-};
-
-// std::string to bool
-template <>
-struct ConverterExplicit<std::string, bool>
-{
-    static bool convert(bool* output, const std::string& input)
-    {
-        std::string stripped = getLowercase(removeTrailingWhitespaces(input));
-        if (stripped == "true" || stripped == "on" || stripped == "yes")
-        {
-          *output = true;
-          return true;
-        }
-        else if (stripped == "false" || stripped == "off" || stripped == "no")
-        {
-          *output = false;
-          return true;
-        }
-
-        std::istringstream iss(input);
-        if (iss >> (*output))
-            return true;
-        else
-            return false;
-    }
-};
-
 #endif /* _Convert_H__ */
Index: /code/trunk/src/util/Debug.h
===================================================================
--- /code/trunk/src/util/Debug.h	(revision 2170)
+++ /code/trunk/src/util/Debug.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Debug.h
+    @file
     @brief Handles different output-levels of errors, warnings, infos and debug informations.
 
@@ -67,16 +67,15 @@
 #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();
-}
-
 namespace orxonox
 {
+    /**
+        @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 OutputHandler::getSoftDebugLevel();
+    }
+
     using std::endl;
 }
@@ -115,5 +114,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
    #define COUT0 \
-    (getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : COUT_EXEC(0)
+   (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : COUT_EXEC(0)
   #else
    #define COUT0 \
@@ -123,5 +122,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    #define COUT1 \
-    (getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : COUT_EXEC(1)
+    (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : COUT_EXEC(1)
   #else
    #define COUT1 \
@@ -131,5 +130,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
    #define COUT2 \
-    (getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : COUT_EXEC(2)
+    (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : COUT_EXEC(2)
   #else
    #define COUT2 \
@@ -139,5 +138,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
    #define COUT3 \
-    (getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : COUT_EXEC(3)
+    (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : COUT_EXEC(3)
   #else
    #define COUT3 \
@@ -147,5 +146,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
    #define COUT4 \
-    (getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : COUT_EXEC(4)
+    (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : COUT_EXEC(4)
   #else
    #define COUT4 \
@@ -155,5 +154,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
    #define COUT5 \
-    (getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : COUT_EXEC(5)
+    (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : COUT_EXEC(5)
   #else
    #define COUT5 \
@@ -163,5 +162,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
    #define COUT6 \
-    (getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : COUT_EXEC(6)
+    (orxonox::getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : COUT_EXEC(6)
   #else
    #define COUT6 \
@@ -199,5 +198,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
    #define CCOUT0 \
-    (getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : CCOUT_EXEC(0)
+    (orxonox::getSoftDebugLevel() < ORX_NONE) ? COUT_EXEC(0) : CCOUT_EXEC(0)
   #else
    #define CCOUT0 \
@@ -207,5 +206,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    #define CCOUT1 \
-    (getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : CCOUT_EXEC(1)
+    (orxonox::getSoftDebugLevel() < ORX_ERROR) ? COUT_EXEC(1) : CCOUT_EXEC(1)
   #else
    #define CCOUT1 \
@@ -215,5 +214,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
    #define CCOUT2 \
-    (getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : CCOUT_EXEC(2)
+    (orxonox::getSoftDebugLevel() < ORX_WARNING) ? COUT_EXEC(2) : CCOUT_EXEC(2)
   #else
    #define CCOUT2 \
@@ -223,5 +222,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
    #define CCOUT3 \
-    (getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : CCOUT_EXEC(3)
+    (orxonox::getSoftDebugLevel() < ORX_INFO) ? COUT_EXEC(3) : CCOUT_EXEC(3)
   #else
    #define CCOUT3 \
@@ -231,5 +230,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
    #define CCOUT4 \
-    (getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : CCOUT_EXEC(4)
+    (orxonox::getSoftDebugLevel() < ORX_DEBUG) ? COUT_EXEC(4) : CCOUT_EXEC(4)
   #else
    #define CCOUT4 \
@@ -239,5 +238,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_VERBOSE
    #define CCOUT5 \
-    (getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : CCOUT_EXEC(5)
+    (orxonox::getSoftDebugLevel() < ORX_VERBOSE) ? COUT_EXEC(5) : CCOUT_EXEC(5)
   #else
    #define CCOUT5 \
@@ -247,5 +246,5 @@
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ULTRA
    #define CCOUT6 \
-    (getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : CCOUT_EXEC(6)
+    (orxonox::getSoftDebugLevel() < ORX_ULTRA) ? COUT_EXEC(6) : CCOUT_EXEC(6)
   #else
    #define CCOUT6 \
Index: /code/trunk/src/util/Exception.cc
===================================================================
--- /code/trunk/src/util/Exception.cc	(revision 2170)
+++ /code/trunk/src/util/Exception.cc	(revision 2171)
@@ -81,5 +81,3 @@
         return fullDescription_;
     }
-
-
 }
Index: /code/trunk/src/util/Exception.h
===================================================================
--- /code/trunk/src/util/Exception.h	(revision 2170)
+++ /code/trunk/src/util/Exception.h	(revision 2171)
@@ -43,11 +43,4 @@
 #include "Debug.h"
 
-// Define some ugly macros to make things more clear
-#define CREATE_ORXONOX_EXCEPTION(name) typedef SpecificException<Exception::name> name##Exception;
-#define RETURN_EXCEPTION_CODE(name) \
-    case Exception::name:           \
-        return #name;
-
-
 namespace orxonox
 {
@@ -55,14 +48,4 @@
     {
     public:
-        enum ExceptionType
-        {
-            General,
-            FileNotFound,
-            Argument,
-            PluginsNotFound,
-            InitialisationFailed,
-            NotImplemented,
-            GameState
-        };
 
         Exception(const std::string& description, int lineNumber,
@@ -74,5 +57,4 @@
 
         virtual const std::string& getFullDescription() const;
-        virtual ExceptionType      getType()            const = 0;
         virtual std::string        getTypeName()        const = 0;
         virtual const std::string& getDescription()     const { return this->description_; }
@@ -93,45 +75,29 @@
 
 
-    template <Exception::ExceptionType Type>
-    class SpecificException : public Exception
-    {
-    public:
-        SpecificException(const std::string& description, int lineNumber,
-                  const char* filename, const char* functionName)
-                  : Exception(description, lineNumber, filename, functionName)
-        {
-            // let the catcher decide whether to display the message below level 4
-            COUT(4) << this->getFullDescription() << std::endl;
-        }
-
-        SpecificException(const std::string& description)
-            : Exception(description)
-        {
-            // let the catcher decide whether to display the message below level 4
-            COUT(4) << this->getFullDescription() << std::endl;
-        }
-
-        ~SpecificException() throw() { }
-
-        ExceptionType getType() const { return Type; }
-        std::string getTypeName() const
-        {
-            // note: break is not necessary due to the return in the macros.
-            switch (Type)
-            {
-            RETURN_EXCEPTION_CODE(General)
-            RETURN_EXCEPTION_CODE(FileNotFound);
-            RETURN_EXCEPTION_CODE(Argument);
-            RETURN_EXCEPTION_CODE(PluginsNotFound);
-            RETURN_EXCEPTION_CODE(InitialisationFailed);
-            RETURN_EXCEPTION_CODE(NotImplemented);
-            RETURN_EXCEPTION_CODE(GameState);
-            default:
-                return "";
-            }
-        }
+#define CREATE_ORXONOX_EXCEPTION(ExceptionName)                                     \
+    class ExceptionName##Exception : public Exception                               \
+    {                                                                               \
+    public:                                                                         \
+        ExceptionName##Exception(const std::string& description, int lineNumber,    \
+                  const char* filename, const char* functionName)                   \
+                  : Exception(description, lineNumber, filename, functionName)      \
+        {                                                                           \
+            /* Let the catcher decide whether to display the message below level 4  \
+               Note: Don't place this code in Exception c'tor because getTypeName() \
+               is still pure virtual at that time. */                               \
+            COUT(4) << this->getFullDescription() << std::endl;                     \
+        }                                                                           \
+                                                                                    \
+        ExceptionName##Exception(const std::string& description)                    \
+                  : Exception(description)                                          \
+        { COUT(4) << this->getFullDescription() << std::endl; }                     \
+                                                                                    \
+        ~ExceptionName##Exception() throw() { }                                     \
+                                                                                    \
+        std::string getTypeName() const { return #ExceptionName; }                  \
     };
 
-    // define the template spcialisations
+    // Creates all possible exception types.
+    // If you want to add a new type, simply copy and adjust a new line here.
     CREATE_ORXONOX_EXCEPTION(General);
     CREATE_ORXONOX_EXCEPTION(FileNotFound);
@@ -141,18 +107,19 @@
     CREATE_ORXONOX_EXCEPTION(NotImplemented);
     CREATE_ORXONOX_EXCEPTION(GameState);
+    CREATE_ORXONOX_EXCEPTION(NoGraphics);
+    CREATE_ORXONOX_EXCEPTION(AbortLoading);
+}
 
-#define ThrowException(type, description) \
-    throw SpecificException<Exception::type>(description, __LINE__, __FILE__, __FUNCTIONNAME__)
+#define ThrowException(Type, Description) \
+    throw Type##Exception(Description, __LINE__, __FILE__, __FUNCTIONNAME__)
 
     // define an assert macro that can display a message
 #ifndef NDEBUG
-#define OrxAssert(assertion, errorMessage) \
-    assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << errorMessage << std::endl); \
-    assert(assertion)
+#define OrxAssert(Assertion, ErrorMessage) \
+    Assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << ErrorMessage << std::endl); \
+    assert(Assertion)
 #else
 #define OrxAssert(condition, errorMessage)  ((void)0)
 #endif
 
-}
-
 #endif /* _Exception_H__ */
Index: /code/trunk/src/util/ExprParser.cc
===================================================================
--- /code/trunk/src/util/ExprParser.cc	(revision 2170)
+++ /code/trunk/src/util/ExprParser.cc	(revision 2171)
@@ -45,406 +45,409 @@
 #define PARSE_BLANKS while (*reading_stream == ' ') ++reading_stream
 
-ExprParser::ExprParser(const std::string& str)
+namespace orxonox
 {
-    this->failed_ = false;
-    this->reading_stream = str.c_str();
-    if (str.size() == 0 || *reading_stream == '\0')
-    {
-        this->failed_ = true;
-        this->result_ = 0.0;
-    }
-    else
-    {
-        this->result_ = parse_expr_8();
-        this->remains_ = reading_stream;
+    ExprParser::ExprParser(const std::string& str)
+    {
+        this->failed_ = false;
+        this->reading_stream = str.c_str();
+        if (str.size() == 0 || *reading_stream == '\0')
+        {
+            this->failed_ = true;
+            this->result_ = 0.0;
+        }
+        else
+        {
+            this->result_ = parse_expr_8();
+            this->remains_ = reading_stream;
+        }
+    }
+
+    //Private functions:
+    /******************/
+    double ExprParser::parse_argument()
+    {
+        double value = parse_expr_8();
+        if (*reading_stream == ',')
+        {
+            ++reading_stream;
+            return value;
+        }
+        else
+        {
+            this->failed_ = true;
+            return 0;
+        }
+    }
+
+    double ExprParser::parse_last_argument()
+    {
+        double value = parse_expr_8();
+        if (*reading_stream == ')')
+        {
+            ++reading_stream;
+            return value;
+        }
+        else
+        {
+            this->failed_ = true;
+            return 0;
+        }
+    }
+
+    double ExprParser::parse_expr_8()
+    {
+        double value = parse_expr_7();
+        for(;;)
+        {
+            switch (op)
+            {
+            case oder:
+                value = parse_expr_7() || value;
+                break;
+            default: return value;
+            }
+        };
+    }
+
+
+    double ExprParser::parse_expr_7()
+    {
+        double value = parse_expr_6();
+        for(;;)
+        {
+            switch (op)
+            {
+            case und:
+                value = value && parse_expr_6();
+                break;
+            default: return value;
+            }
+        };
+    }
+
+    double ExprParser::parse_expr_6()
+    {
+        double value = parse_expr_5();
+        for(;;)
+        {
+            switch (op)
+            {
+            case gleich:
+                value = (value == parse_expr_5());
+                break;
+            case ungleich:
+                value = (value != parse_expr_5());
+                break;
+            default:
+                return value;
+            }
+        };
+    }
+
+    double ExprParser::parse_expr_5()
+    {
+        double value = parse_expr_4();
+        for(;;)
+        {
+            switch (op)
+            {
+            case kleiner:
+                value = (value < parse_expr_4());
+                break;
+            case kleinergleich:
+                value = (value <= parse_expr_4());
+                break;
+            case groesser:
+                value = (value > parse_expr_4());
+                break;
+            case groessergleich:
+                value = (value >= parse_expr_4());
+                break;
+            default:
+                return value;
+            }
+        };
+    }
+
+    double ExprParser::parse_expr_4()
+    {
+        double value = parse_expr_3();
+        for(;;)
+        {
+            switch (op)
+            {
+            case b_plus:
+                value += parse_expr_3();
+                break;
+            case b_minus:
+                value -= parse_expr_3();
+                break;
+            default:
+                return value;
+            }
+        };
+    }
+
+    double ExprParser::parse_expr_3()
+    {
+        double value = parse_expr_2();
+        for(;;)
+        {
+            switch (op)
+            {
+            case mal:
+                value *= parse_expr_2();
+                break;
+            case durch:
+                value /= parse_expr_2();
+                break;
+            case modulo:
+                {
+                    double temp = parse_expr_2();
+                    value = value - floor(value/temp)*temp;
+                    break;
+                }
+            default:
+                return value;
+            }
+        };
+    }
+
+    double ExprParser::parse_expr_2()
+    {
+        double value = parse_expr_1();
+        while (*reading_stream != '\0')
+        {
+            op = parse_binary_operator();
+            switch (op)
+            {
+            case hoch:
+                value = pow(value,parse_expr_1());
+                break;
+            default:
+                return value;
+            }
+        };
+        op = undef;
+        return value;
+    }
+
+    double ExprParser::parse_expr_1()
+    {
+        PARSE_BLANKS;
+        double value;
+
+        unary_operator op = parse_unary_operator();
+        PARSE_BLANKS;
+
+        if (*reading_stream == '\0')
+        {
+            // end of string
+            this->failed_ = true;
+            return 0;
+        }
+        else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
+        {  // number
+            value = strtod(reading_stream, const_cast<char**>(&reading_stream));
+        }
+        else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+        {  // variable or function
+            char* word = new char[256];
+            parse_word(word);
+            PARSE_BLANKS;
+            if (*reading_stream == '(')
+            {
+                ++reading_stream;
+#define SWITCH word
+                CASE_1("sin")
+                    value = sin(parse_last_argument());
+                CASE("asin")
+                    value = asin(parse_last_argument());
+                CASE("sinh")
+                    value = sinh(parse_last_argument());
+                CASE("asinh")
+                {
+                    value = parse_last_argument();
+                    value = log(sqrt(pow(value, 2) + 1) + value);
+                }
+                CASE("cos")
+                    value = cos(parse_last_argument());
+                CASE("acos")
+                    value = acos(parse_last_argument());
+                CASE("cosh")
+                    value = cosh(parse_last_argument());
+                CASE("acosh")
+                {
+                    value = parse_last_argument();
+                    value = log(sqrt(pow(value, 2) - 1) + value);
+                }
+                CASE("tan")
+                    value = tan(parse_last_argument());
+                CASE("atan")
+                    value = atan(parse_last_argument());
+                CASE("atan2")
+                    value = atan2(parse_argument(),parse_last_argument());
+                CASE("tanh")
+                    value = tanh(parse_last_argument());
+                CASE("atanh")
+                {
+                    value = parse_last_argument();
+                    value = 0.5*log((value + 1)/(value - 1));
+                }
+                CASE("int")
+                    value = floor(parse_last_argument());
+                CASE("floor")
+                    value = floor(parse_last_argument());
+                CASE("ceil")
+                    value = ceil(parse_last_argument());
+                CASE("abs")
+                    value = fabs(parse_last_argument());
+                CASE("exp")
+                    value = exp(parse_last_argument());
+                CASE("log")
+                    value = log10(parse_last_argument());
+                CASE("ln")
+                    value = log(parse_last_argument());
+                CASE("sign")
+                {
+                    value = parse_last_argument();
+                    value = (value>0 ? 1 : (value<0 ? -1 : 0));
+                }
+                CASE("sqrt")
+                    value = sqrt(parse_last_argument());
+                CASE("degrees")
+                    value = parse_last_argument()*180/3.1415926535897932;
+                CASE("radians")
+                    value = parse_last_argument()*3.1415926535897932/180;
+                CASE("mod")
+                {
+                    value = parse_argument();
+                    double value2 = parse_last_argument();
+                    value = value - floor(value/value2)*value2;
+                }
+                CASE("pow")
+                    value = pow(parse_argument(),parse_last_argument());
+                CASE("div")
+                    value = floor(parse_argument()/parse_last_argument());
+                CASE("max")
+                    value = std::max(parse_argument(),parse_last_argument());
+                CASE("min")
+                    value = std::min(parse_argument(),parse_last_argument());
+                CASE_ELSE
+                {
+                    this->failed_ = true;
+                    delete[] word;
+                    return 0;
+                }
+            }
+            else
+            {
+#define SWITCH word
+                CASE_1("pi")
+                    value = 3.1415926535897932;
+                CASE("e")
+                    value = 2.7182818284590452;
+                CASE_ELSE
+                {
+                    this->failed_ = true;
+                    delete[] word;
+                    return 0;
+                }
+            }
+            delete[] word;
+        }
+        else if (*reading_stream == 40)
+        {  // expresion in paranthesis
+            ++reading_stream;
+            value = parse_last_argument();
+        }
+        else
+        {
+            this->failed_ = true;
+            return 0;
+        }
+
+        PARSE_BLANKS;
+        switch (op)
+        {
+        case u_nicht: return !value;
+        case u_plus:  return  value;
+        case u_minus: return -value;
+        default:
+            this->failed_ = true;
+            return 0;
+        }
+    }
+
+    char* ExprParser::parse_word(char* str)
+    {
+        char* word = str;
+        int counter = 0;
+        while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+        {
+            *word++ = *reading_stream++;
+            counter++;
+            if (counter > 255)
+            {
+                this->failed_ = true;
+                return '\0';
+            }
+        };
+        *word = '\0';
+        return str;
+    }
+
+    ExprParser::binary_operator ExprParser::parse_binary_operator()
+    {
+        binary_operator op;
+        switch (*reading_stream)
+        {
+        case '+': op = b_plus; break;
+        case '-': op = b_minus; break;
+        case '*': op = mal; break;
+        case '/': op = durch; break;
+        case '^': op = hoch; break;
+        case '%': op = modulo; break;
+        case '&': op = und; break;
+        case '|': op = oder; break;
+        case '=': op = gleich; break;
+        case '!': op = b_nicht; break;
+        case '<': op = kleiner; break;
+        case '>': op = groesser; break;
+        default: return undef;
+        }
+        if (*++reading_stream == '=')
+        {
+            if (op > 9)
+            {
+                ++reading_stream;
+                return (binary_operator)(op + 3);
+            }
+            else
+            {
+                --reading_stream;
+                return undef;
+            }
+        }
+        else
+            return op;
+    }
+
+    ExprParser::unary_operator ExprParser::parse_unary_operator()
+    {
+        switch (*reading_stream)
+        {
+        case '!':
+            ++reading_stream;
+            return u_nicht;
+        case '+':
+            ++reading_stream;
+            return u_plus;
+        case '-':
+            ++reading_stream;
+            return u_minus;
+        default :
+            return u_plus;
+        }
     }
 }
-
-//Private functions:
-/******************/
-double ExprParser::parse_argument()
-{
-    double value = parse_expr_8();
-    if (*reading_stream == ',')
-    {
-        ++reading_stream;
-        return value;
-    }
-    else
-    {
-        this->failed_ = true;
-        return 0;
-    }
-}
-
-double ExprParser::parse_last_argument()
-{
-    double value = parse_expr_8();
-    if (*reading_stream == ')')
-    {
-        ++reading_stream;
-        return value;
-    }
-    else
-    {
-        this->failed_ = true;
-        return 0;
-    }
-}
-
-double ExprParser::parse_expr_8()
-{
-    double value = parse_expr_7();
-    for(;;)
-    {
-        switch (op)
-        {
-        case oder:
-            value = parse_expr_7() || value;
-            break;
-        default: return value;
-        }
-    };
-}
-
-
-double ExprParser::parse_expr_7()
-{
-    double value = parse_expr_6();
-    for(;;)
-    {
-        switch (op)
-        {
-        case und:
-            value = value && parse_expr_6();
-            break;
-        default: return value;
-        }
-    };
-}
-
-double ExprParser::parse_expr_6()
-{
-    double value = parse_expr_5();
-    for(;;)
-    {
-        switch (op)
-        {
-        case gleich:
-            value = (value == parse_expr_5());
-            break;
-        case ungleich:
-            value = (value != parse_expr_5());
-            break;
-        default:
-            return value;
-        }
-    };
-}
-
-double ExprParser::parse_expr_5()
-{
-    double value = parse_expr_4();
-    for(;;)
-    {
-        switch (op)
-        {
-        case kleiner:
-            value = (value < parse_expr_4());
-            break;
-        case kleinergleich:
-            value = (value <= parse_expr_4());
-            break;
-        case groesser:
-            value = (value > parse_expr_4());
-            break;
-        case groessergleich:
-            value = (value >= parse_expr_4());
-            break;
-        default:
-            return value;
-        }
-    };
-}
-
-double ExprParser::parse_expr_4()
-{
-    double value = parse_expr_3();
-    for(;;)
-    {
-        switch (op)
-        {
-        case b_plus:
-            value += parse_expr_3();
-            break;
-        case b_minus:
-            value -= parse_expr_3();
-            break;
-        default:
-            return value;
-        }
-    };
-}
-
-double ExprParser::parse_expr_3()
-{
-    double value = parse_expr_2();
-    for(;;)
-    {
-        switch (op)
-        {
-        case mal:
-            value *= parse_expr_2();
-            break;
-        case durch:
-            value /= parse_expr_2();
-            break;
-        case modulo:
-            {
-                double temp = parse_expr_2();
-                value = value - floor(value/temp)*temp;
-                break;
-            }
-        default:
-            return value;
-        }
-    };
-}
-
-double ExprParser::parse_expr_2()
-{
-    double value = parse_expr_1();
-    while (*reading_stream != '\0')
-    {
-        op = parse_binary_operator();
-        switch (op)
-        {
-        case hoch:
-            value = pow(value,parse_expr_1());
-            break;
-        default:
-            return value;
-        }
-    };
-    op = undef;
-    return value;
-}
-
-double ExprParser::parse_expr_1()
-{
-    PARSE_BLANKS;
-    double value;
-
-    unary_operator op = parse_unary_operator();
-    PARSE_BLANKS;
-
-    if (*reading_stream == '\0')
-    {
-        // end of string
-        this->failed_ = true;
-        return 0;
-    }
-    else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
-    {  // number
-        value = strtod(reading_stream, const_cast<char**>(&reading_stream));
-    }
-    else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
-    {  // variable or function
-        char* word = new char[256];
-        parse_word(word);
-        PARSE_BLANKS;
-        if (*reading_stream == '(')
-        {
-            ++reading_stream;
-#define SWITCH word
-            CASE_1("sin")
-                value = sin(parse_last_argument());
-            CASE("asin")
-                value = asin(parse_last_argument());
-            CASE("sinh")
-                value = sinh(parse_last_argument());
-            CASE("asinh")
-            {
-                value = parse_last_argument();
-                value = log(sqrt(pow(value, 2) + 1) + value);
-            }
-            CASE("cos")
-                value = cos(parse_last_argument());
-            CASE("acos")
-                value = acos(parse_last_argument());
-            CASE("cosh")
-                value = cosh(parse_last_argument());
-            CASE("acosh")
-            {
-                value = parse_last_argument();
-                value = log(sqrt(pow(value, 2) - 1) + value);
-            }
-            CASE("tan")
-                value = tan(parse_last_argument());
-            CASE("atan")
-                value = atan(parse_last_argument());
-            CASE("atan2")
-                value = atan2(parse_argument(),parse_last_argument());
-            CASE("tanh")
-                value = tanh(parse_last_argument());
-            CASE("atanh")
-            {
-                value = parse_last_argument();
-                value = 0.5*log((value + 1)/(value - 1));
-            }
-            CASE("int")
-                value = floor(parse_last_argument());
-            CASE("floor")
-                value = floor(parse_last_argument());
-            CASE("ceil")
-                value = ceil(parse_last_argument());
-            CASE("abs")
-                value = fabs(parse_last_argument());
-            CASE("exp")
-                value = exp(parse_last_argument());
-            CASE("log")
-                value = log10(parse_last_argument());
-            CASE("ln")
-                value = log(parse_last_argument());
-            CASE("sign")
-            {
-                value = parse_last_argument();
-                value = (value>0 ? 1 : (value<0 ? -1 : 0));
-            }
-            CASE("sqrt")
-                value = sqrt(parse_last_argument());
-            CASE("degrees")
-                value = parse_last_argument()*180/3.1415926535897932;
-            CASE("radians")
-                value = parse_last_argument()*3.1415926535897932/180;
-            CASE("mod")
-            {
-                value = parse_argument();
-                double value2 = parse_last_argument();
-                value = value - floor(value/value2)*value2;
-            }
-            CASE("pow")
-                value = pow(parse_argument(),parse_last_argument());
-            CASE("div")
-                value = floor(parse_argument()/parse_last_argument());
-            CASE("max")
-                value = std::max(parse_argument(),parse_last_argument());
-            CASE("min")
-                value = std::min(parse_argument(),parse_last_argument());
-            CASE_ELSE
-            {
-                this->failed_ = true;
-                delete[] word;
-                return 0;
-            }
-        }
-        else
-        {
-#define SWITCH word
-            CASE_1("pi")
-                value = 3.1415926535897932;
-            CASE("e")
-                value = 2.7182818284590452;
-            CASE_ELSE
-            {
-                this->failed_ = true;
-                delete[] word;
-                return 0;
-            }
-        }
-        delete[] word;
-    }
-    else if (*reading_stream == 40)
-    {  // expresion in paranthesis
-        ++reading_stream;
-        value = parse_last_argument();
-    }
-    else
-    {
-        this->failed_ = true;
-        return 0;
-    }
-
-    PARSE_BLANKS;
-    switch (op)
-    {
-    case u_nicht: return !value;
-    case u_plus:  return  value;
-    case u_minus: return -value;
-    default:
-        this->failed_ = true;
-        return 0;
-    }
-}
-
-char* ExprParser::parse_word(char* str)
-{
-    char* word = str;
-    int counter = 0;
-    while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
-    {
-        *word++ = *reading_stream++;
-        counter++;
-        if (counter > 255)
-        {
-            this->failed_ = true;
-            return '\0';
-        }
-    };
-    *word = '\0';
-    return str;
-}
-
-ExprParser::binary_operator ExprParser::parse_binary_operator()
-{
-    binary_operator op;
-    switch (*reading_stream)
-    {
-    case '+': op = b_plus; break;
-    case '-': op = b_minus; break;
-    case '*': op = mal; break;
-    case '/': op = durch; break;
-    case '^': op = hoch; break;
-    case '%': op = modulo; break;
-    case '&': op = und; break;
-    case '|': op = oder; break;
-    case '=': op = gleich; break;
-    case '!': op = b_nicht; break;
-    case '<': op = kleiner; break;
-    case '>': op = groesser; break;
-    default: return undef;
-    }
-    if (*++reading_stream == '=')
-    {
-        if (op > 9)
-        {
-            ++reading_stream;
-            return (binary_operator)(op + 3);
-        }
-        else
-        {
-            --reading_stream;
-            return undef;
-        }
-    }
-    else
-        return op;
-}
-
-ExprParser::unary_operator ExprParser::parse_unary_operator()
-{
-    switch (*reading_stream)
-    {
-    case '!':
-        ++reading_stream;
-        return u_nicht;
-    case '+':
-        ++reading_stream;
-        return u_plus;
-    case '-':
-        ++reading_stream;
-        return u_minus;
-    default :
-        return u_plus;
-    }
-}
Index: /code/trunk/src/util/ExprParser.h
===================================================================
--- /code/trunk/src/util/ExprParser.h	(revision 2170)
+++ /code/trunk/src/util/ExprParser.h	(revision 2171)
@@ -38,70 +38,73 @@
 #include <string>
 
-class _UtilExport ExprParser
+namespace orxonox
 {
-public:
-    enum binary_operator
+    class _UtilExport ExprParser
     {
-        b_plus,
-        b_minus,
-        mal,
-        durch,
-        modulo,
-        hoch,
-        undef,
-        oder,
-        und,
-        gleich,
-        b_nicht,
-        kleiner,
-        groesser,
-        ungleich,
-        kleinergleich,
-        groessergleich
+    public:
+        enum binary_operator
+        {
+            b_plus,
+            b_minus,
+            mal,
+            durch,
+            modulo,
+            hoch,
+            undef,
+            oder,
+            und,
+            gleich,
+            b_nicht,
+            kleiner,
+            groesser,
+            ungleich,
+            kleinergleich,
+            groessergleich
+        };
+
+        enum unary_operator
+        {
+            u_plus,
+            u_minus,
+            u_nicht
+        };
+
+
+        ExprParser(const std::string& str);
+        std::string& getRemains() { return  this->remains_; }
+        double       getResult()  { return  this->result_; }
+        bool         getSuccess() { return !this->failed_; }
+
+    private:
+        double parse_expr_1();
+        double parse_expr_2();
+        double parse_expr_3();
+        double parse_expr_4();
+        double parse_expr_5();
+        double parse_expr_6();
+        double parse_expr_7();
+        double parse_expr_8();
+        char* parse_word(char* str);
+        binary_operator parse_binary_operator();
+        unary_operator parse_unary_operator();
+
+        double parse_argument();
+        double parse_last_argument();
+
+        binary_operator op;
+        const char* reading_stream;
+        bool failed_;
+        double result_;
+        std::string remains_;
+
     };
 
-    enum unary_operator
-    {
-        u_plus,
-        u_minus,
-        u_nicht
-    };
-
-
-    ExprParser(const std::string& str);
-    std::string& getRemains() { return  this->remains_; }
-    double       getResult()  { return  this->result_; }
-    bool         getSuccess() { return !this->failed_; }
-
-private:
-    double parse_expr_1();
-    double parse_expr_2();
-    double parse_expr_3();
-    double parse_expr_4();
-    double parse_expr_5();
-    double parse_expr_6();
-    double parse_expr_7();
-    double parse_expr_8();
-    char* parse_word(char* str);
-    binary_operator parse_binary_operator();
-    unary_operator parse_unary_operator();
-
-    double parse_argument();
-    double parse_last_argument();
-
-    binary_operator op;
-    const char* reading_stream;
-    bool failed_;
-    double result_;
-    std::string remains_;
-
-};
-
-//Endzeichen für float expression: ')', '}', ']', ',', ';'
-_UtilExport bool parse_float(char* const, char**, double*);
-//Endzeichen angegeben
-_UtilExport bool parse_float(char* const, char**, char, double*);
-//Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)
-_UtilExport bool parse_vector_float(char* const, char**, bool, double*);
+    //Endzeichen für float expression: ')', '}', ']', ',', ';'
+    _UtilExport bool parse_float(char* const, char**, double*);
+    //Endzeichen angegeben
+    _UtilExport bool parse_float(char* const, char**, char, double*);
+    //Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)
+    _UtilExport bool parse_vector_float(char* const, char**, bool, double*);
+}
 
 #endif /* _FloatParser_H__ */
Index: /code/trunk/src/util/Math.cc
===================================================================
--- /code/trunk/src/util/Math.cc	(revision 2170)
+++ /code/trunk/src/util/Math.cc	(revision 2171)
@@ -38,296 +38,302 @@
 #include "SubString.h"
 
-/**
-    @brief Function for writing a Radian to a stream.
-*/
-std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian)
+// Do not remove this include to avoid linker errors.
+#include "mbool.h"
+
+namespace orxonox
 {
-    out << radian.valueRadians();
-    return out;
+    /**
+        @brief Function for writing a Radian to a stream.
+    */
+    std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian)
+    {
+        out << radian.valueRadians();
+        return out;
+    }
+
+    /**
+        @brief Function for reading a Radian from a stream.
+    */
+    std::istream& operator>>(std::istream& in, orxonox::Radian& radian)
+    {
+        float temp;
+        in >> temp;
+        radian = temp;
+        return in;
+    }
+
+    /**
+        @brief Function for writing a Degree to a stream.
+    */
+    std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)
+    {
+        out << degree.valueDegrees();
+        return out;
+    }
+
+    /**
+        @brief Function for reading a Degree from a stream.
+    */
+    std::istream& operator>>(std::istream& in, orxonox::Degree& degree)
+    {
+        float temp;
+        in >> temp;
+        degree = temp;
+        return in;
+    }
+
+
+    /**
+        @brief Gets the angle between my viewing direction and the direction to the position of the other object.
+        @param myposition My position
+        @param mydirection My viewing direction
+        @param otherposition The position of the other object
+        @return The angle
+
+        @example
+        If the other object is exactly in front of me, the function returns 0.
+        If the other object is exactly behind me, the function returns pi.
+        If the other object is exactly right/left to me (or above/below), the function returns pi/2.
+    */
+    float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition)
+    {
+        orxonox::Vector3 distance = otherposition - myposition;
+        float distancelength = distance.length();
+        if (distancelength == 0)
+            return 0;
+        else
+            return acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1));
+    }
+
+    /**
+        @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object.
+        @param myposition My position
+        @param mydirection My viewing direction
+        @param myorthonormal My orthonormalvector (pointing upwards through my head)
+        @param otherposition The position of the other object
+        @return The viewing direction
+
+        @example
+        If the other object is exactly in front of me, the function returns Vector2(0, 0).
+        If the other object is exactly at my left, the function returns Vector2(-1, 0).
+        If the other object is exactly at my right, the function returns Vector2(1, 0).
+        If the other object is only a bit at my right, the function still returns Vector2(1, 0).
+        If the other object is exactly above me, the function returns Vector2(0, 1).
+    */
+    orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
+    {
+        orxonox::Vector3 distance = otherposition - myposition;
+
+        // project difference vector on our plane
+        orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
+
+        float projectionlength = projection.length();
+        if (projectionlength == 0) return orxonox::Vector2(0, 0);
+        float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
+
+        if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
+            return orxonox::Vector2(sin(angle), cos(angle));
+        else
+            return orxonox::Vector2(-sin(angle), cos(angle));
+    }
+
+    /**
+        @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0° = 0, 180° = 1).
+        @param myposition My position
+        @param mydirection My viewing direction
+        @param myorthonormal My orthonormalvector (pointing upwards through my head)
+        @param otherposition The position of the other object
+        @return The viewing direction
+
+        @example
+        If the other object is exactly in front of me, the function returns Vector2(0, 0).
+        If the other object is exactly at my left, the function returns Vector2(-0.5, 0).
+        If the other object is exactly at my right, the function returns Vector2(0.5, 0).
+        If the other object is only a bit at my right, the function still returns Vector2(0.01, 0).
+        If the other object is exactly above me, the function returns Vector2(0, 0.5).
+    */
+    orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
+    {
+        orxonox::Vector3 distance = otherposition - myposition;
+
+        // project difference vector on our plane
+        orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
+
+        float projectionlength = projection.length();
+        if (projectionlength == 0) return orxonox::Vector2(0, 0);
+        float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
+
+        float distancelength = distance.length();
+        if (distancelength == 0) return orxonox::Vector2(0, 0);
+        float radius = acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1)) / Ogre::Math::PI;
+
+        if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
+            return orxonox::Vector2(sin(angle) * radius, cos(angle) * radius);
+        else
+            return orxonox::Vector2(-sin(angle) * radius, cos(angle) * radius);
+    }
+
+    /**
+        @brief Returns the predicted position I have to aim at, if I want to hit a moving target with a moving projectile.
+        @param myposition My position
+        @param projectilespeed The speed of my projectile
+        @param targetposition The position of my target
+        @param targetvelocity The velocity of my target
+        @return The predicted position
+
+        The function predicts the position based on a linear velocity of the target. If the target changes speed or direction, the projectile will miss.
+    */
+    orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity)
+    {
+        float squaredProjectilespeed = projectilespeed * projectilespeed;
+        orxonox::Vector3 distance = targetposition - myposition;
+        float a = distance.squaredLength();
+        float b = 2 * (distance.x + distance.y + distance.z) * (targetvelocity.x + targetvelocity.y + targetvelocity.z);
+        float c = targetvelocity.squaredLength();
+
+        float temp = 4*squaredProjectilespeed*c + a*a - 4*b*c;
+        if (temp < 0)
+            return orxonox::Vector3::ZERO;
+
+        temp = sqrt(temp);
+        float time = (temp + a) / (2 * (squaredProjectilespeed - b));
+        return (targetposition + targetvelocity * time);
+    }
+
+    unsigned long getUniqueNumber()
+    {
+        static unsigned long aNumber = 135;
+        return aNumber++;
+    }
+
+
+    //////////////////////////
+    // Conversion functions //
+    //////////////////////////
+
+    // std::string to Vector2
+    bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
+    {
+        size_t opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                         ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 2)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+
+    // std::string to Vector3
+    bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
+    {
+        size_t opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                         ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 3)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+
+    // std::string to Vector4
+    bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
+    {
+        size_t opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                         ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->w), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+
+    // std::string to Quaternion
+    bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
+    {
+        size_t opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->w), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->x), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
+    }
+
+    // std::string to ColourValue
+    bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
+    {
+        size_t opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 3)
+        {
+            if (!ConvertValue(&(output->r), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->g), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->b), tokens[2]))
+                return false;
+            if (tokens.size() >= 4)
+            {
+                if (!ConvertValue(&(output->a), tokens[3]))
+                    return false;
+            }
+            else
+                output->a = 1.0;
+
+            return true;
+        }
+        return false;
+    }
 }
-
-/**
-    @brief Function for reading a Radian from a stream.
-*/
-std::istream& operator>>(std::istream& in, orxonox::Radian& radian)
-{
-    float temp;
-    in >> temp;
-    radian = temp;
-    return in;
-}
-
-/**
-    @brief Function for writing a Degree to a stream.
-*/
-std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)
-{
-    out << degree.valueDegrees();
-    return out;
-}
-
-/**
-    @brief Function for reading a Degree from a stream.
-*/
-std::istream& operator>>(std::istream& in, orxonox::Degree& degree)
-{
-    float temp;
-    in >> temp;
-    degree = temp;
-    return in;
-}
-
-
-/**
-    @brief Gets the angle between my viewing direction and the direction to the position of the other object.
-    @param myposition My position
-    @param mydirection My viewing direction
-    @param otherposition The position of the other object
-    @return The angle
-
-    @example
-    If the other object is exactly in front of me, the function returns 0.
-    If the other object is exactly behind me, the function returns pi.
-    If the other object is exactly right/left to me (or above/below), the function returns pi/2.
-*/
-float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition)
-{
-    orxonox::Vector3 distance = otherposition - myposition;
-    float distancelength = distance.length();
-    if (distancelength == 0)
-        return 0;
-    else
-        return acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1));
-}
-
-/**
-    @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object.
-    @param myposition My position
-    @param mydirection My viewing direction
-    @param myorthonormal My orthonormalvector (pointing upwards through my head)
-    @param otherposition The position of the other object
-    @return The viewing direction
-
-    @example
-    If the other object is exactly in front of me, the function returns Vector2(0, 0).
-    If the other object is exactly at my left, the function returns Vector2(-1, 0).
-    If the other object is exactly at my right, the function returns Vector2(1, 0).
-    If the other object is only a bit at my right, the function still returns Vector2(1, 0).
-    If the other object is exactly above me, the function returns Vector2(0, 1).
-*/
-orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
-{
-    orxonox::Vector3 distance = otherposition - myposition;
-
-    // project difference vector on our plane
-    orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
-
-    float projectionlength = projection.length();
-    if (projectionlength == 0) return orxonox::Vector2(0, 0);
-    float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
-
-    if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
-        return orxonox::Vector2(sin(angle), cos(angle));
-    else
-        return orxonox::Vector2(-sin(angle), cos(angle));
-}
-
-/**
-    @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0° = 0, 180° = 1).
-    @param myposition My position
-    @param mydirection My viewing direction
-    @param myorthonormal My orthonormalvector (pointing upwards through my head)
-    @param otherposition The position of the other object
-    @return The viewing direction
-
-    @example
-    If the other object is exactly in front of me, the function returns Vector2(0, 0).
-    If the other object is exactly at my left, the function returns Vector2(-0.5, 0).
-    If the other object is exactly at my right, the function returns Vector2(0.5, 0).
-    If the other object is only a bit at my right, the function still returns Vector2(0.01, 0).
-    If the other object is exactly above me, the function returns Vector2(0, 0.5).
-*/
-orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition)
-{
-    orxonox::Vector3 distance = otherposition - myposition;
-
-    // project difference vector on our plane
-    orxonox::Vector3 projection = Ogre::Plane(mydirection, myposition).projectVector(distance);
-
-    float projectionlength = projection.length();
-    if (projectionlength == 0) return orxonox::Vector2(0, 0);
-    float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1));
-
-    float distancelength = distance.length();
-    if (distancelength == 0) return orxonox::Vector2(0, 0);
-    float radius = acos(clamp<float>(mydirection.dotProduct(distance) / distancelength, -1, 1)) / Ogre::Math::PI;
-
-    if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0)
-        return orxonox::Vector2(sin(angle) * radius, cos(angle) * radius);
-    else
-        return orxonox::Vector2(-sin(angle) * radius, cos(angle) * radius);
-}
-
-/**
-    @brief Returns the predicted position I have to aim at, if I want to hit a moving target with a moving projectile.
-    @param myposition My position
-    @param projectilespeed The speed of my projectile
-    @param targetposition The position of my target
-    @param targetvelocity The velocity of my target
-    @return The predicted position
-
-    The function predicts the position based on a linear velocity of the target. If the target changes speed or direction, the projectile will miss.
-*/
-orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity)
-{
-    float squaredProjectilespeed = projectilespeed * projectilespeed;
-    orxonox::Vector3 distance = targetposition - myposition;
-    float a = distance.squaredLength();
-    float b = 2 * (distance.x + distance.y + distance.z) * (targetvelocity.x + targetvelocity.y + targetvelocity.z);
-    float c = targetvelocity.squaredLength();
-
-    float temp = 4*squaredProjectilespeed*c + a*a - 4*b*c;
-    if (temp < 0)
-        return orxonox::Vector3::ZERO;
-
-    temp = sqrt(temp);
-    float time = (temp + a) / (2 * (squaredProjectilespeed - b));
-    return (targetposition + targetvelocity * time);
-}
-
-unsigned long getUniqueNumber()
-{
-    static unsigned long aNumber = 135;
-    return aNumber++;
-}
-
-
-//////////////////////////
-// Conversion functions //
-//////////////////////////
-
-// std::string to Vector2
-bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
-{
-    size_t opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos)
-        opening_parenthesis = 0;
-    else
-        opening_parenthesis++;
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
-                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 2)
-    {
-        if (!ConvertValue(&(output->x), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to Vector3
-bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
-{
-    size_t opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos)
-        opening_parenthesis = 0;
-    else
-        opening_parenthesis++;
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
-                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 3)
-    {
-        if (!ConvertValue(&(output->x), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to Vector4
-bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
-{
-    size_t opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos)
-        opening_parenthesis = 0;
-    else
-        opening_parenthesis++;
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
-                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 4)
-    {
-        if (!ConvertValue(&(output->x), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-            return false;
-        if (!ConvertValue(&(output->w), tokens[3]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to Quaternion
-bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
-{
-    size_t opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 4)
-    {
-        if (!ConvertValue(&(output->w), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->x), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[2]))
-            return false;
-        if (!ConvertValue(&(output->z), tokens[3]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to ColourValue
-bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
-{
-    size_t opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 3)
-    {
-        if (!ConvertValue(&(output->r), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->g), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->b), tokens[2]))
-            return false;
-        if (tokens.size() >= 4)
-        {
-            if (!ConvertValue(&(output->a), tokens[3]))
-                return false;
-        }
-        else
-            output->a = 1.0;
-
-        return true;
-    }
-    return false;
-}
Index: /code/trunk/src/util/Math.h
===================================================================
--- /code/trunk/src/util/Math.h	(revision 2170)
+++ /code/trunk/src/util/Math.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file Math.h
+    @file
     @brief Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the orxonox namespace.
 */
@@ -39,4 +39,5 @@
 #include <ostream>
 #include <string>
+#include <cmath>
 #include <boost/static_assert.hpp>
 
@@ -49,27 +50,4 @@
 #include <OgreQuaternion.h>
 #include <OgreColourValue.h>
-
-namespace orxonox
-{
-  typedef Ogre::Radian Radian;
-  typedef Ogre::Degree Degree;
-  typedef Ogre::Vector2 Vector2;
-  typedef Ogre::Vector3 Vector3;
-  typedef Ogre::Vector4 Vector4;
-  typedef Ogre::Matrix3 Matrix3;
-  typedef Ogre::Matrix4 Matrix4;
-  typedef Ogre::Quaternion Quaternion;
-  typedef Ogre::ColourValue ColourValue;
-}
-
-_UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
-_UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);
-_UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);
-_UtilExport std::istream& operator>>(std::istream& in, orxonox::Degree& degree);
-
-_UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);
-_UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
-_UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
-_UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);
 
 //Get around Windows hackery
@@ -83,215 +61,219 @@
 #endif
 
-/**
-    @brief Returns the sign of the given value.
-    @param x The value
-    @return 1 if the value is positive or zero, -1 if the value is negative
-*/
-template <typename T>
-inline T sgn(T x)
+namespace orxonox
 {
-    return (x >= 0) ? 1 : -1;
+    typedef Ogre::Radian Radian;
+    typedef Ogre::Degree Degree;
+    typedef Ogre::Vector2 Vector2;
+    typedef Ogre::Vector3 Vector3;
+    typedef Ogre::Vector4 Vector4;
+    typedef Ogre::Matrix3 Matrix3;
+    typedef Ogre::Matrix4 Matrix4;
+    typedef Ogre::Quaternion Quaternion;
+    typedef Ogre::ColourValue ColourValue;
+
+    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
+    _UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);
+    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);
+    _UtilExport std::istream& operator>>(std::istream& in, orxonox::Degree& degree);
+
+    _UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);
+    _UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
+    _UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
+    _UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);
+
+    /**
+        @brief Returns the sign of the given value.
+        @param x The value
+        @return 1 if the value is positive or zero, -1 if the value is negative
+    */
+    template <typename T>
+    inline T sgn(T x)
+    {
+        return (x >= 0) ? 1 : -1;
+    }
+
+    /**
+        @brief Returns the smaller of two values.
+    */
+    template <typename T>
+    inline T min(T a, T b)
+    {
+        return (a <= b) ? a : b;
+    }
+
+    /**
+        @brief Returns the greater of two values.
+    */
+    template <typename T>
+    inline T max(T a, T b)
+    {
+        return (a >= b) ? a : b;
+    }
+
+    /**
+        @brief Keeps a value between a lower and an upper limit.
+        @param x The value
+        @param min The lower limit
+        @param max The upper limit
+    */
+    template <typename T>
+    inline T clamp(T x, T min, T max)
+    {
+        if (x < min)
+            return min;
+
+        if (x > max)
+            return max;
+
+        return x;
+    }
+
+    /**
+        @brief Returns the square value (x^2).
+    */
+    template <typename T>
+    inline T square(T x)
+    {
+        return x*x;
+    }
+
+    /**
+        @brief Returns the cube value (x^3).
+    */
+    template <typename T>
+    inline T cube(T x)
+    {
+        return x*x*x;
+    }
+
+    /**
+        @brief Rounds the value.
+    */
+    template <typename T>
+    inline int round(T x)
+    {
+        return (int)(x + 0.5);
+    }
+
+    /**
+        @brief The modulo operation, enhanced to work properly with negative values.
+        @param x The value
+        @param max The operand
+    */
+    template <typename T>
+    inline int mod(T x, int max)
+    {
+        if (x >= 0)
+            return (x % max);
+        else
+            return ((x % max) + max);
+    }
+
+    template <typename T>
+    inline T zeroise()
+    {
+        BOOST_STATIC_ASSERT(sizeof(T) == 0);
+        return T();
+    }
+
+    template <> inline char                 zeroise<char>()                 { return 0; }
+    template <> inline unsigned char        zeroise<unsigned char>()        { return 0; }
+    template <> inline short                zeroise<short>()                { return 0; }
+    template <> inline unsigned short       zeroise<unsigned short>()       { return 0; }
+    template <> inline int                  zeroise<int>()                  { return 0; }
+    template <> inline unsigned int         zeroise<unsigned int>()         { return 0; }
+    template <> inline long                 zeroise<long>()                 { return 0; }
+    template <> inline unsigned long        zeroise<unsigned long>()        { return 0; }
+    template <> inline long long            zeroise<long long>()            { return 0; }
+    template <> inline unsigned long long   zeroise<unsigned long long>()   { return 0; }
+    template <> inline float                zeroise<float>()                { return 0; }
+    template <> inline double               zeroise<double>()               { return 0; }
+    template <> inline long double          zeroise<long double>()          { return 0; }
+    template <> inline bool                 zeroise<bool>()                 { return 0; }
+    template <> inline void*                zeroise<void*>()                { return 0; }
+    template <> inline std::string          zeroise<std::string>()          { return ""; }
+    template <> inline orxonox::Radian      zeroise<orxonox::Radian>()      { return orxonox::Radian(0.0f); }
+    template <> inline orxonox::Degree      zeroise<orxonox::Degree>()      { return orxonox::Degree(0.0f); }
+    template <> inline orxonox::Vector2     zeroise<orxonox::Vector2>()     { return orxonox::Vector2    (0, 0)      ; }
+    template <> inline orxonox::Vector3     zeroise<orxonox::Vector3>()     { return orxonox::Vector3    (0, 0, 0)   ; }
+    template <> inline orxonox::Vector4     zeroise<orxonox::Vector4>()     { return orxonox::Vector4    (0, 0, 0, 0); }
+    template <> inline orxonox::ColourValue zeroise<orxonox::ColourValue>() { return orxonox::ColourValue(0, 0, 0, 0); }
+    template <> inline orxonox::Quaternion  zeroise<orxonox::Quaternion>()  { return orxonox::Quaternion (0, 0, 0, 0); }
+
+    /**
+        @brief Interpolates between two values for a time between 0 and 1.
+        @param time The time is a value between 0 and 1 - the function returns start if time is 0 and end if time is 1 and interpolates if time is between 0 and 1.
+        @param start The value at time = 0
+        @param end The value at time = 1
+        @return The interpolation at a given time
+    */
+    template <typename T>
+    T interpolate(float time, const T& start, const T& end)
+    {
+        return time * (end - start) + start;
+    }
+
+    /**
+        @brief Interpolates smoothly between two values for a time between 0 and 1. The function starts slowly, increases faster and stops slowly again.
+        @param time The time is a value between 0 and 1 - the function returns start if time is 0 and end if time is 1 and interpolates if time is between 0 and 1.
+        @param start The value at time = 0
+        @param end The value at time = 1
+        @return The smoothed interpolation at a given time
+    */
+    template <typename T>
+    T interpolateSmooth(float time, const T& start, const T& end)
+    {
+        return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;
+    }
+
+    /**
+        @brief Returns a random number between 0 and almost 1: 0 <= rnd < 1.
+    */
+    inline float rnd()
+    {
+        return rand() / (RAND_MAX + 1.0);
+    }
+
+    /**
+        @brief Returns a random number between 0 and almost max: 0 <= rnd < max.
+        @param max The maximum
+    */
+    inline float rnd(float max)
+    {
+        return rnd() * max;
+    }
+
+    /**
+        @brief Returns a random number between min and almost max: min <= rnd < max.
+        @param min The minimum
+        @param max The maximum
+    */
+    inline float rnd(float min, float max)
+    {
+        return rnd(max - min) + min;
+    }
+
+    _UtilExport unsigned long getUniqueNumber();
+
+    class IntVector2
+    {
+    public:
+      IntVector2() : x(0), y(0) { }
+      IntVector2(int _x, int _y) : x(_x), y(_y) { }
+      int x;
+      int y;
+    };
+
+    class IntVector3
+    {
+    public:
+      IntVector3() : x(0), y(0), z(0) { }
+      IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
+      int x;
+      int y;
+      int z;
+    };
 }
 
-/**
-    @brief Returns the smaller of two values.
-*/
-template <typename T>
-inline T min(T a, T b)
-{
-    return (a <= b) ? a : b;
-}
-
-/**
-    @brief Returns the greater of two values.
-*/
-template <typename T>
-inline T max(T a, T b)
-{
-    return (a >= b) ? a : b;
-}
-
-/**
-    @brief Keeps a value between a lower and an upper limit.
-    @param x The value
-    @param min The lower limit
-    @param max The upper limit
-*/
-template <typename T>
-inline T clamp(T x, T min, T max)
-{
-    if (x < min)
-        return min;
-
-    if (x > max)
-        return max;
-
-    return x;
-}
-
-/**
-    @brief Returns the square value (x^2).
-*/
-template <typename T>
-inline T square(T x)
-{
-    return x*x;
-}
-
-/**
-    @brief Returns the cube value (x^3).
-*/
-template <typename T>
-inline T cube(T x)
-{
-    return x*x*x;
-}
-
-/**
-    @brief Rounds the value down.
-*/
-template <typename T>
-inline int floor(T x)
-{
-    return (int)(x);
-}
-
-/**
-    @brief Rounds the value up.
-*/
-template <typename T>
-inline int ceil(T x)
-{
-    int temp = floor(x);
-    return (temp != x) ? (temp + 1) : temp;
-}
-
-/**
-    @brief Rounds the value.
-*/
-template <typename T>
-inline int round(T x)
-{
-    return (int)(x + 0.5);
-}
-
-/**
-    @brief The modulo operation, enhanced to work properly with negative values.
-    @param x The value
-    @param max The operand
-*/
-template <typename T>
-inline int mod(T x, int max)
-{
-    if (x >= 0)
-        return (x % max);
-    else
-        return ((x % max) + max);
-}
-
-template <typename T>
-inline T zeroise()
-{
-    BOOST_STATIC_ASSERT(sizeof(T) == 0);
-    return T();
-}
-
-template <> inline char                 zeroise<char>()                 { return 0; }
-template <> inline unsigned char        zeroise<unsigned char>()        { return 0; }
-template <> inline short                zeroise<short>()                { return 0; }
-template <> inline unsigned short       zeroise<unsigned short>()       { return 0; }
-template <> inline int                  zeroise<int>()                  { return 0; }
-template <> inline unsigned int         zeroise<unsigned int>()         { return 0; }
-template <> inline long                 zeroise<long>()                 { return 0; }
-template <> inline unsigned long        zeroise<unsigned long>()        { return 0; }
-template <> inline long long            zeroise<long long>()            { return 0; }
-template <> inline unsigned long long   zeroise<unsigned long long>()   { return 0; }
-template <> inline float                zeroise<float>()                { return 0; }
-template <> inline double               zeroise<double>()               { return 0; }
-template <> inline long double          zeroise<long double>()          { return 0; }
-template <> inline bool                 zeroise<bool>()                 { return 0; }
-template <> inline void*                zeroise<void*>()                { return 0; }
-template <> inline std::string          zeroise<std::string>()          { return ""; }
-template <> inline orxonox::Radian      zeroise<orxonox::Radian>()      { return orxonox::Radian(0.0f); }
-template <> inline orxonox::Degree      zeroise<orxonox::Degree>()      { return orxonox::Degree(0.0f); }
-template <> inline orxonox::Vector2     zeroise<orxonox::Vector2>()     { return orxonox::Vector2    (0, 0)      ; }
-template <> inline orxonox::Vector3     zeroise<orxonox::Vector3>()     { return orxonox::Vector3    (0, 0, 0)   ; }
-template <> inline orxonox::Vector4     zeroise<orxonox::Vector4>()     { return orxonox::Vector4    (0, 0, 0, 0); }
-template <> inline orxonox::ColourValue zeroise<orxonox::ColourValue>() { return orxonox::ColourValue(0, 0, 0, 0); }
-template <> inline orxonox::Quaternion  zeroise<orxonox::Quaternion>()  { return orxonox::Quaternion (0, 0, 0, 0); }
-
-/**
-    @brief Interpolates between two values for a time between 0 and 1.
-    @param time The time is a value between 0 and 1 - the function returns start if time is 0 and end if time is 1 and interpolates if time is between 0 and 1.
-    @param start The value at time = 0
-    @param end The value at time = 1
-    @return The interpolation at a given time
-*/
-template <typename T>
-T interpolate(float time, const T& start, const T& end)
-{
-    return time * (end - start) + start;
-}
-
-/**
-    @brief Interpolates smoothly between two values for a time between 0 and 1. The function starts slowly, increases faster and stops slowly again.
-    @param time The time is a value between 0 and 1 - the function returns start if time is 0 and end if time is 1 and interpolates if time is between 0 and 1.
-    @param start The value at time = 0
-    @param end The value at time = 1
-    @return The smoothed interpolation at a given time
-*/
-template <typename T>
-T interpolateSmooth(float time, const T& start, const T& end)
-{
-    return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;
-}
-
-/**
-    @brief Returns a random number between 0 and almost 1: 0 <= rnd < 1.
-*/
-inline _UtilExport float rnd()
-{
-    return rand() / (RAND_MAX + 1.0);
-}
-
-/**
-    @brief Returns a random number between 0 and almost max: 0 <= rnd < max.
-    @param max The maximum
-*/
-inline _UtilExport float rnd(float max)
-{
-    return rnd() * max;
-}
-
-/**
-    @brief Returns a random number between min and almost max: min <= rnd < max.
-    @param min The minimum
-    @param max The maximum
-*/
-inline _UtilExport float rnd(float min, float max)
-{
-    return rnd(max - min) + min;
-}
-
-_UtilExport unsigned long getUniqueNumber();
-
-class _UtilExport IntVector2
-{
-public:
-  IntVector2() : x(0), y(0) { }
-  IntVector2(int _x, int _y) : x(_x), y(_y) { }
-  int x;
-  int y;
-};
-
-class _UtilExport IntVector3
-{
-public:
-  IntVector3() : x(0), y(0), z(0) { }
-  IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
-  int x;
-  int y;
-  int z;
-};
-
 #endif /* _Util_Math_H__ */
Index: /code/trunk/src/util/MathConvert.h
===================================================================
--- /code/trunk/src/util/MathConvert.h	(revision 2170)
+++ /code/trunk/src/util/MathConvert.h	(revision 2171)
@@ -40,168 +40,170 @@
 #include "Convert.h"
 
-
-////////////////////
-// Math to string //
-////////////////////
-
-// Vector2 to std::string
-template <>
-struct ConverterExplicit<orxonox::Vector2, std::string>
+namespace orxonox
 {
-    static bool convert(std::string* output, const orxonox::Vector2& input)
-    {
-        std::ostringstream ostream;
-        if (ostream << input.x << "," << input.y)
-        {
-            (*output) = ostream.str();
-            return true;
-        }
-        return false;
-    }
-};
-
-// Vector3 to std::string
-template <>
-struct ConverterExplicit<orxonox::Vector3, std::string>
-{
-    static bool convert(std::string* output, const orxonox::Vector3& input)
-    {
-        std::ostringstream ostream;
-        if (ostream << input.x << "," << input.y << "," << input.z)
-        {
-            (*output) = ostream.str();
-            return true;
-        }
-        return false;
-    }
-};
-
-// Vector4 to std::string
-template <>
-struct ConverterExplicit<orxonox::Vector4, std::string>
-{
-    static bool convert(std::string* output, const orxonox::Vector4& input)
-    {
-        std::ostringstream ostream;
-        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
-        {
-            (*output) = ostream.str();
-            return true;
-        }
-        return false;
-    }
-};
-
-// Quaternion to std::string
-template <>
-struct ConverterExplicit<orxonox::Quaternion, std::string>
-{
-    static bool convert(std::string* output, const orxonox::Quaternion& input)
-    {
-        std::ostringstream ostream;
-        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
-        {
-            (*output) = ostream.str();
-            return true;
-        }
-        return false;
-    }
-};
-
-// ColourValue to std::string
-template <>
-struct ConverterExplicit<orxonox::ColourValue, std::string>
-{
-    static bool convert(std::string* output, const orxonox::ColourValue& input)
-    {
-        std::ostringstream ostream;
-        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
-        {
-            (*output) = ostream.str();
-            return true;
-        }
-        return false;
-    }
-};
-
-
-////////////////////
-// string to Math //
-////////////////////
-
-// std::string to Vector2
-template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector2>
-{ static bool convert(orxonox::Vector2*     output, const std::string& input); };
-// std::string to Vector3
-template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector3>
-{ static bool convert(orxonox::Vector3*     output, const std::string& input); };
-// std::string to Vector4
-template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector4>
-{ static bool convert(orxonox::Vector4*     output, const std::string& input); };
-// std::string to Quaternion
-template <> struct _UtilExport ConverterFallback<std::string, orxonox::Quaternion>
-{ static bool convert(orxonox::Quaternion*  output, const std::string& input); };
-// std::string to ColourValue
-template <> struct _UtilExport ConverterFallback<std::string, orxonox::ColourValue>
-{ static bool convert(orxonox::ColourValue* output, const std::string& input); };
-
-
-///////////////////////////////
-// From and to Radian/Degree //
-///////////////////////////////
-
-// From Radian
-template <class ToType>
-struct ConverterFallback<orxonox::Radian, ToType>
-{
-    static bool convert(ToType* output, const orxonox::Radian& input)
-    {
-        return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
-    }
-};
-
-// From Degree
-template <class ToType>
-struct ConverterFallback<orxonox::Degree, ToType>
-{
-    static bool convert(ToType* output, const orxonox::Degree& input)
-    {
-        return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
-    }
-};
-
-// To Radian
-template <class FromType>
-struct ConverterFallback<FromType, orxonox::Radian>
-{
-    static bool convert(orxonox::Radian* output, const FromType& input)
-    {
-        float temp;
-        if (convertValue(&temp, input))
-        {
-            *output = temp;
-            return true;
-        }
-        else
-            return false;
-    }
-};
-
-// To Degree
-template <class FromType>
-struct ConverterFallback<FromType, orxonox::Degree>
-{
-    static bool convert(orxonox::Degree* output, const FromType& input)
-    {
-        float temp;
-        if (convertValue(&temp, input))
-        {
-            *output = temp;
-            return true;
-        }
-        else
-            return false;
-    }
-};
+    ////////////////////
+    // Math to string //
+    ////////////////////
+
+    // Vector2 to std::string
+    template <>
+    struct ConverterExplicit<orxonox::Vector2, std::string>
+    {
+        static bool convert(std::string* output, const orxonox::Vector2& input)
+        {
+            std::ostringstream ostream;
+            if (ostream << input.x << "," << input.y)
+            {
+                (*output) = ostream.str();
+                return true;
+            }
+            return false;
+        }
+    };
+
+    // Vector3 to std::string
+    template <>
+    struct ConverterExplicit<orxonox::Vector3, std::string>
+    {
+        static bool convert(std::string* output, const orxonox::Vector3& input)
+        {
+            std::ostringstream ostream;
+            if (ostream << input.x << "," << input.y << "," << input.z)
+            {
+                (*output) = ostream.str();
+                return true;
+            }
+            return false;
+        }
+    };
+
+    // Vector4 to std::string
+    template <>
+    struct ConverterExplicit<orxonox::Vector4, std::string>
+    {
+        static bool convert(std::string* output, const orxonox::Vector4& input)
+        {
+            std::ostringstream ostream;
+            if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+            {
+                (*output) = ostream.str();
+                return true;
+            }
+            return false;
+        }
+    };
+
+    // Quaternion to std::string
+    template <>
+    struct ConverterExplicit<orxonox::Quaternion, std::string>
+    {
+        static bool convert(std::string* output, const orxonox::Quaternion& input)
+        {
+            std::ostringstream ostream;
+            if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+            {
+                (*output) = ostream.str();
+                return true;
+            }
+            return false;
+        }
+    };
+
+    // ColourValue to std::string
+    template <>
+    struct ConverterExplicit<orxonox::ColourValue, std::string>
+    {
+        static bool convert(std::string* output, const orxonox::ColourValue& input)
+        {
+            std::ostringstream ostream;
+            if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+            {
+                (*output) = ostream.str();
+                return true;
+            }
+            return false;
+        }
+    };
+
+
+    ////////////////////
+    // string to Math //
+    ////////////////////
+
+    // std::string to Vector2
+    template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector2>
+    { static bool convert(orxonox::Vector2*     output, const std::string& input); };
+    // std::string to Vector3
+    template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector3>
+    { static bool convert(orxonox::Vector3*     output, const std::string& input); };
+    // std::string to Vector4
+    template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector4>
+    { static bool convert(orxonox::Vector4*     output, const std::string& input); };
+    // std::string to Quaternion
+    template <> struct _UtilExport ConverterFallback<std::string, orxonox::Quaternion>
+    { static bool convert(orxonox::Quaternion*  output, const std::string& input); };
+    // std::string to ColourValue
+    template <> struct _UtilExport ConverterFallback<std::string, orxonox::ColourValue>
+    { static bool convert(orxonox::ColourValue* output, const std::string& input); };
+
+
+    ///////////////////////////////
+    // From and to Radian/Degree //
+    ///////////////////////////////
+
+    // From Radian
+    template <class ToType>
+    struct ConverterFallback<orxonox::Radian, ToType>
+    {
+        static bool convert(ToType* output, const orxonox::Radian& input)
+        {
+            return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
+        }
+    };
+
+    // From Degree
+    template <class ToType>
+    struct ConverterFallback<orxonox::Degree, ToType>
+    {
+        static bool convert(ToType* output, const orxonox::Degree& input)
+        {
+            return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
+        }
+    };
+
+    // To Radian
+    template <class FromType>
+    struct ConverterFallback<FromType, orxonox::Radian>
+    {
+        static bool convert(orxonox::Radian* output, const FromType& input)
+        {
+            float temp;
+            if (convertValue(&temp, input))
+            {
+                *output = temp;
+                return true;
+            }
+            else
+                return false;
+        }
+    };
+
+    // To Degree
+    template <class FromType>
+    struct ConverterFallback<FromType, orxonox::Degree>
+    {
+        static bool convert(orxonox::Degree* output, const FromType& input)
+        {
+            float temp;
+            if (convertValue(&temp, input))
+            {
+                *output = temp;
+                return true;
+            }
+            else
+                return false;
+        }
+    };
+}
 
 #endif /* _MathConvert_H__ */
Index: /code/trunk/src/util/MultiType.cc
===================================================================
--- /code/trunk/src/util/MultiType.cc	(revision 2170)
+++ /code/trunk/src/util/MultiType.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file MultiType.cc
+    @file
     @brief Implementation of the MultiType.
 */
@@ -35,169 +35,172 @@
 #include "MultiTypeValue.h"
 
-/**
-    @brief Converts the current value of the MultiType to a new type.
-    @param type The type
-*/
-bool MultiType::convert(MT_Type type)
+namespace orxonox
 {
-    switch (type)
+    /**
+        @brief Converts the current value of the MultiType to a new type.
+        @param type The type
+    */
+    bool MultiType::convert(MT_Type type)
     {
-        case MT_char:
-            return this->convert<char>(); break;
-        case MT_uchar:
-            return this->convert<unsigned char>(); break;
-        case MT_short:
-            return this->convert<short>(); break;
-        case MT_ushort:
-            return this->convert<unsigned short>(); break;
-        case MT_int:
-            return this->convert<int>(); break;
-        case MT_uint:
-            return this->convert<unsigned int>(); break;
-        case MT_long:
-            return this->convert<long>(); break;
-        case MT_ulong:
-            return this->convert<unsigned long>(); break;
-        case MT_longlong:
-            return this->convert<long long>(); break;
-        case MT_ulonglong:
-            return this->convert<unsigned long long>(); break;
-        case MT_float:
-            return this->convert<float>(); break;
-        case MT_double:
-            return this->convert<double>(); break;
-        case MT_longdouble:
-            return this->convert<long double>(); break;
-        case MT_bool:
-            return this->convert<bool>(); break;
-        case MT_void:
-            return this->convert<void*>(); break;
-        case MT_string:
-            return this->convert<std::string>(); break;
-        case MT_vector2:
-            return this->convert<orxonox::Vector2>(); break;
-        case MT_vector3:
-            return this->convert<orxonox::Vector3>(); break;
-        case MT_vector4:
-            return this->convert<orxonox::Vector4>(); break;
-        case MT_colourvalue:
-            return this->convert<orxonox::ColourValue>(); break;
-        case MT_quaternion:
-            return this->convert<orxonox::Quaternion>(); break;
-        case MT_radian:
-            return this->convert<orxonox::Radian>(); break;
-        case MT_degree:
-            return this->convert<orxonox::Degree>(); break;
-        default:
-            this->reset(); return false; break;
-    };
+        switch (type)
+        {
+            case MT_char:
+                return this->convert<char>(); break;
+            case MT_uchar:
+                return this->convert<unsigned char>(); break;
+            case MT_short:
+                return this->convert<short>(); break;
+            case MT_ushort:
+                return this->convert<unsigned short>(); break;
+            case MT_int:
+                return this->convert<int>(); break;
+            case MT_uint:
+                return this->convert<unsigned int>(); break;
+            case MT_long:
+                return this->convert<long>(); break;
+            case MT_ulong:
+                return this->convert<unsigned long>(); break;
+            case MT_longlong:
+                return this->convert<long long>(); break;
+            case MT_ulonglong:
+                return this->convert<unsigned long long>(); break;
+            case MT_float:
+                return this->convert<float>(); break;
+            case MT_double:
+                return this->convert<double>(); break;
+            case MT_longdouble:
+                return this->convert<long double>(); break;
+            case MT_bool:
+                return this->convert<bool>(); break;
+            case MT_void:
+                return this->convert<void*>(); break;
+            case MT_string:
+                return this->convert<std::string>(); break;
+            case MT_vector2:
+                return this->convert<orxonox::Vector2>(); break;
+            case MT_vector3:
+                return this->convert<orxonox::Vector3>(); break;
+            case MT_vector4:
+                return this->convert<orxonox::Vector4>(); break;
+            case MT_colourvalue:
+                return this->convert<orxonox::ColourValue>(); break;
+            case MT_quaternion:
+                return this->convert<orxonox::Quaternion>(); break;
+            case MT_radian:
+                return this->convert<orxonox::Radian>(); break;
+            case MT_degree:
+                return this->convert<orxonox::Degree>(); break;
+            default:
+                this->reset(); return false; break;
+        };
+    }
+
+    /**
+        @brief Returns the name of the current type.
+        @return The name
+    */
+    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;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? ((MT_Value<unsigned char>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? ((MT_Value<short>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? ((MT_Value<unsigned short>      *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? ((MT_Value<int>                 *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? ((MT_Value<unsigned int>        *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? ((MT_Value<long>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? ((MT_Value<unsigned long>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? ((MT_Value<long long>           *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    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;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? ((MT_Value<float>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? ((MT_Value<double>              *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? ((MT_Value<long double>         *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? ((MT_Value<bool>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? ((MT_Value<void*>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? ((MT_Value<std::string>         *)this->value_)->value_ : (*this->value_)) : zeroise<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? ((MT_Value<orxonox::Vector2>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? ((MT_Value<orxonox::Vector3>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? ((MT_Value<orxonox::Vector4>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? ((MT_Value<orxonox::ColourValue>*)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? ((MT_Value<orxonox::Quaternion> *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? ((MT_Value<orxonox::Radian>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
+    MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? ((MT_Value<orxonox::Degree>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
+
+    template <> void MultiType::createNewValueContainer(const char& value)                 { this->value_ = new MT_Value<char>                (value, MT_char       ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const unsigned char& value)        { this->value_ = new MT_Value<unsigned char>       (value, MT_uchar      ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const short& value)                { this->value_ = new MT_Value<short>               (value, MT_short      ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const unsigned short& value)       { this->value_ = new MT_Value<unsigned short>      (value, MT_ushort     ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const int& value)                  { this->value_ = new MT_Value<int>                 (value, MT_int        ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const unsigned int& value)         { this->value_ = new MT_Value<unsigned int>        (value, MT_uint       ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const long& value)                 { this->value_ = new MT_Value<long>                (value, MT_long       ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const unsigned long& value)        { this->value_ = new MT_Value<unsigned long>       (value, MT_ulong      ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const long long& value)            { this->value_ = new MT_Value<long long>           (value, MT_longlong   ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const unsigned long long& value)   { this->value_ = new MT_Value<unsigned long long>  (value, MT_ulonglong  ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const float& value)                { this->value_ = new MT_Value<float>               (value, MT_float      ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const double& value)               { this->value_ = new MT_Value<double>              (value, MT_double     ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const long double& value)          { this->value_ = new MT_Value<long double>         (value, MT_longdouble ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const bool& value)                 { this->value_ = new MT_Value<bool>                (value, MT_bool       ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(      void* const& value)          { this->value_ = new MT_Value<void*>               (value, MT_void       ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const std::string& value)          { this->value_ = new MT_Value<std::string>         (value, MT_string     ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value)     { this->value_ = new MT_Value<orxonox::Vector2>    (value, MT_vector2    ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value)     { this->value_ = new MT_Value<orxonox::Vector3>    (value, MT_vector3    ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value)     { this->value_ = new MT_Value<orxonox::Vector4>    (value, MT_vector4    ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value) { this->value_ = new MT_Value<orxonox::ColourValue>(value, MT_colourvalue); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value)  { this->value_ = new MT_Value<orxonox::Quaternion> (value, MT_quaternion ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Radian& value)      { this->value_ = new MT_Value<orxonox::Radian>     (value, MT_radian     ); } /** @brief Creates a new value container for the given type. */
+    template <> void MultiType::createNewValueContainer(const orxonox::Degree& value)      { this->value_ = new MT_Value<orxonox::Degree>     (value, MT_degree     ); } /** @brief Creates a new value container for the given type. */
 }
-
-/**
-    @brief Returns the name of the current type.
-    @return The name
-*/
-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;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? ((MT_Value<unsigned char>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? ((MT_Value<short>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? ((MT_Value<unsigned short>      *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? ((MT_Value<int>                 *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? ((MT_Value<unsigned int>        *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? ((MT_Value<long>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? ((MT_Value<unsigned long>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? ((MT_Value<long long>           *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-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;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? ((MT_Value<float>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? ((MT_Value<double>              *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? ((MT_Value<long double>         *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? ((MT_Value<bool>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? ((MT_Value<void*>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? ((MT_Value<std::string>         *)this->value_)->value_ : (*this->value_)) : zeroise<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? ((MT_Value<orxonox::Vector2>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? ((MT_Value<orxonox::Vector3>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? ((MT_Value<orxonox::Vector4>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? ((MT_Value<orxonox::ColourValue>*)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? ((MT_Value<orxonox::Quaternion> *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? ((MT_Value<orxonox::Radian>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
-MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? ((MT_Value<orxonox::Degree>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
-
-template <> void MultiType::createNewValueContainer(const char& value)                 { this->value_ = new MT_Value<char>                (value, MT_char       ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const unsigned char& value)        { this->value_ = new MT_Value<unsigned char>       (value, MT_uchar      ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const short& value)                { this->value_ = new MT_Value<short>               (value, MT_short      ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const unsigned short& value)       { this->value_ = new MT_Value<unsigned short>      (value, MT_ushort     ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const int& value)                  { this->value_ = new MT_Value<int>                 (value, MT_int        ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const unsigned int& value)         { this->value_ = new MT_Value<unsigned int>        (value, MT_uint       ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const long& value)                 { this->value_ = new MT_Value<long>                (value, MT_long       ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const unsigned long& value)        { this->value_ = new MT_Value<unsigned long>       (value, MT_ulong      ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const long long& value)            { this->value_ = new MT_Value<long long>           (value, MT_longlong   ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const unsigned long long& value)   { this->value_ = new MT_Value<unsigned long long>  (value, MT_ulonglong  ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const float& value)                { this->value_ = new MT_Value<float>               (value, MT_float      ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const double& value)               { this->value_ = new MT_Value<double>              (value, MT_double     ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const long double& value)          { this->value_ = new MT_Value<long double>         (value, MT_longdouble ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const bool& value)                 { this->value_ = new MT_Value<bool>                (value, MT_bool       ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(      void* const& value)          { this->value_ = new MT_Value<void*>               (value, MT_void       ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const std::string& value)          { this->value_ = new MT_Value<std::string>         (value, MT_string     ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value)     { this->value_ = new MT_Value<orxonox::Vector2>    (value, MT_vector2    ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value)     { this->value_ = new MT_Value<orxonox::Vector3>    (value, MT_vector3    ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value)     { this->value_ = new MT_Value<orxonox::Vector4>    (value, MT_vector4    ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value) { this->value_ = new MT_Value<orxonox::ColourValue>(value, MT_colourvalue); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value)  { this->value_ = new MT_Value<orxonox::Quaternion> (value, MT_quaternion ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Radian& value)      { this->value_ = new MT_Value<orxonox::Radian>     (value, MT_radian     ); } /** @brief Creates a new value container for the given type. */
-template <> void MultiType::createNewValueContainer(const orxonox::Degree& value)      { this->value_ = new MT_Value<orxonox::Degree>     (value, MT_degree     ); } /** @brief Creates a new value container for the given type. */
Index: /code/trunk/src/util/MultiType.h
===================================================================
--- /code/trunk/src/util/MultiType.h	(revision 2170)
+++ /code/trunk/src/util/MultiType.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file MultiType.h
+    @file
     @brief Declaration of the MultiType and some helper constructs.
 
@@ -73,453 +73,458 @@
 #include "Math.h"
 
-/**
-    @brief Enum of all possible types of a MultiType.
-*/
-enum MT_Type
+namespace orxonox
 {
-    MT_null,
-    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_void,
-    MT_string,
-    MT_vector2,
-    MT_vector3,
-    MT_vector4,
-    MT_colourvalue,
-    MT_quaternion,
-    MT_radian,
-    MT_degree
-};
-
-/**
-    @brief The MultiType can hold a value of many possible types and convert them to other types.
-
-    The following types are supported by the MultiType:
-     - all primitves
-     - all pointers
-     - string
-     - Vector2, Vector3, Vector4
-     - Quaternion
-     - ColourValue
-     - Radian, Degree
-
-    The internal type of a MultiType is determined by the first assigned value, but can be
-    changed by using setType<T>(), convert<T>() or setValue<T>(value). If a value gets assigned
-    the normal way (operator=, setValue(value)), the value gets converted to the current internal
-    type of the MultiType.
-*/
-class _UtilExport MultiType
-{
-    _UtilExport friend std::ostream& operator<<(std::ostream& outstream, const MultiType& mt);
-    template <typename T> friend struct MT_Value;
-
     /**
-        @brief MT_ValueBase is an almost pure virtual baseclass of MT_Value<T>, which holds the value of the MultiType.
-        This class is only used within the MultiType.
+        @brief Enum of all possible types of a MultiType.
     */
-    struct _UtilExport MT_ValueBase
+    enum MT_Type
     {
-        MT_ValueBase(MT_Type type) : type_(type), bHasDefaultValue_(false) {}
-        virtual ~MT_ValueBase() {}
-
-        virtual MT_ValueBase* clone() const = 0;
-
-        virtual void reset() = 0;
-        virtual bool assimilate(const MultiType& other) = 0;
-
-        /** @brief Returns the type of the current value. */
-        const MT_Type& getType() const { return this->type_; }
-
-        /** @brief Checks whether the value is a default one. */
-        bool hasDefaultValue()   const { return this->bHasDefaultValue_; }
-
-        virtual bool setValue(const char& value)                 = 0;
-        virtual bool setValue(const unsigned char& value)        = 0;
-        virtual bool setValue(const short& value)                = 0;
-        virtual bool setValue(const unsigned short& value)       = 0;
-        virtual bool setValue(const int& value)                  = 0;
-        virtual bool setValue(const unsigned int& value)         = 0;
-        virtual bool setValue(const long& value)                 = 0;
-        virtual bool setValue(const unsigned long& value)        = 0;
-        virtual bool setValue(const long long& value)            = 0;
-        virtual bool setValue(const unsigned long long& value)   = 0;
-        virtual bool setValue(const float& value)                = 0;
-        virtual bool setValue(const double& value)               = 0;
-        virtual bool setValue(const long double& value)          = 0;
-        virtual bool setValue(const bool& value)                 = 0;
-        virtual bool setValue(      void* const& value)          = 0;
-        virtual bool setValue(const std::string& value)          = 0;
-        virtual bool setValue(const orxonox::Vector2& value)     = 0;
-        virtual bool setValue(const orxonox::Vector3& value)     = 0;
-        virtual bool setValue(const orxonox::Vector4& value)     = 0;
-        virtual bool setValue(const orxonox::ColourValue& value) = 0;
-        virtual bool setValue(const orxonox::Quaternion& value)  = 0;
-        virtual bool setValue(const orxonox::Radian& value)      = 0;
-        virtual bool setValue(const orxonox::Degree& value)      = 0;
-
-        virtual bool getValue(char*                 value) const = 0;
-        virtual bool getValue(unsigned char*        value) const = 0;
-        virtual bool getValue(short*                value) const = 0;
-        virtual bool getValue(unsigned short*       value) const = 0;
-        virtual bool getValue(int*                  value) const = 0;
-        virtual bool getValue(unsigned int*         value) const = 0;
-        virtual bool getValue(long*                 value) const = 0;
-        virtual bool getValue(unsigned long*        value) const = 0;
-        virtual bool getValue(long long*            value) const = 0;
-        virtual bool getValue(unsigned long long*   value) const = 0;
-        virtual bool getValue(float*                value) const = 0;
-        virtual bool getValue(double*               value) const = 0;
-        virtual bool getValue(long double*          value) const = 0;
-        virtual bool getValue(bool*                 value) const = 0;
-        virtual bool getValue(void**                value) const = 0;
-        virtual bool getValue(std::string*          value) const = 0;
-        virtual bool getValue(orxonox::Vector2*     value) const = 0;
-        virtual bool getValue(orxonox::Vector3*     value) const = 0;
-        virtual bool getValue(orxonox::Vector4*     value) const = 0;
-        virtual bool getValue(orxonox::ColourValue* value) const = 0;
-        virtual bool getValue(orxonox::Quaternion*  value) const = 0;
-        virtual bool getValue(orxonox::Radian*      value) const = 0;
-        virtual bool getValue(orxonox::Degree*      value) const = 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_;          //!< The type of the current value
-        bool bHasDefaultValue_; //!< True if the last conversion wasn't successful
+        MT_null,
+        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_void,
+        MT_string,
+        MT_vector2,
+        MT_vector3,
+        MT_vector4,
+        MT_colourvalue,
+        MT_quaternion,
+        MT_radian,
+        MT_degree
     };
 
+    /**
+        @brief The MultiType can hold a value of many possible types and convert them to other types.
+
+        The following types are supported by the MultiType:
+         - all primitves
+         - all pointers
+         - string
+         - Vector2, Vector3, Vector4
+         - Quaternion
+         - ColourValue
+         - Radian, Degree
+
+        The internal type of a MultiType is determined by the first assigned value, but can be
+        changed by using setType<T>(), convert<T>() or setValue<T>(value). If a value gets assigned
+        the normal way (operator=, setValue(value)), the value gets converted to the current internal
+        type of the MultiType.
+    */
+    class _UtilExport MultiType
+    {
+        _UtilExport friend std::ostream& operator<<(std::ostream& outstream, const MultiType& mt);
+        template <typename T> friend class MT_Value;
+
     public:
-        inline MultiType()                                  : value_(0) {}                                      /** @brief Default constructor: Assigns no value and no type. The type will be determined by the first assignment of a value. */
-        inline MultiType(const char& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const unsigned char& value)        : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const short& value)                : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const unsigned short& value)       : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const int& value)                  : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const unsigned int& value)         : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const long& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const unsigned long& value)        : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const long long& value)            : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const unsigned long long& value)   : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const float& value)                : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const double& value)               : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const long double& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const bool& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(      void* const& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const std::string& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Vector2& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Vector3& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Vector4& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::ColourValue& value) : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Quaternion& value)  : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
-        inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); } /** @brief Constructor: Converts the char array to a std::string, assigns the value and sets the type. */
-        inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }              /** @brief Copyconstructor: Assigns value and type of the other MultiType. */
-        inline MultiType(MT_Type type)                      : value_(0) { this->setType(type); }                /** @brief Constructor: Sets the type, the next assignment will determine the value. */
-
-        /** @brief Destructor: Deletes the MT_Value. */
-        inline ~MultiType() { if (this->value_) { delete this->value_; } }
-
-        template <typename V> inline const MultiType& operator=(const V& value)         { this->setValue(value); return (*this); } /** @brief Assigns a new value. The value will be converted to the current type of the MultiType. */
-        template <typename V> inline const MultiType& operator=(V* value)               { this->setValue(value); return (*this); } /** @brief Assigns a pointer. */
-        inline                       const MultiType& operator=(const MultiType& other) { this->setValue(other); return (*this); } /** @brief Assigns the value of the other MultiType and converts it to the current type of the MultiType. */
-        inline                       const MultiType& operator=(MT_Type type)           { this->setType(type);   return (*this); } /** @brief Resets the value and changes the type. */
-
-        inline bool                                   setValue(const char& value);
-        inline bool                                   setValue(const unsigned char& value);
-        inline bool                                   setValue(const short& value);
-        inline bool                                   setValue(const unsigned short& value);
-        inline bool                                   setValue(const int& value);
-        inline bool                                   setValue(const unsigned int& value);
-        inline bool                                   setValue(const long& value);
-        inline bool                                   setValue(const unsigned long& value);
-        inline bool                                   setValue(const long long& value);
-        inline bool                                   setValue(const unsigned long long& value);
-        inline bool                                   setValue(const float& value);
-        inline bool                                   setValue(const double& value);
-        inline bool                                   setValue(const long double& value);
-        inline bool                                   setValue(const bool& value);
-        inline bool                                   setValue(      void* const& value);
-        inline bool                                   setValue(const std::string& value);
-        inline bool                                   setValue(const orxonox::Vector2& value);
-        inline bool                                   setValue(const orxonox::Vector3& value);
-        inline bool                                   setValue(const orxonox::Vector4& value);
-        inline bool                                   setValue(const orxonox::ColourValue& value);
-        inline bool                                   setValue(const orxonox::Quaternion& value);
-        inline bool                                   setValue(const orxonox::Radian& value);
-        inline bool                                   setValue(const orxonox::Degree& value);
-        inline bool                                   setValue(const char* value);
-        /** @brief Assigns a pointer. */
-        template <typename V> inline bool             setValue(V* value)               { if (this->value_) { return this->value_->setValue((void*)value); } else { return this->assignValue((void*)value); } }
-        /** @brief Assigns the value of the other MultiType and converts it to the current type. */
-        bool                                          setValue(const MultiType& other) { if (this->value_) { return this->value_->assimilate(other); } else { if (other.value_) { this->value_ = other.value_->clone(); } return true; } }
-        /** @brief Changes the type to T and assigns the new value (which might be of another type than T - it gets converted). */
-        template <typename T, typename V> inline bool setValue(const V& value) { this->setType<T>(); return this->setValue(value); }
-
-
-        /** @brief Copies the other MultiType by assigning value and type. */
-        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 bool convert()                       { return this->setValue<T>((T)(*this));  } /** @brief Converts the current value to type T. */
-        inline bool                       convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
-        bool                              convert(MT_Type type);
-
-        /** @brief Current content gets deleted. New type is MT_null */
-        inline void                       reset()                         { if (this->value_) this->value_->reset(); }
-
-        template <typename T> inline void setType()                       { this->assignValue(T());                            } /** @brief Resets the value and changes the internal type to T. */
-        inline void                       setType(const MultiType& other) { this->setType(other.getType());                    } /** @brief Resets the value and changes the internal type to the type of the other MultiType. */
-        inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); this->reset(); } /** @brief Resets the value and changes the internal type to the given type. */
-
-        /** @brief Returns the current type. */
-        inline MT_Type                    getType()                 const { return (this->value_) ? this->value_->type_ : MT_null; }
-        /** @brief Returns true if the current type equals the given type. */
-        inline bool                       isType(MT_Type type)      const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_null); }
-        /** @brief Returns true if the current type is T. */
-        template <typename T> inline bool isType()                  const { return false; } // Only works for specialized values - see below
-        std::string                       getTypename()             const;
-
-        /** @brief Checks whether the value is a default one. */
-        bool                              hasDefaultValue()         const { return this->value_->hasDefaultValue(); }
-
-        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;
-        /** @brief Returns the current value, converted to a T* pointer. */
-        template <class T> operator T*() const { return ((T*)this->operator void*()); }
-
-        inline bool getValue(char*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(unsigned char*        value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(short*                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(unsigned short*       value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(int*                  value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(unsigned int*         value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(long*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(unsigned long*        value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(long long*            value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(unsigned long long*   value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(float*                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(double*               value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(long double*          value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(bool*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(void**                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(std::string*          value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Vector2*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Vector3*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Vector4*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::ColourValue* value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Quaternion*  value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Radian*      value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-        inline bool getValue(orxonox::Degree*      value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-
-        inline char                     getChar()             const { return this->operator char();                 } /** @brief Returns the current value, converted to the requested type. */
-        inline unsigned char            getUnsignedChar()     const { return this->operator unsigned char();        } /** @brief Returns the current value, converted to the requested type. */
-        inline short                    getShort()            const { return this->operator short();                } /** @brief Returns the current value, converted to the requested type. */
-        inline unsigned short           getUnsignedShort()    const { return this->operator unsigned short();       } /** @brief Returns the current value, converted to the requested type. */
-        inline int                      getInt()              const { return this->operator int();                  } /** @brief Returns the current value, converted to the requested type. */
-        inline unsigned int             getUnsignedInt()      const { return this->operator unsigned int();         } /** @brief Returns the current value, converted to the requested type. */
-        inline long                     getLong()             const { return this->operator long();                 } /** @brief Returns the current value, converted to the requested type. */
-        inline unsigned long            getUnsignedLong()     const { return this->operator unsigned long();        } /** @brief Returns the current value, converted to the requested type. */
-        inline long long                getLongLong()         const { return this->operator long long();            } /** @brief Returns the current value, converted to the requested type. */
-        inline unsigned long long       getUnsignedLongLong() const { return this->operator unsigned long long();   } /** @brief Returns the current value, converted to the requested type. */
-        inline float                    getFloat()            const { return this->operator float();                } /** @brief Returns the current value, converted to the requested type. */
-        inline double                   getDouble()           const { return this->operator double();               } /** @brief Returns the current value, converted to the requested type. */
-        inline long double              getLongDouble()       const { return this->operator long double();          } /** @brief Returns the current value, converted to the requested type. */
-        inline bool                     getBool()             const { return this->operator bool();                 } /** @brief Returns the current value, converted to the requested type. */
-        inline void*                    getVoid()             const { return this->operator void*();                } /** @brief Returns the current value, converted to the requested type. */
-        inline std::string              getString()           const { return this->operator std::string();          } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Vector2         getVector2()          const { return this->operator orxonox::Vector2();     } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Vector3         getVector3()          const { return this->operator orxonox::Vector3();     } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Vector4         getVector4()          const { return this->operator orxonox::Vector4();     } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::ColourValue     getColourValue()      const { return this->operator orxonox::ColourValue(); } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Quaternion      getQuaternion()       const { return this->operator orxonox::Quaternion();  } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Radian          getRadian()           const { return this->operator orxonox::Radian();      } /** @brief Returns the current value, converted to the requested type. */
-        inline orxonox::Degree          getDegree()           const { return this->operator orxonox::Degree();      } /** @brief Returns the current value, converted to the requested type. */
-        template <typename T> inline T* getPointer()          const { return ((T*)this->getVoid());                 } /** @brief Returns the current value, converted to a T* pointer. */
-
-    private:
-        inline bool assignValue(const char& value)                 { if (this->value_ && this->value_->type_ == MT_char)        { return this->value_->setValue(value); } else { this->changeValueContainer<char>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const unsigned char& value)        { if (this->value_ && this->value_->type_ == MT_uchar)       { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value);        return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const short& value)                { if (this->value_ && this->value_->type_ == MT_short)       { return this->value_->setValue(value); } else { this->changeValueContainer<short>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const unsigned short& value)       { if (this->value_ && this->value_->type_ == MT_ushort)      { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value);       return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const int& value)                  { if (this->value_ && this->value_->type_ == MT_int)         { return this->value_->setValue(value); } else { this->changeValueContainer<int>(value);                  return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const unsigned int& value)         { if (this->value_ && this->value_->type_ == MT_uint)        { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value);         return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const long& value)                 { if (this->value_ && this->value_->type_ == MT_long)        { return this->value_->setValue(value); } else { this->changeValueContainer<long>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const unsigned long& value)        { if (this->value_ && this->value_->type_ == MT_ulong)       { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value);        return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const long long& value)            { if (this->value_ && this->value_->type_ == MT_longlong)    { return this->value_->setValue(value); } else { this->changeValueContainer<long long>(value);            return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const unsigned long long& value)   { if (this->value_ && this->value_->type_ == MT_ulonglong)   { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value);   return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const float& value)                { if (this->value_ && this->value_->type_ == MT_float)       { return this->value_->setValue(value); } else { this->changeValueContainer<float>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const double& value)               { if (this->value_ && this->value_->type_ == MT_double)      { return this->value_->setValue(value); } else { this->changeValueContainer<double>(value);               return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const long double& value)          { if (this->value_ && this->value_->type_ == MT_longdouble)  { return this->value_->setValue(value); } else { this->changeValueContainer<long double>(value);          return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const bool& value)                 { if (this->value_ && this->value_->type_ == MT_bool)        { return this->value_->setValue(value); } else { this->changeValueContainer<bool>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(      void* const& value)          { if (this->value_ && this->value_->type_ == MT_void)        { return this->value_->setValue(value); } else { this->changeValueContainer<void*>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const std::string& value)          { if (this->value_ && this->value_->type_ == MT_string)      { return this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value);          return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Vector2& value)     { if (this->value_ && this->value_->type_ == MT_vector2)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Vector3& value)     { if (this->value_ && this->value_->type_ == MT_vector3)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Vector4& value)     { if (this->value_ && this->value_->type_ == MT_vector4)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_colourvalue) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Quaternion& value)  { if (this->value_ && this->value_->type_ == MT_quaternion)  { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value);  return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Radian& value)      { if (this->value_ && this->value_->type_ == MT_radian)      { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value);      return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-        inline bool assignValue(const orxonox::Degree& value)      { if (this->value_ && this->value_->type_ == MT_degree)      { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value);      return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
-
-        /** @brief Changes the value container. */
-        template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
-        /** @brief Creates a new value container (works only with specialized types). */
-        template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); return false; }
-
-        MT_ValueBase* value_; //!< A pointer to the value container
-};
-
-/** @brief Puts the MultiType on a stream by using the native << operator of the current type. */
-_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);        } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<unsigned char>()        const { return (this->value_ && this->value_->type_ == MT_uchar);       } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<short>()                const { return (this->value_ && this->value_->type_ == MT_short);       } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<unsigned short>()       const { return (this->value_ && this->value_->type_ == MT_ushort);      } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<int>()                  const { return (this->value_ && this->value_->type_ == MT_int);         } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<unsigned int>()         const { return (this->value_ && this->value_->type_ == MT_uint);        } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<long>()                 const { return (this->value_ && this->value_->type_ == MT_long);        } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<unsigned long>()        const { return (this->value_ && this->value_->type_ == MT_ulong);       } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<long long>()            const { return (this->value_ && this->value_->type_ == MT_longlong);    } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<unsigned long long>()   const { return (this->value_ && this->value_->type_ == MT_ulonglong);   } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<float>()                const { return (this->value_ && this->value_->type_ == MT_float);       } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<double>()               const { return (this->value_ && this->value_->type_ == MT_double);      } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<long double>()          const { return (this->value_ && this->value_->type_ == MT_longdouble);  } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<bool>()                 const { return (this->value_ && this->value_->type_ == MT_bool);        } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<void*>()                const { return (this->value_ && this->value_->type_ == MT_void);        } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<std::string>()          const { return (this->value_ && this->value_->type_ == MT_string);      } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Vector2>()     const { return (this->value_ && this->value_->type_ == MT_vector2);     } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Vector3>()     const { return (this->value_ && this->value_->type_ == MT_vector3);     } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Vector4>()     const { return (this->value_ && this->value_->type_ == MT_vector4);     } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_colourvalue); } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Quaternion>()  const { return (this->value_ && this->value_->type_ == MT_quaternion);  } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Radian>()      const { return (this->value_ && this->value_->type_ == MT_radian);      } /** @brief Returns true if the current type equals the given type. */
-template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_degree);      } /** @brief Returns true if the current type equals the given type. */
-
-// Specialization to avoid ambiguities with the conversion operator
-template <> inline bool MultiType::convert<std::string>()          { return this->setValue<std::string>         (this->operator std::string());          } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Vector2>()     { return this->setValue<orxonox::Vector2>    (this->operator orxonox::Vector2());     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Vector3>()     { return this->setValue<orxonox::Vector3>    (this->operator orxonox::Vector3());     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Vector4>()     { return this->setValue<orxonox::Vector4>    (this->operator orxonox::Vector4());     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::ColourValue>() { return this->setValue<orxonox::ColourValue>(this->operator orxonox::ColourValue()); } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Quaternion>()  { return this->setValue<orxonox::Quaternion> (this->operator orxonox::Quaternion());  } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Radian>()      { return this->setValue<orxonox::Radian>     (this->operator orxonox::Radian());      } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<orxonox::Degree>()      { return this->setValue<orxonox::Degree>     (this->operator orxonox::Degree());      } /** @brief Converts the current value to the given type. */
-
-// Specialization to avoid ambiguities with the conversion operator
-template <> inline bool MultiType::convert<const std::string&>()          { return this->convert<std::string>();          } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Vector2&>()     { return this->convert<orxonox::Vector2>();     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Vector3&>()     { return this->convert<orxonox::Vector3>();     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Vector4&>()     { return this->convert<orxonox::Vector4>();     } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::ColourValue&>() { return this->convert<orxonox::ColourValue>(); } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Quaternion&>()  { return this->convert<orxonox::Quaternion>();  } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Radian&>()      { return this->convert<orxonox::Radian>();      } /** @brief Converts the current value to the given type. */
-template <> inline bool MultiType::convert<const orxonox::Degree&>()      { return this->convert<orxonox::Degree>();      } /** @brief Converts the current value to the given type. */
-
-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 bool MultiType::setValue(const char& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const unsigned char& value)         { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const short& value)                 { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const unsigned short& value)        { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const int& value)                   { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const unsigned int& value)          { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const long& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const unsigned long& value)         { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const long long& value)             { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const unsigned long long& value)    { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const float& value)                 { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const double& value)                { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const long double& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const bool& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(      void* const& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const std::string& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Vector2& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Vector3& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Vector4& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::ColourValue& value)  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Quaternion& value)   { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Radian& value)       { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-inline bool MultiType::setValue(const orxonox::Degree& value)       { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
-
-inline bool MultiType::setValue(const char* value)                  { if (this->value_) { return this->value_->setValue(std::string(value)); } else { return this->assignValue(std::string(value)); } }  /** @brief Assigns the given value and converts it to the current type. */
+        /**
+            @brief MT_ValueBase is an almost pure virtual baseclass of MT_Value<T>, which holds the value of the MultiType.
+            This class is only used within the MultiType.
+        */
+        class _UtilExport MT_ValueBase
+        {
+        public:
+            MT_ValueBase(MT_Type type) : type_(type), bHasDefaultValue_(false) {}
+            virtual ~MT_ValueBase() {}
+
+            virtual MT_ValueBase* clone() const = 0;
+
+            virtual void reset() = 0;
+            virtual bool assimilate(const MultiType& other) = 0;
+
+            /** @brief Returns the type of the current value. */
+            const MT_Type& getType() const { return this->type_; }
+
+            /** @brief Checks whether the value is a default one. */
+            bool hasDefaultValue()   const { return this->bHasDefaultValue_; }
+
+            virtual bool setValue(const char& value)                 = 0;
+            virtual bool setValue(const unsigned char& value)        = 0;
+            virtual bool setValue(const short& value)                = 0;
+            virtual bool setValue(const unsigned short& value)       = 0;
+            virtual bool setValue(const int& value)                  = 0;
+            virtual bool setValue(const unsigned int& value)         = 0;
+            virtual bool setValue(const long& value)                 = 0;
+            virtual bool setValue(const unsigned long& value)        = 0;
+            virtual bool setValue(const long long& value)            = 0;
+            virtual bool setValue(const unsigned long long& value)   = 0;
+            virtual bool setValue(const float& value)                = 0;
+            virtual bool setValue(const double& value)               = 0;
+            virtual bool setValue(const long double& value)          = 0;
+            virtual bool setValue(const bool& value)                 = 0;
+            virtual bool setValue(      void* const& value)          = 0;
+            virtual bool setValue(const std::string& value)          = 0;
+            virtual bool setValue(const orxonox::Vector2& value)     = 0;
+            virtual bool setValue(const orxonox::Vector3& value)     = 0;
+            virtual bool setValue(const orxonox::Vector4& value)     = 0;
+            virtual bool setValue(const orxonox::ColourValue& value) = 0;
+            virtual bool setValue(const orxonox::Quaternion& value)  = 0;
+            virtual bool setValue(const orxonox::Radian& value)      = 0;
+            virtual bool setValue(const orxonox::Degree& value)      = 0;
+
+            virtual bool getValue(char*                 value) const = 0;
+            virtual bool getValue(unsigned char*        value) const = 0;
+            virtual bool getValue(short*                value) const = 0;
+            virtual bool getValue(unsigned short*       value) const = 0;
+            virtual bool getValue(int*                  value) const = 0;
+            virtual bool getValue(unsigned int*         value) const = 0;
+            virtual bool getValue(long*                 value) const = 0;
+            virtual bool getValue(unsigned long*        value) const = 0;
+            virtual bool getValue(long long*            value) const = 0;
+            virtual bool getValue(unsigned long long*   value) const = 0;
+            virtual bool getValue(float*                value) const = 0;
+            virtual bool getValue(double*               value) const = 0;
+            virtual bool getValue(long double*          value) const = 0;
+            virtual bool getValue(bool*                 value) const = 0;
+            virtual bool getValue(void**                value) const = 0;
+            virtual bool getValue(std::string*          value) const = 0;
+            virtual bool getValue(orxonox::Vector2*     value) const = 0;
+            virtual bool getValue(orxonox::Vector3*     value) const = 0;
+            virtual bool getValue(orxonox::Vector4*     value) const = 0;
+            virtual bool getValue(orxonox::ColourValue* value) const = 0;
+            virtual bool getValue(orxonox::Quaternion*  value) const = 0;
+            virtual bool getValue(orxonox::Radian*      value) const = 0;
+            virtual bool getValue(orxonox::Degree*      value) const = 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_;          //!< The type of the current value
+            bool bHasDefaultValue_; //!< True if the last conversion wasn't successful
+        };
+
+        public:
+            inline MultiType()                                  : value_(0) {}                                      /** @brief Default constructor: Assigns no value and no type. The type will be determined by the first assignment of a value. */
+            inline MultiType(const char& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const unsigned char& value)        : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const short& value)                : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const unsigned short& value)       : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const int& value)                  : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const unsigned int& value)         : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const long& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const unsigned long& value)        : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const long long& value)            : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const unsigned long long& value)   : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const float& value)                : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const double& value)               : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const long double& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const bool& value)                 : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(      void* const& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const std::string& value)          : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Vector2& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Vector3& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Vector4& value)     : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::ColourValue& value) : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Quaternion& value)  : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
+            inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); } /** @brief Constructor: Converts the char array to a std::string, assigns the value and sets the type. */
+            inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }              /** @brief Copyconstructor: Assigns value and type of the other MultiType. */
+            inline MultiType(MT_Type type)                      : value_(0) { this->setType(type); }                /** @brief Constructor: Sets the type, the next assignment will determine the value. */
+
+            /** @brief Destructor: Deletes the MT_Value. */
+            inline ~MultiType() { if (this->value_) { delete this->value_; } }
+
+            template <typename V> inline const MultiType& operator=(const V& value)         { this->setValue(value); return (*this); } /** @brief Assigns a new value. The value will be converted to the current type of the MultiType. */
+            template <typename V> inline const MultiType& operator=(V* value)               { this->setValue(value); return (*this); } /** @brief Assigns a pointer. */
+            inline                       const MultiType& operator=(const MultiType& other) { this->setValue(other); return (*this); } /** @brief Assigns the value of the other MultiType and converts it to the current type of the MultiType. */
+            inline                       const MultiType& operator=(MT_Type type)           { this->setType(type);   return (*this); } /** @brief Resets the value and changes the type. */
+
+            inline bool                                   setValue(const char& value);
+            inline bool                                   setValue(const unsigned char& value);
+            inline bool                                   setValue(const short& value);
+            inline bool                                   setValue(const unsigned short& value);
+            inline bool                                   setValue(const int& value);
+            inline bool                                   setValue(const unsigned int& value);
+            inline bool                                   setValue(const long& value);
+            inline bool                                   setValue(const unsigned long& value);
+            inline bool                                   setValue(const long long& value);
+            inline bool                                   setValue(const unsigned long long& value);
+            inline bool                                   setValue(const float& value);
+            inline bool                                   setValue(const double& value);
+            inline bool                                   setValue(const long double& value);
+            inline bool                                   setValue(const bool& value);
+            inline bool                                   setValue(      void* const& value);
+            inline bool                                   setValue(const std::string& value);
+            inline bool                                   setValue(const orxonox::Vector2& value);
+            inline bool                                   setValue(const orxonox::Vector3& value);
+            inline bool                                   setValue(const orxonox::Vector4& value);
+            inline bool                                   setValue(const orxonox::ColourValue& value);
+            inline bool                                   setValue(const orxonox::Quaternion& value);
+            inline bool                                   setValue(const orxonox::Radian& value);
+            inline bool                                   setValue(const orxonox::Degree& value);
+            inline bool                                   setValue(const char* value);
+            /** @brief Assigns a pointer. */
+            template <typename V> inline bool             setValue(V* value)               { if (this->value_) { return this->value_->setValue((void*)value); } else { return this->assignValue((void*)value); } }
+            /** @brief Assigns the value of the other MultiType and converts it to the current type. */
+            bool                                          setValue(const MultiType& other) { if (this->value_) { return this->value_->assimilate(other); } else { if (other.value_) { this->value_ = other.value_->clone(); } return true; } }
+            /** @brief Changes the type to T and assigns the new value (which might be of another type than T - it gets converted). */
+            template <typename T, typename V> inline bool setValue(const V& value) { this->setType<T>(); return this->setValue(value); }
+
+
+            /** @brief Copies the other MultiType by assigning value and type. */
+            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 bool convert()                       { return this->setValue<T>((T)(*this));  } /** @brief Converts the current value to type T. */
+            inline bool                       convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
+            bool                              convert(MT_Type type);
+
+            /** @brief Current content gets deleted. New type is MT_null */
+            inline void                       reset()                         { if (this->value_) this->value_->reset(); }
+
+            template <typename T> inline void setType()                       { this->assignValue(T());                            } /** @brief Resets the value and changes the internal type to T. */
+            inline void                       setType(const MultiType& other) { this->setType(other.getType());                    } /** @brief Resets the value and changes the internal type to the type of the other MultiType. */
+            inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); this->reset(); } /** @brief Resets the value and changes the internal type to the given type. */
+
+            /** @brief Returns the current type. */
+            inline MT_Type                    getType()                 const { return (this->value_) ? this->value_->type_ : MT_null; }
+            /** @brief Returns true if the current type equals the given type. */
+            inline bool                       isType(MT_Type type)      const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_null); }
+            /** @brief Returns true if the current type is T. */
+            template <typename T> inline bool isType()                  const { return false; } // Only works for specialized values - see below
+            std::string                       getTypename()             const;
+
+            /** @brief Checks whether the value is a default one. */
+            bool                              hasDefaultValue()         const { return this->value_->hasDefaultValue(); }
+
+            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;
+            /** @brief Returns the current value, converted to a T* pointer. */
+            template <class T> operator T*() const { return ((T*)this->operator void*()); }
+
+            inline bool getValue(char*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(unsigned char*        value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(short*                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(unsigned short*       value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(int*                  value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(unsigned int*         value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(long*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(unsigned long*        value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(long long*            value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(unsigned long long*   value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(float*                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(double*               value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(long double*          value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(bool*                 value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(void**                value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(std::string*          value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Vector2*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Vector3*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Vector4*     value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::ColourValue* value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Quaternion*  value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Radian*      value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+            inline bool getValue(orxonox::Degree*      value) const { if (this->value_) { return this->value_->getValue(value); } return false; } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+
+            inline char                     getChar()             const { return this->operator char();                 } /** @brief Returns the current value, converted to the requested type. */
+            inline unsigned char            getUnsignedChar()     const { return this->operator unsigned char();        } /** @brief Returns the current value, converted to the requested type. */
+            inline short                    getShort()            const { return this->operator short();                } /** @brief Returns the current value, converted to the requested type. */
+            inline unsigned short           getUnsignedShort()    const { return this->operator unsigned short();       } /** @brief Returns the current value, converted to the requested type. */
+            inline int                      getInt()              const { return this->operator int();                  } /** @brief Returns the current value, converted to the requested type. */
+            inline unsigned int             getUnsignedInt()      const { return this->operator unsigned int();         } /** @brief Returns the current value, converted to the requested type. */
+            inline long                     getLong()             const { return this->operator long();                 } /** @brief Returns the current value, converted to the requested type. */
+            inline unsigned long            getUnsignedLong()     const { return this->operator unsigned long();        } /** @brief Returns the current value, converted to the requested type. */
+            inline long long                getLongLong()         const { return this->operator long long();            } /** @brief Returns the current value, converted to the requested type. */
+            inline unsigned long long       getUnsignedLongLong() const { return this->operator unsigned long long();   } /** @brief Returns the current value, converted to the requested type. */
+            inline float                    getFloat()            const { return this->operator float();                } /** @brief Returns the current value, converted to the requested type. */
+            inline double                   getDouble()           const { return this->operator double();               } /** @brief Returns the current value, converted to the requested type. */
+            inline long double              getLongDouble()       const { return this->operator long double();          } /** @brief Returns the current value, converted to the requested type. */
+            inline bool                     getBool()             const { return this->operator bool();                 } /** @brief Returns the current value, converted to the requested type. */
+            inline void*                    getVoid()             const { return this->operator void*();                } /** @brief Returns the current value, converted to the requested type. */
+            inline std::string              getString()           const { return this->operator std::string();          } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Vector2         getVector2()          const { return this->operator orxonox::Vector2();     } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Vector3         getVector3()          const { return this->operator orxonox::Vector3();     } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Vector4         getVector4()          const { return this->operator orxonox::Vector4();     } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::ColourValue     getColourValue()      const { return this->operator orxonox::ColourValue(); } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Quaternion      getQuaternion()       const { return this->operator orxonox::Quaternion();  } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Radian          getRadian()           const { return this->operator orxonox::Radian();      } /** @brief Returns the current value, converted to the requested type. */
+            inline orxonox::Degree          getDegree()           const { return this->operator orxonox::Degree();      } /** @brief Returns the current value, converted to the requested type. */
+            template <typename T> inline T* getPointer()          const { return ((T*)this->getVoid());                 } /** @brief Returns the current value, converted to a T* pointer. */
+
+        private:
+            inline bool assignValue(const char& value)                 { if (this->value_ && this->value_->type_ == MT_char)        { return this->value_->setValue(value); } else { this->changeValueContainer<char>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const unsigned char& value)        { if (this->value_ && this->value_->type_ == MT_uchar)       { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value);        return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const short& value)                { if (this->value_ && this->value_->type_ == MT_short)       { return this->value_->setValue(value); } else { this->changeValueContainer<short>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const unsigned short& value)       { if (this->value_ && this->value_->type_ == MT_ushort)      { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value);       return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const int& value)                  { if (this->value_ && this->value_->type_ == MT_int)         { return this->value_->setValue(value); } else { this->changeValueContainer<int>(value);                  return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const unsigned int& value)         { if (this->value_ && this->value_->type_ == MT_uint)        { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value);         return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const long& value)                 { if (this->value_ && this->value_->type_ == MT_long)        { return this->value_->setValue(value); } else { this->changeValueContainer<long>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const unsigned long& value)        { if (this->value_ && this->value_->type_ == MT_ulong)       { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value);        return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const long long& value)            { if (this->value_ && this->value_->type_ == MT_longlong)    { return this->value_->setValue(value); } else { this->changeValueContainer<long long>(value);            return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const unsigned long long& value)   { if (this->value_ && this->value_->type_ == MT_ulonglong)   { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value);   return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const float& value)                { if (this->value_ && this->value_->type_ == MT_float)       { return this->value_->setValue(value); } else { this->changeValueContainer<float>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const double& value)               { if (this->value_ && this->value_->type_ == MT_double)      { return this->value_->setValue(value); } else { this->changeValueContainer<double>(value);               return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const long double& value)          { if (this->value_ && this->value_->type_ == MT_longdouble)  { return this->value_->setValue(value); } else { this->changeValueContainer<long double>(value);          return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const bool& value)                 { if (this->value_ && this->value_->type_ == MT_bool)        { return this->value_->setValue(value); } else { this->changeValueContainer<bool>(value);                 return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(      void* const& value)          { if (this->value_ && this->value_->type_ == MT_void)        { return this->value_->setValue(value); } else { this->changeValueContainer<void*>(value);                return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const std::string& value)          { if (this->value_ && this->value_->type_ == MT_string)      { return this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value);          return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Vector2& value)     { if (this->value_ && this->value_->type_ == MT_vector2)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Vector3& value)     { if (this->value_ && this->value_->type_ == MT_vector3)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Vector4& value)     { if (this->value_ && this->value_->type_ == MT_vector4)     { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value);     return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_colourvalue) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Quaternion& value)  { if (this->value_ && this->value_->type_ == MT_quaternion)  { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value);  return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Radian& value)      { if (this->value_ && this->value_->type_ == MT_radian)      { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value);      return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+            inline bool assignValue(const orxonox::Degree& value)      { if (this->value_ && this->value_->type_ == MT_degree)      { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value);      return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+
+            /** @brief Changes the value container. */
+            template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
+            /** @brief Creates a new value container (works only with specialized types). */
+            template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); return false; }
+
+            MT_ValueBase* value_; //!< A pointer to the value container
+    };
+
+    /** @brief Puts the MultiType on a stream by using the native << operator of the current type. */
+    _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);        } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<unsigned char>()        const { return (this->value_ && this->value_->type_ == MT_uchar);       } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<short>()                const { return (this->value_ && this->value_->type_ == MT_short);       } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<unsigned short>()       const { return (this->value_ && this->value_->type_ == MT_ushort);      } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<int>()                  const { return (this->value_ && this->value_->type_ == MT_int);         } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<unsigned int>()         const { return (this->value_ && this->value_->type_ == MT_uint);        } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<long>()                 const { return (this->value_ && this->value_->type_ == MT_long);        } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<unsigned long>()        const { return (this->value_ && this->value_->type_ == MT_ulong);       } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<long long>()            const { return (this->value_ && this->value_->type_ == MT_longlong);    } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<unsigned long long>()   const { return (this->value_ && this->value_->type_ == MT_ulonglong);   } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<float>()                const { return (this->value_ && this->value_->type_ == MT_float);       } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<double>()               const { return (this->value_ && this->value_->type_ == MT_double);      } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<long double>()          const { return (this->value_ && this->value_->type_ == MT_longdouble);  } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<bool>()                 const { return (this->value_ && this->value_->type_ == MT_bool);        } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<void*>()                const { return (this->value_ && this->value_->type_ == MT_void);        } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<std::string>()          const { return (this->value_ && this->value_->type_ == MT_string);      } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Vector2>()     const { return (this->value_ && this->value_->type_ == MT_vector2);     } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Vector3>()     const { return (this->value_ && this->value_->type_ == MT_vector3);     } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Vector4>()     const { return (this->value_ && this->value_->type_ == MT_vector4);     } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_colourvalue); } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Quaternion>()  const { return (this->value_ && this->value_->type_ == MT_quaternion);  } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Radian>()      const { return (this->value_ && this->value_->type_ == MT_radian);      } /** @brief Returns true if the current type equals the given type. */
+    template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_degree);      } /** @brief Returns true if the current type equals the given type. */
+
+    // Specialization to avoid ambiguities with the conversion operator
+    template <> inline bool MultiType::convert<std::string>()          { return this->setValue<std::string>         (this->operator std::string());          } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Vector2>()     { return this->setValue<orxonox::Vector2>    (this->operator orxonox::Vector2());     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Vector3>()     { return this->setValue<orxonox::Vector3>    (this->operator orxonox::Vector3());     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Vector4>()     { return this->setValue<orxonox::Vector4>    (this->operator orxonox::Vector4());     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::ColourValue>() { return this->setValue<orxonox::ColourValue>(this->operator orxonox::ColourValue()); } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Quaternion>()  { return this->setValue<orxonox::Quaternion> (this->operator orxonox::Quaternion());  } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Radian>()      { return this->setValue<orxonox::Radian>     (this->operator orxonox::Radian());      } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<orxonox::Degree>()      { return this->setValue<orxonox::Degree>     (this->operator orxonox::Degree());      } /** @brief Converts the current value to the given type. */
+
+    // Specialization to avoid ambiguities with the conversion operator
+    template <> inline bool MultiType::convert<const std::string&>()          { return this->convert<std::string>();          } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Vector2&>()     { return this->convert<orxonox::Vector2>();     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Vector3&>()     { return this->convert<orxonox::Vector3>();     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Vector4&>()     { return this->convert<orxonox::Vector4>();     } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::ColourValue&>() { return this->convert<orxonox::ColourValue>(); } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Quaternion&>()  { return this->convert<orxonox::Quaternion>();  } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Radian&>()      { return this->convert<orxonox::Radian>();      } /** @brief Converts the current value to the given type. */
+    template <> inline bool MultiType::convert<const orxonox::Degree&>()      { return this->convert<orxonox::Degree>();      } /** @brief Converts the current value to the given type. */
+
+    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 bool MultiType::setValue(const char& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const unsigned char& value)         { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const short& value)                 { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const unsigned short& value)        { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const int& value)                   { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const unsigned int& value)          { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const long& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const unsigned long& value)         { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const long long& value)             { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const unsigned long long& value)    { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const float& value)                 { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const double& value)                { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const long double& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const bool& value)                  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(      void* const& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const std::string& value)           { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Vector2& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Vector3& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Vector4& value)      { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::ColourValue& value)  { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Quaternion& value)   { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Radian& value)       { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+    inline bool MultiType::setValue(const orxonox::Degree& value)       { if (this->value_) { return this->value_->setValue(value); } else { return this->assignValue(value); } } /** @brief Assigns the given value and converts it to the current type. */
+
+    inline bool MultiType::setValue(const char* value)                  { if (this->value_) { return this->value_->setValue(std::string(value)); } else { return this->assignValue(std::string(value)); } }  /** @brief Assigns the given value and converts it to the current type. */
+}
 
 #endif /* _MultiType_H__ */
Index: /code/trunk/src/util/MultiTypeValue.h
===================================================================
--- /code/trunk/src/util/MultiTypeValue.h	(revision 2170)
+++ /code/trunk/src/util/MultiTypeValue.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file MultiTypeValue.h
+    @file
     @brief Declaration and Implementation of the MT_Value<T> class.
 
@@ -41,110 +41,114 @@
 #include "MultiType.h"
 
-/**
-    @brief The MT_Value<T> class is used to hold a value of type T within a MultiType.
-*/
-template <typename T>
-struct MT_Value : public MultiType::MT_ValueBase
+namespace orxonox
 {
-    /** @brief Constructor: Assigns the value and the type identifier. */
-    MT_Value(const T& value, MT_Type type) : MT_ValueBase(type), value_(value) {}
+    /**
+        @brief The MT_Value<T> class is used to hold a value of type T within a MultiType.
+    */
+    template <typename T>
+    class MT_Value : public MultiType::MT_ValueBase
+    {
+    public:
+        /** @brief Constructor: Assigns the value and the type identifier. */
+        MT_Value(const T& value, MT_Type type) : MT_ValueBase(type), value_(value) {}
 
-    /** @brief Creates a copy of itself. */
-    inline MT_ValueBase* clone() const { return new MT_Value<T>(this->value_, this->type_); }
+        /** @brief Creates a copy of itself. */
+        inline MT_ValueBase* clone() const { return new MT_Value<T>(this->value_, this->type_); }
 
-    /** @brief Resets the current value to the default. */
-    inline void reset() { this->value_ = zeroise<T>(); bHasDefaultValue_ = true; }
+        /** @brief Resets the current value to the default. */
+        inline void reset() { this->value_ = zeroise<T>(); bHasDefaultValue_ = true; }
 
-    /** @brief Assigns the value of the other MultiType, converted to T. @param other The other MultiType */
-    inline bool assimilate(const MultiType& other)
-    {
-        if (other.value_)
+        /** @brief Assigns the value of the other MultiType, converted to T. @param other The other MultiType */
+        inline bool assimilate(const MultiType& other)
         {
-            return !(bHasDefaultValue_ = !other.value_->getValue(&value_));
+            if (other.value_)
+            {
+                return !(bHasDefaultValue_ = !other.value_->getValue(&value_));
+            }
+            else
+            {
+                this->value_ = zeroise<T>();
+                return !(bHasDefaultValue_ = true);
+            }
         }
-        else
-        {
-            this->value_ = zeroise<T>();
-            return !(bHasDefaultValue_ = true);
-        }
-    }
 
-    inline bool getValue(char*                 value) const { return ConvertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(unsigned char*        value) const { return ConvertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(short*                value) const { return ConvertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(unsigned short*       value) const { return ConvertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(int*                  value) const { return ConvertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(unsigned int*         value) const { return ConvertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(long*                 value) const { return ConvertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(unsigned long*        value) const { return ConvertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(long long*            value) const { return ConvertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(unsigned long long*   value) const { return ConvertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(float*                value) const { return ConvertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(double*               value) const { return ConvertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(long double*          value) const { return ConvertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(bool*                 value) const { return ConvertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(void**                value) const { return ConvertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(std::string*          value) const { return ConvertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Vector2*     value) const { return ConvertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Vector3*     value) const { return ConvertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Vector4*     value) const { return ConvertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::ColourValue* value) const { return ConvertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Quaternion*  value) const { return ConvertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Radian*      value) const { return ConvertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
-    inline bool getValue(orxonox::Degree*      value) const { return ConvertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(char*                 value) const { return ConvertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(unsigned char*        value) const { return ConvertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(short*                value) const { return ConvertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(unsigned short*       value) const { return ConvertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(int*                  value) const { return ConvertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(unsigned int*         value) const { return ConvertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(long*                 value) const { return ConvertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(unsigned long*        value) const { return ConvertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(long long*            value) const { return ConvertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(unsigned long long*   value) const { return ConvertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(float*                value) const { return ConvertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(double*               value) const { return ConvertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(long double*          value) const { return ConvertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(bool*                 value) const { return ConvertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(void**                value) const { return ConvertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(std::string*          value) const { return ConvertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Vector2*     value) const { return ConvertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Vector3*     value) const { return ConvertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Vector4*     value) const { return ConvertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::ColourValue* value) const { return ConvertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Quaternion*  value) const { return ConvertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Radian*      value) const { return ConvertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
+        inline bool getValue(orxonox::Degree*      value) const { return ConvertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
 
-    inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !ConvertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !ConvertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !ConvertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !ConvertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !ConvertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !ConvertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !ConvertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !ConvertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !ConvertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !ConvertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !ConvertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !ConvertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !ConvertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !ConvertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !ConvertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
-    inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !ConvertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !ConvertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !ConvertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !ConvertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !ConvertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !ConvertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !ConvertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !ConvertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !ConvertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !ConvertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !ConvertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !ConvertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !ConvertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !ConvertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !ConvertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
+        inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
 
-    inline operator char()                 const { return getConvertedValue<T, char>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator unsigned char()        const { return getConvertedValue<T, unsigned char>       (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator short()                const { return getConvertedValue<T, short>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator unsigned short()       const { return getConvertedValue<T, unsigned short>      (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator int()                  const { return getConvertedValue<T, int>                 (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator unsigned int()         const { return getConvertedValue<T, unsigned int>        (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator long()                 const { return getConvertedValue<T, long>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator unsigned long()        const { return getConvertedValue<T, unsigned long>       (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator long long()            const { return getConvertedValue<T, long long>           (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator unsigned long long()   const { return getConvertedValue<T, unsigned long long>  (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator float()                const { return getConvertedValue<T, float>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator double()               const { return getConvertedValue<T, double>              (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator long double()          const { return getConvertedValue<T, long double>         (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator bool()                 const { return getConvertedValue<T, bool>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator void*()                const { return getConvertedValue<T, void*>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
-    inline operator std::string()          const { return getConvertedValue<T, std::string>         (this->value_, zeroise<std::string         >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Vector2()     const { return getConvertedValue<T, orxonox::Vector2>    (this->value_, zeroise<orxonox::Vector2    >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Vector3()     const { return getConvertedValue<T, orxonox::Vector3>    (this->value_, zeroise<orxonox::Vector3    >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Vector4()     const { return getConvertedValue<T, orxonox::Vector4>    (this->value_, zeroise<orxonox::Vector4    >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, zeroise<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Quaternion()  const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, zeroise<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Radian()      const { return getConvertedValue<T, orxonox::Radian>     (this->value_, zeroise<orxonox::Radian     >()); } /** @brief Returns the current value, converted to the requested type. */
-    inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_, zeroise<orxonox::Degree     >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator char()                 const { return getConvertedValue<T, char>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator unsigned char()        const { return getConvertedValue<T, unsigned char>       (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator short()                const { return getConvertedValue<T, short>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator unsigned short()       const { return getConvertedValue<T, unsigned short>      (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator int()                  const { return getConvertedValue<T, int>                 (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator unsigned int()         const { return getConvertedValue<T, unsigned int>        (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator long()                 const { return getConvertedValue<T, long>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator unsigned long()        const { return getConvertedValue<T, unsigned long>       (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator long long()            const { return getConvertedValue<T, long long>           (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator unsigned long long()   const { return getConvertedValue<T, unsigned long long>  (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator float()                const { return getConvertedValue<T, float>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator double()               const { return getConvertedValue<T, double>              (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator long double()          const { return getConvertedValue<T, long double>         (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator bool()                 const { return getConvertedValue<T, bool>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator void*()                const { return getConvertedValue<T, void*>               (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
+        inline operator std::string()          const { return getConvertedValue<T, std::string>         (this->value_, zeroise<std::string         >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector2()     const { return getConvertedValue<T, orxonox::Vector2>    (this->value_, zeroise<orxonox::Vector2    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector3()     const { return getConvertedValue<T, orxonox::Vector3>    (this->value_, zeroise<orxonox::Vector3    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Vector4()     const { return getConvertedValue<T, orxonox::Vector4>    (this->value_, zeroise<orxonox::Vector4    >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, zeroise<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Quaternion()  const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, zeroise<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Radian()      const { return getConvertedValue<T, orxonox::Radian>     (this->value_, zeroise<orxonox::Radian     >()); } /** @brief Returns the current value, converted to the requested type. */
+        inline operator orxonox::Degree()      const { return getConvertedValue<T, orxonox::Degree>     (this->value_, zeroise<orxonox::Degree     >()); } /** @brief Returns the current value, converted to the requested type. */
 
-    /** @brief Puts the current value on the stream */
-    inline void toString(std::ostream& outstream) const { outstream << this->value_; }
+        /** @brief Puts the current value on the stream */
+        inline void toString(std::ostream& outstream) const { outstream << this->value_; }
 
-    T value_; //!< The stored value
-};
+        T value_; //!< The stored value
+    };
+}
 
 #endif /* _MultiTypeValue_H__ */
Index: /code/trunk/src/util/OutputBuffer.cc
===================================================================
--- /code/trunk/src/util/OutputBuffer.cc	(revision 2170)
+++ /code/trunk/src/util/OutputBuffer.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OutputBuffer.cc
+    @file
     @brief Implementation of the OutputBuffer.
 */
Index: /code/trunk/src/util/OutputBuffer.h
===================================================================
--- /code/trunk/src/util/OutputBuffer.h	(revision 2170)
+++ /code/trunk/src/util/OutputBuffer.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OutputBuffer.h
+    @file
     @brief Declaration of the OutputBuffer class.
 
@@ -58,5 +58,5 @@
         an OutputBuffer and this buffer changes.
     */
-    class _UtilExport OutputBufferListener
+    class OutputBufferListener
     {
         friend class OutputBuffer;
Index: /code/trunk/src/util/OutputHandler.cc
===================================================================
--- /code/trunk/src/util/OutputHandler.cc	(revision 2170)
+++ /code/trunk/src/util/OutputHandler.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OutputHandler.cc
+    @file
     @brief Implementation of the OutputHandler class.
 */
Index: /code/trunk/src/util/OutputHandler.h
===================================================================
--- /code/trunk/src/util/OutputHandler.h	(revision 2170)
+++ /code/trunk/src/util/OutputHandler.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file OutputHandler.h
+    @file
     @brief Definition of the OutputHandler class.
 
Index: /code/trunk/src/util/SignalHandler.cc
===================================================================
--- /code/trunk/src/util/SignalHandler.cc	(revision 2170)
+++ /code/trunk/src/util/SignalHandler.cc	(revision 2171)
@@ -40,5 +40,8 @@
 #include <cstring>
 
-SignalHandler * SignalHandler::singletonRef = NULL;
+namespace orxonox
+{
+    SignalHandler * SignalHandler::singletonRef = NULL;
+}
 
 #if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN32
@@ -49,306 +52,309 @@
 #include <X11/keysym.h>
 
-bool SignalHandler::bXAutoKeyRepeatOn_ = false;
-
-SignalHandler::SignalHandler()
+namespace orxonox
 {
+    bool SignalHandler::bXAutoKeyRepeatOn_ = false;
+
+    SignalHandler::SignalHandler()
+    {
+    }
+
+    /**
+     * register signal handlers for SIGSEGV and SIGABRT
+     * @param appName path to executable eg argv[0]
+     * @param filename filename to append backtrace to
+     */
+    void SignalHandler::doCatch( const std::string & appName, const std::string & filename )
+    {
+      this->appName = appName;
+      this->filename = filename;
+
+      // prepare for restoring XAutoKeyRepeat
+      Display* display;
+      if ((display = XOpenDisplay(0)))
+      {
+        XKeyboardState oldState;
+        XGetKeyboardControl(display, &oldState);
+        if (oldState.global_auto_repeat == AutoRepeatModeOn)
+          bXAutoKeyRepeatOn_ = true;
+        else
+          bXAutoKeyRepeatOn_ = false;
+        XCloseDisplay(display);
+      }
+      else
+      {
+        std::cout << "Warning: couldn't open X display to restore XAutoKeyRepeat." << std::endl;
+        bXAutoKeyRepeatOn_ = false;
+      }
+
+
+      // make sure doCatch is only called once without calling dontCatch
+      assert( sigRecList.size() == 0 );
+
+      catchSignal( SIGSEGV );
+      catchSignal( SIGABRT );
+      catchSignal( SIGILL );
+    }
+
+    /**
+     * restore previous signal handlers
+     */
+    void SignalHandler::dontCatch()
+    {
+      for ( SignalRecList::iterator it = sigRecList.begin(); it != sigRecList.end(); it++ )
+      {
+        signal( it->signal, it->handler );
+      }
+
+      sigRecList.clear();
+    }
+
+    /**
+     * catch signal sig
+     * @param sig signal to catch
+     */
+    void SignalHandler::catchSignal( int sig )
+    {
+      sig_t handler = signal( sig, SignalHandler::sigHandler );
+
+      assert( handler != SIG_ERR );
+
+      SignalRec rec;
+      rec.signal = sig;
+      rec.handler = handler;
+
+      sigRecList.push_front( rec );
+    }
+
+    /**
+     * sigHandler is called when receiving signals
+     * @param sig
+     */
+    void SignalHandler::sigHandler( int sig )
+    {
+      for ( SignalCallbackList::iterator it = SignalHandler::getInstance()->callbackList.begin(); it != SignalHandler::getInstance()->callbackList.end(); it++  )
+      {
+        (*(it->cb))( it->someData );
+      }
+
+      std::string sigName = "UNKNOWN";
+
+      switch ( sig )
+      {
+        case SIGSEGV:
+          sigName = "SIGSEGV";
+          break;
+        case SIGABRT:
+          sigName = "SIGABRT";
+          break;
+        case SIGILL:
+          sigName = "SIGILL";
+          break;
+      }
+
+      if (bXAutoKeyRepeatOn_)
+      {
+        std::cout << "Trying to restore XAutoKeyRepeat" << std::endl;
+        Display* display;
+        if ((display = XOpenDisplay(0)))
+        {
+          XAutoRepeatOn(display);
+          XCloseDisplay(display);
+        }
+      }
+
+      COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox.log" << std::endl;
+
+      int sigPipe[2];
+      if ( pipe(sigPipe) == -1 )
+      {
+        perror("pipe failed!\n");
+        exit(EXIT_FAILURE);
+      }
+
+      int sigPid = fork();
+
+      if ( sigPid == -1 )
+      {
+        perror("fork failed!\n");
+        exit(EXIT_FAILURE);
+      }
+
+      // gdb will be attached to this process
+      if ( sigPid == 0 )
+      {
+        getInstance()->dontCatch();
+        // wait for message from parent when it has attached gdb
+        int someData;
+
+        read( sigPipe[0], &someData, sizeof(someData) );
+
+        if ( someData != 0x12345678 )
+        {
+          COUT(0) << "something went wrong :(" << std::endl;
+        }
+
+        return;
+      }
+
+      int gdbIn[2];
+      int gdbOut[2];
+      int gdbErr[2];
+
+      if ( pipe(gdbIn) == -1 || pipe(gdbOut) == -1 || pipe(gdbErr) == -1 )
+      {
+        perror("pipe failed!\n");
+        kill( sigPid, SIGTERM );
+        waitpid( sigPid, NULL, 0 );
+        exit(EXIT_FAILURE);
+      }
+
+      int gdbPid = fork();
+      // this process will run gdb
+
+      if ( gdbPid == -1 )
+      {
+        perror("fork failed\n");
+        kill( sigPid, SIGTERM );
+        waitpid( sigPid, NULL, 0 );
+        exit(EXIT_FAILURE);
+      }
+
+      if ( gdbPid == 0 )
+      {
+        // start gdb
+
+        close(gdbIn[1]);
+        close(gdbOut[0]);
+        close(gdbErr[0]);
+
+        dup2( gdbIn[0], STDIN_FILENO );
+        dup2( gdbOut[1], STDOUT_FILENO );
+        dup2( gdbErr[1], STDERR_FILENO );
+
+        execlp( "sh", "sh", "-c", "gdb", (void*)NULL);
+      }
+
+      char cmd[256];
+      snprintf( cmd, 256, "file %s\nattach %d\nc\n", getInstance()->appName.c_str(), sigPid );
+      write( gdbIn[1], cmd, strlen(cmd) );
+
+      int charsFound = 0;
+      int promptFound = 0;
+      char byte;
+      while ( read( gdbOut[0], &byte, 1 ) == 1 )
+      {
+        if (
+          charsFound == 0 && byte == '(' ||
+          charsFound == 1 && byte == 'g' ||
+          charsFound == 2 && byte == 'd' ||
+          charsFound == 3 && byte == 'b' ||
+          charsFound == 4 && byte == ')' ||
+          charsFound == 5 && byte == ' '
+            )
+              charsFound++;
+        else
+          charsFound = 0;
+
+        if ( charsFound == 6 )
+        {
+          promptFound++;
+          charsFound = 0;
+        }
+
+        if ( promptFound == 3 )
+        {
+          break;
+        }
+      }
+
+      int someData = 0x12345678;
+      write( sigPipe[1], &someData, sizeof(someData) );
+
+      write( gdbIn[1], "bt\nk\nq\n", 7 );
+
+
+      charsFound = 0;
+      promptFound = 0;
+      std::string bt;
+      while ( read( gdbOut[0], &byte, 1 ) == 1 )
+      {
+        bt += std::string( &byte, 1 );
+
+        if (
+          charsFound == 0 && byte == '(' ||
+          charsFound == 1 && byte == 'g' ||
+          charsFound == 2 && byte == 'd' ||
+          charsFound == 3 && byte == 'b' ||
+          charsFound == 4 && byte == ')' ||
+          charsFound == 5 && byte == ' '
+            )
+              charsFound++;
+        else
+          charsFound = 0;
+
+        if ( charsFound == 6 )
+        {
+          promptFound++;
+          charsFound = 0;
+          bt += "\n";
+        }
+
+        if ( promptFound == 3 )
+        {
+          break;
+        }
+      }
+
+
+      waitpid( sigPid, NULL, 0 );
+      waitpid( gdbPid, NULL, 0 );
+
+      int wsRemoved = 0;
+
+      while ( wsRemoved < 2 && bt.length() > 0 )
+      {
+        if ( bt[1] == '\n' )
+          wsRemoved++;
+        bt.erase(0, 1);
+      }
+
+      if ( bt.length() > 0 )
+        bt.erase(0, 1);
+
+      time_t now = time(NULL);
+
+      std::string timeString = "\n\n\n\n"
+                         "=======================================================\n"
+                         "= time: " + std::string(ctime(&now)) +
+             "=======================================================\n";
+      bt.insert(0, timeString);
+
+      FILE * f = fopen( getInstance()->filename.c_str(), "a" );
+
+      if ( !f )
+      {
+        perror( ( std::string( "could not append to " ) + getInstance()->filename ).c_str() );
+        exit(EXIT_FAILURE);
+      }
+
+      if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
+      {
+        COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->filename << std::endl;
+        exit(EXIT_FAILURE);
+      }
+
+      exit(EXIT_FAILURE);
+    }
+
+    void SignalHandler::registerCallback( SignalCallback cb, void * someData )
+    {
+      SignalCallbackRec rec;
+      rec.cb = cb;
+      rec.someData = someData;
+
+      callbackList.push_back(rec);
+    }
 }
 
-/**
- * register signal handlers for SIGSEGV and SIGABRT
- * @param appName path to executable eg argv[0]
- * @param filename filename to append backtrace to
- */
-void SignalHandler::doCatch( const std::string & appName, const std::string & filename )
-{
-  this->appName = appName;
-  this->filename = filename;
-
-  // prepare for restoring XAutoKeyRepeat
-  Display* display;
-  if ((display = XOpenDisplay(0)))
-  {
-    XKeyboardState oldState;
-    XGetKeyboardControl(display, &oldState);
-    if (oldState.global_auto_repeat == AutoRepeatModeOn)
-      bXAutoKeyRepeatOn_ = true;
-    else
-      bXAutoKeyRepeatOn_ = false;
-    XCloseDisplay(display);
-  }
-  else
-  {
-    std::cout << "Warning: couldn't open X display to restore XAutoKeyRepeat." << std::endl;
-    bXAutoKeyRepeatOn_ = false;
-  }
-
-
-  // make sure doCatch is only called once without calling dontCatch
-  assert( sigRecList.size() == 0 );
-
-  catchSignal( SIGSEGV );
-  catchSignal( SIGABRT );
-  catchSignal( SIGILL );
-}
-
-/**
- * restore previous signal handlers
- */
-void SignalHandler::dontCatch()
-{
-  for ( SignalRecList::iterator it = sigRecList.begin(); it != sigRecList.end(); it++ )
-  {
-    signal( it->signal, it->handler );
-  }
-
-  sigRecList.clear();
-}
-
-/**
- * catch signal sig
- * @param sig signal to catch
- */
-void SignalHandler::catchSignal( int sig )
-{
-  sig_t handler = signal( sig, SignalHandler::sigHandler );
-
-  assert( handler != SIG_ERR );
-
-  SignalRec rec;
-  rec.signal = sig;
-  rec.handler = handler;
-
-  sigRecList.push_front( rec );
-}
-
-/**
- * sigHandler is called when receiving signals
- * @param sig
- */
-void SignalHandler::sigHandler( int sig )
-{
-  for ( SignalCallbackList::iterator it = SignalHandler::getInstance()->callbackList.begin(); it != SignalHandler::getInstance()->callbackList.end(); it++  )
-  {
-    (*(it->cb))( it->someData );
-  }
-
-  std::string sigName = "UNKNOWN";
-
-  switch ( sig )
-  {
-    case SIGSEGV:
-      sigName = "SIGSEGV";
-      break;
-    case SIGABRT:
-      sigName = "SIGABRT";
-      break;
-    case SIGILL:
-      sigName = "SIGILL";
-      break;
-  }
-
-  if (bXAutoKeyRepeatOn_)
-  {
-    std::cout << "Trying to restore XAutoKeyRepeat" << std::endl;
-    Display* display;
-    if ((display = XOpenDisplay(0)))
-    {
-      XAutoRepeatOn(display);
-      XCloseDisplay(display);
-    }
-  }
-
-  COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox.log" << std::endl;
-
-  int sigPipe[2];
-  if ( pipe(sigPipe) == -1 )
-  {
-    perror("pipe failed!\n");
-    exit(EXIT_FAILURE);
-  }
-
-  int sigPid = fork();
-
-  if ( sigPid == -1 )
-  {
-    perror("fork failed!\n");
-    exit(EXIT_FAILURE);
-  }
-
-  // gdb will be attached to this process
-  if ( sigPid == 0 )
-  {
-    getInstance()->dontCatch();
-    // wait for message from parent when it has attached gdb
-    int someData;
-
-    read( sigPipe[0], &someData, sizeof(someData) );
-
-    if ( someData != 0x12345678 )
-    {
-      COUT(0) << "something went wrong :(" << std::endl;
-    }
-
-    return;
-  }
-
-  int gdbIn[2];
-  int gdbOut[2];
-  int gdbErr[2];
-
-  if ( pipe(gdbIn) == -1 || pipe(gdbOut) == -1 || pipe(gdbErr) == -1 )
-  {
-    perror("pipe failed!\n");
-    kill( sigPid, SIGTERM );
-    waitpid( sigPid, NULL, 0 );
-    exit(EXIT_FAILURE);
-  }
-
-  int gdbPid = fork();
-  // this process will run gdb
-
-  if ( gdbPid == -1 )
-  {
-    perror("fork failed\n");
-    kill( sigPid, SIGTERM );
-    waitpid( sigPid, NULL, 0 );
-    exit(EXIT_FAILURE);
-  }
-
-  if ( gdbPid == 0 )
-  {
-    // start gdb
-
-    close(gdbIn[1]);
-    close(gdbOut[0]);
-    close(gdbErr[0]);
-
-    dup2( gdbIn[0], STDIN_FILENO );
-    dup2( gdbOut[1], STDOUT_FILENO );
-    dup2( gdbErr[1], STDERR_FILENO );
-
-    execlp( "sh", "sh", "-c", "gdb", (void*)NULL);
-  }
-
-  char cmd[256];
-  snprintf( cmd, 256, "file %s\nattach %d\nc\n", getInstance()->appName.c_str(), sigPid );
-  write( gdbIn[1], cmd, strlen(cmd) );
-
-  int charsFound = 0;
-  int promptFound = 0;
-  char byte;
-  while ( read( gdbOut[0], &byte, 1 ) == 1 )
-  {
-    if (
-      charsFound == 0 && byte == '(' ||
-      charsFound == 1 && byte == 'g' ||
-      charsFound == 2 && byte == 'd' ||
-      charsFound == 3 && byte == 'b' ||
-      charsFound == 4 && byte == ')' ||
-      charsFound == 5 && byte == ' '
-        )
-          charsFound++;
-    else
-      charsFound = 0;
-
-    if ( charsFound == 6 )
-    {
-      promptFound++;
-      charsFound = 0;
-    }
-
-    if ( promptFound == 3 )
-    {
-      break;
-    }
-  }
-
-  int someData = 0x12345678;
-  write( sigPipe[1], &someData, sizeof(someData) );
-
-  write( gdbIn[1], "bt\nk\nq\n", 7 );
-
-
-  charsFound = 0;
-  promptFound = 0;
-  std::string bt;
-  while ( read( gdbOut[0], &byte, 1 ) == 1 )
-  {
-    bt += std::string( &byte, 1 );
-
-    if (
-      charsFound == 0 && byte == '(' ||
-      charsFound == 1 && byte == 'g' ||
-      charsFound == 2 && byte == 'd' ||
-      charsFound == 3 && byte == 'b' ||
-      charsFound == 4 && byte == ')' ||
-      charsFound == 5 && byte == ' '
-        )
-          charsFound++;
-    else
-      charsFound = 0;
-
-    if ( charsFound == 6 )
-    {
-      promptFound++;
-      charsFound = 0;
-      bt += "\n";
-    }
-
-    if ( promptFound == 3 )
-    {
-      break;
-    }
-  }
-
-
-  waitpid( sigPid, NULL, 0 );
-  waitpid( gdbPid, NULL, 0 );
-
-  int wsRemoved = 0;
-
-  while ( wsRemoved < 2 && bt.length() > 0 )
-  {
-    if ( bt[1] == '\n' )
-      wsRemoved++;
-    bt.erase(0, 1);
-  }
-
-  if ( bt.length() > 0 )
-    bt.erase(0, 1);
-
-  time_t now = time(NULL);
-
-  std::string timeString = "\n\n\n\n"
-                     "=======================================================\n"
-                     "= time: " + std::string(ctime(&now)) +
-         "=======================================================\n";
-  bt.insert(0, timeString);
-
-  FILE * f = fopen( getInstance()->filename.c_str(), "a" );
-
-  if ( !f )
-  {
-    perror( ( std::string( "could not append to " ) + getInstance()->filename ).c_str() );
-    exit(EXIT_FAILURE);
-  }
-
-  if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
-  {
-    COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->filename << std::endl;
-    exit(EXIT_FAILURE);
-  }
-
-  exit(EXIT_FAILURE);
-}
-
-void SignalHandler::registerCallback( SignalCallback cb, void * someData )
-{
-  SignalCallbackRec rec;
-  rec.cb = cb;
-  rec.someData = someData;
-
-  callbackList.push_back(rec);
-}
-
 #endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 */
Index: /code/trunk/src/util/SignalHandler.h
===================================================================
--- /code/trunk/src/util/SignalHandler.h	(revision 2170)
+++ /code/trunk/src/util/SignalHandler.h	(revision 2171)
@@ -40,68 +40,77 @@
 #include <string>
 
-typedef int (*SignalCallback)( void * someData );
+namespace orxonox
+{
+    typedef int (*SignalCallback)( void * someData );
+}
 
 #if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN32
 #include <signal.h>
 
-struct SignalRec
+namespace orxonox
 {
-  int signal;
-  sig_t handler;
-};
+    struct SignalRec
+    {
+        int signal;
+        sig_t handler;
+    };
 
-struct SignalCallbackRec
-{
-  SignalCallback cb;
-  void * someData;
-};
+    struct SignalCallbackRec
+    {
+        SignalCallback cb;
+        void * someData;
+    };
 
 
-typedef std::list<SignalRec> SignalRecList;
-typedef std::list<SignalCallbackRec> SignalCallbackList;
+    typedef std::list<SignalRec> SignalRecList;
+    typedef std::list<SignalCallbackRec> SignalCallbackList;
 
-class SignalHandler
-{
-  private:
-    SignalHandler();
-  public:
-    inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; }
-    ~SignalHandler(){ SignalHandler::singletonRef = NULL; }
+    class SignalHandler
+    {
+    private:
+        SignalHandler();
+    public:
+        inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; }
+        ~SignalHandler(){ SignalHandler::singletonRef = NULL; }
 
-    void registerCallback( SignalCallback cb, void * someData );
+        void registerCallback( SignalCallback cb, void * someData );
 
-    void doCatch( const std::string & appName, const std::string & filename );
-    void dontCatch();
+        void doCatch( const std::string & appName, const std::string & filename );
+        void dontCatch();
 
-  private:
-    static void sigHandler( int sig );
+    private:
+        static void sigHandler( int sig );
 
-    void catchSignal( int sig );
-    SignalRecList sigRecList;
+        void catchSignal( int sig );
+        SignalRecList sigRecList;
 
-    SignalCallbackList callbackList;
+        SignalCallbackList callbackList;
 
-    static SignalHandler * singletonRef;
+        static SignalHandler * singletonRef;
 
-    std::string appName;
-    std::string filename;
+        std::string appName;
+        std::string filename;
 
-    // used to turn on KeyAutoRepeat if OIS crashes
-    static bool bXAutoKeyRepeatOn_;
-};
+        // used to turn on KeyAutoRepeat if OIS crashes
+        static bool bXAutoKeyRepeatOn_;
+    };
+}
 
 #else /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 */
 
-class _UtilExport SignalHandler
+namespace orxonox
 {
-  public:
-    inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; };
-    void doCatch( const std::string & appName, const std::string & filename ) {};
-    void dontCatch() {};
-    void registerCallback( SignalCallback cb, void * someData ) {};
+    class _UtilExport SignalHandler
+    {
+    public:
+        inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; };
+        void doCatch( const std::string & appName, const std::string & filename ) {};
+        void dontCatch() {};
+        void registerCallback( SignalCallback cb, void * someData ) {};
 
-  private:
-    static SignalHandler * singletonRef;
-};
+    private:
+        static SignalHandler * singletonRef;
+    };
+}
 
 #endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 */
Index: /code/trunk/src/util/Sleep.h
===================================================================
--- /code/trunk/src/util/Sleep.h	(revision 2170)
+++ /code/trunk/src/util/Sleep.h	(revision 2171)
@@ -41,17 +41,20 @@
 #include <winbase.h>
 
-inline void usleep(DWORD dwMicroseconds)
+namespace orxonox
 {
-  Sleep(dwMicroseconds / 1000);
-}
+    inline void usleep(DWORD dwMicroseconds)
+    {
+        Sleep(dwMicroseconds / 1000);
+    }
 
-inline void msleep(DWORD dwMilliseconds)
-{
-  Sleep(dwMilliseconds);
-}
+    inline void msleep(DWORD dwMilliseconds)
+    {
+        Sleep(dwMilliseconds);
+    }
 
-inline void sleep(DWORD dwSeconds)
-{
-  Sleep(dwSeconds * 1000);
+    inline void sleep(DWORD dwSeconds)
+    {
+        Sleep(dwSeconds * 1000);
+    }
 }
 
@@ -60,7 +63,18 @@
 #include <unistd.h>
 
-inline void msleep(unsigned long msec)
+namespace orxonox
 {
-  usleep(msec * 1000);
+    inline void usleep(unsigned long usec)
+    {
+        ::usleep(usec);
+    }
+    inline void msleep(unsigned long msec)
+    {
+        ::usleep(msec * 1000);
+    }
+    inline void sleep(unsigned long sec)
+    {
+        ::usleep(sec * 1000000);
+    }
 }
 
Index: /code/trunk/src/util/String.cc
===================================================================
--- /code/trunk/src/util/String.cc	(revision 2170)
+++ /code/trunk/src/util/String.cc	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file String.cc
+    @file
     @brief Implementation of several string manipulation functions.
 */
@@ -40,452 +40,455 @@
 #include "Math.h"
 
-std::string BLANKSTRING("");
-
-std::string getUniqueNumberString()
+namespace orxonox
 {
-    return convertToString(getUniqueNumber());
+    std::string BLANKSTRING("");
+
+    std::string getUniqueNumberString()
+    {
+        return convertToString(getUniqueNumber());
+    }
+
+    /**
+        @brief Removes all whitespaces from a string.
+        @param str The string to strip
+    */
+    void strip(std::string* str)
+    {
+        size_t pos;
+        while ((pos = (*str).find(" ")) < (*str).length())
+            (*str).erase(pos, 1);
+        while ((pos = (*str).find("\t")) < (*str).length())
+            (*str).erase(pos, 1);
+        while ((pos = (*str).find("\n")) < (*str).length())
+            (*str).erase(pos, 1);
+    }
+
+    /**
+        @brief Returns a copy of a string without whitespaces.
+        @param str The string to strip
+        @return The stripped line
+    */
+    std::string getStripped(const std::string& str)
+    {
+        std::string output = std::string(str);
+        strip(&output);
+        return output;
+    }
+
+    /**
+        @brief Returns a copy of a string without trailing whitespaces.
+        @param str The string
+        @return The modified copy
+    */
+    std::string removeTrailingWhitespaces(const std::string& str)
+    {
+        size_t pos1 = 0;
+        int pos2 = str.size() - 1;
+        for (; pos1 < str.size() && (str[pos1] == ' ' || str[pos1] == '\t' || str[pos1] == '\n'); pos1++);
+        for (; pos2 > 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
+        return str.substr(pos1, pos2 - pos1 + 1);
+    }
+
+    /**
+        @brief Returns the position of the next quote in the string, starting with start.
+        @param str The string
+        @param start The startposition
+        @return The position of the next quote (std::string::npos if there is no next quote)
+    */
+    size_t getNextQuote(const std::string& str, size_t start)
+    {
+        size_t quote = start - 1;
+
+        while ((quote = str.find('\"', quote + 1)) != std::string::npos)
+        {
+            size_t backslash = quote;
+            size_t numbackslashes = 0;
+            for (; backslash > 0; backslash--, numbackslashes++)
+                if (str[backslash - 1] != '\\')
+                    break;
+
+            if (numbackslashes % 2 == 0)
+                break;
+        }
+
+        return quote;
+    }
+
+    /**
+        @brief Returns true if pos is between two quotes.
+        @param str The string
+        @param pos The position to check
+        @return True if pos is between two quotes
+    */
+    bool isBetweenQuotes(const std::string& str, size_t pos)
+    {
+        if (pos == std::string::npos)
+            return false;
+
+        size_t quotecount = 0;
+        size_t quote = (size_t)-1;
+        while ((quote = getNextQuote(str, quote + 1)) < pos)
+        {
+            if (quote == pos)
+                return false;
+            quotecount++;
+        }
+
+        if (quote == std::string::npos)
+            return false;
+
+        return ((quotecount % 2) == 1);
+    }
+
+    /**
+        @brief Returns true if the string contains something like '..."between quotes"...'.
+        @param The string
+        @return True if there is something between quotes
+    */
+    bool hasStringBetweenQuotes(const std::string& str)
+    {
+        size_t pos1 = getNextQuote(str, 0);
+        size_t pos2 = getNextQuote(str, pos1 + 1);
+        return (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1);
+    }
+
+    /**
+        @brief If the string contains something like '..."between quotes"...' then 'between quotes' gets returned (without quotes).
+        @param The string
+        @param The string between the quotes
+    */
+    std::string getStringBetweenQuotes(const std::string& str)
+    {
+        size_t pos1 = getNextQuote(str, 0);
+        size_t pos2 = getNextQuote(str, pos1 + 1);
+        if (pos1 != std::string::npos && pos2 != std::string::npos)
+            return str.substr(pos1, pos2 - pos1 + 1);
+        else
+            return "";
+    }
+
+    /**
+        @brief Removes enclosing quotes if available (including whitespaces at the outside of the quotes).
+        @brief str The string to strip
+        @return The string with removed quotes
+    */
+    std::string stripEnclosingQuotes(const std::string& str)
+    {
+        size_t start = std::string::npos;
+        size_t end = 0;
+
+        for (size_t pos = 0; (pos < str.size()) && (pos < std::string::npos); pos++)
+        {
+            if (str[pos] == '"')
+            {
+                start = pos;
+                break;
+            }
+
+            if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+                return str;
+        }
+
+        for (size_t pos = str.size() - 1; pos < std::string::npos; pos--)
+        {
+            if (str[pos] == '"')
+            {
+                end = pos;
+                break;
+            }
+
+            if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+                return str;
+        }
+
+        if ((start != std::string::npos) && (end != 0))
+            return str.substr(start + 1, end - start - 1);
+        else
+            return str;
+    }
+
+    /**
+        @brief Removes enclosing {braces} (braces must be exactly on the beginning and the end of the string).
+        @param str The string to strip
+        @return The striped string
+    */
+    std::string stripEnclosingBraces(const std::string& str)
+    {
+        std::string output = str;
+
+        while (output.size() >= 2 && output[0] == '{' && output[output.size() - 1] == '}')
+            output = output.substr(1, output.size() - 2);
+
+        return output;
+    }
+
+    /**
+        @brief Determines if a string is a comment (starts with a comment-symbol).
+        @param str The string to check
+        @return True = it's a comment
+
+        A comment is defined by a leading '#', '%', ';' or '//'.
+    */
+    bool isComment(const std::string& str)
+    {
+        // Strip the line, whitespaces are disturbing
+        std::string teststring = getStripped(str);
+
+        // There are four possible comment-symbols:
+        //  1) #comment in script-language style
+        //  2) %comment in matlab style
+        //  3) ;comment in unreal tournament config-file style
+        //  4) //comment in code style
+        if (teststring.size() >= 2)
+        {
+            if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[1] == '/'))
+                return true;
+        }
+        else if (teststring.size() == 1)
+        {
+            if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';')
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+        @brief Determines if a string is empty (contains only whitespaces).
+        @param str The string to check
+        @return True = it's empty
+    */
+    bool isEmpty(const std::string& str)
+    {
+        std::string temp = getStripped(str);
+        return ((temp == "") || (temp.size() == 0));
+    }
+
+    /**
+        @brief Determines if a string contains only numbers and maximal one '.'.
+        @param str The string to check
+        @return True = it's a number
+    */
+    bool isNumeric(const std::string& str)
+    {
+        bool foundPoint = false;
+
+        for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
+        {
+            if (((*it) < '0' || (*it) > '9'))
+            {
+                if ((*it) != '.' && !foundPoint)
+                    foundPoint = true;
+                else
+                    return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+        @brief Adds backslashes to the given string which makes special chars visible. Existing slashes will be doubled.
+        @param str The string to manipulate
+        @return The string with added slashes
+    */
+    std::string addSlashes(const std::string& str)
+    {
+        std::string output = str;
+
+        for (size_t pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\\"); }
+        for (size_t pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\n"); }
+        for (size_t pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\t"); }
+        for (size_t pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\v"); }
+        for (size_t pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\b"); }
+        for (size_t pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\r"); }
+        for (size_t pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\f"); }
+        for (size_t pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\a"); }
+        for (size_t pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\""); }
+        for (size_t pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\0"); }
+
+        return output;
+    }
+
+    /**
+        @brief Removes backslashes from the given string. Double backslashes are interpreted as one backslash.
+        @param str The string to manipulate
+        @return The string with removed slashes
+    */
+    std::string removeSlashes(const std::string& str)
+    {
+        if (str.size() <= 1)
+            return str;
+
+        std::string output = "";
+        for (size_t pos = 0; pos < str.size() - 1; )
+        {
+            if (str[pos] == '\\')
+            {
+                if (str[pos + 1] == '\\') { output += '\\'; pos += 2; continue; }
+                else if (str[pos + 1] == 'n') { output += '\n'; pos += 2; continue; }
+                else if (str[pos + 1] == 't') { output += '\t'; pos += 2; continue; }
+                else if (str[pos + 1] == 'v') { output += '\v'; pos += 2; continue; }
+                else if (str[pos + 1] == 'b') { output += '\b'; pos += 2; continue; }
+                else if (str[pos + 1] == 'r') { output += '\r'; pos += 2; continue; }
+                else if (str[pos + 1] == 'f') { output += '\f'; pos += 2; continue; }
+                else if (str[pos + 1] == 'a') { output += '\a'; pos += 2; continue; }
+                else if (str[pos + 1] == '"') { output += '"'; pos += 2; continue; }
+                else if (str[pos + 1] == '0') { output += '\0'; pos += 2; continue; }
+            }
+            output += str[pos];
+            pos++;
+            if (pos == str.size() - 1)
+                output += str[pos];
+        }
+
+        return output;
+    }
+
+    /**
+        @brief Replaces each char between A and Z with its lowercase equivalent.
+        @param str The string to convert
+    */
+    void lowercase(std::string* str)
+    {
+        for (size_t i = 0; i < str->size(); ++i)
+        {
+            (*str)[i] = (char)tolower((*str)[i]);
+        }
+    }
+
+    /**
+        @brief Returns a copy of the given string without uppercase chars.
+        @param str The string
+        @return The copy
+    */
+    std::string getLowercase(const std::string& str)
+    {
+        std::string output = std::string(str);
+        lowercase(&output);
+        return output;
+    }
+
+    /**
+        @brief Replaces each char between a and z with its uppercase equivalent.
+        @param str The string to convert
+    */
+    void uppercase(std::string* str)
+    {
+        for (size_t i = 0; i < str->size(); ++i)
+        {
+            (*str)[i] = (char)toupper((*str)[i]);
+        }
+    }
+
+    /**
+        @brief Returns a copy of the given string without lowercase chars.
+        @param str The string
+        @return The copy
+    */
+    std::string getUppercase(const std::string& str)
+    {
+        std::string output = std::string(str);
+        uppercase(&output);
+        return output;
+    }
+
+    /**
+        @brief Compares two strings ignoring different casing.
+        @param s1 First string
+        @param s2 Second string
+    */
+    int nocaseCmp(const std::string& s1, const std::string& s2)
+    {
+        std::string::const_iterator it1=s1.begin();
+        std::string::const_iterator it2=s2.begin();
+
+        //stop when either string's end has been reached
+        while ( (it1!=s1.end()) && (it2!=s2.end()) )
+        {
+            if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
+                // return -1 to indicate smaller than, 1 otherwise
+                return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
+            //proceed to the next character in each string
+            ++it1;
+            ++it2;
+        }
+        size_t size1=s1.size(), size2=s2.size();// cache lengths
+        //return -1,0 or 1 according to strings' lengths
+        if (size1==size2)
+            return 0;
+        return (size1<size2) ? -1 : 1;
+    }
+
+
+    /**
+        @brief Compares the first 'len' chars of two strings ignoring different casing.
+        @param s1 First string
+        @param s2 Second string
+        @param len Maximal number of chars to compare
+    */
+    int nocaseCmp(const std::string& s1, const std::string& s2, size_t len)
+    {
+        if (len == 0)
+            return 0;
+        std::string::const_iterator it1=s1.begin();
+        std::string::const_iterator it2=s2.begin();
+
+        //stop when either string's end has been reached
+        while ( (it1!=s1.end()) && (it2!=s2.end()) && len-- > 0)
+        {
+            if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
+                // return -1 to indicate smaller than, 1 otherwise
+                return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
+            //proceed to the next character in each string
+            ++it1;
+            ++it2;
+        }
+        return 0;
+    }
+
+    /**
+        @brief Returns true if the string contains a comment, introduced by #, %, ; or //.
+        @param str The string
+        @return True if the string contains a comment
+    */
+    bool hasComment(const std::string& str)
+    {
+        return (getCommentPosition(str) != std::string::npos);
+    }
+
+    /**
+        @brief If the string contains a comment, the comment gets returned (including the comment symbol), an empty string otherwise.
+        @param str The string
+        @return The comment
+    */
+    std::string getComment(const std::string& str)
+    {
+        return str.substr(getCommentPosition(str));
+    }
+
+    /**
+        @brief If the string contains a comment, the position of the comment-symbol gets returned, std::string::npos otherwise.
+        @param str The string
+        @return The position
+    */
+    size_t getCommentPosition(const std::string& str)
+    {
+        return getNextCommentPosition(str, 0);
+    }
+
+    /**
+        @brief Returns the position of the next comment-symbol, starting with start.
+        @param str The string
+        @param start The startposition
+        @return The position
+    */
+    size_t getNextCommentPosition(const std::string& str, size_t start)
+    {
+        for (size_t i = start; i < str.size(); i++)
+            if (isComment(str.substr(i)))
+                return i;
+
+        return std::string::npos;
+    }
 }
-
-/**
-    @brief Removes all whitespaces from a string.
-    @param str The string to strip
-*/
-void strip(std::string* str)
-{
-    size_t pos;
-    while ((pos = (*str).find(" ")) < (*str).length())
-        (*str).erase(pos, 1);
-    while ((pos = (*str).find("\t")) < (*str).length())
-        (*str).erase(pos, 1);
-    while ((pos = (*str).find("\n")) < (*str).length())
-        (*str).erase(pos, 1);
-}
-
-/**
-    @brief Returns a copy of a string without whitespaces.
-    @param str The string to strip
-    @return The stripped line
-*/
-std::string getStripped(const std::string& str)
-{
-    std::string output = std::string(str);
-    strip(&output);
-    return output;
-}
-
-/**
-    @brief Returns a copy of a string without trailing whitespaces.
-    @param str The string
-    @return The modified copy
-*/
-std::string removeTrailingWhitespaces(const std::string& str)
-{
-    size_t pos1 = 0;
-    int pos2 = str.size() - 1;
-    for (; pos1 < str.size() && (str[pos1] == ' ' || str[pos1] == '\t' || str[pos1] == '\n'); pos1++);
-    for (; pos2 > 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
-    return str.substr(pos1, pos2 - pos1 + 1);
-}
-
-/**
-    @brief Returns the position of the next quote in the string, starting with start.
-    @param str The string
-    @param start The startposition
-    @return The position of the next quote (std::string::npos if there is no next quote)
-*/
-size_t getNextQuote(const std::string& str, size_t start)
-{
-    size_t quote = start - 1;
-
-    while ((quote = str.find('\"', quote + 1)) != std::string::npos)
-    {
-        size_t backslash = quote;
-        size_t numbackslashes = 0;
-        for (; backslash > 0; backslash--, numbackslashes++)
-            if (str[backslash - 1] != '\\')
-                break;
-
-        if (numbackslashes % 2 == 0)
-            break;
-    }
-
-    return quote;
-}
-
-/**
-    @brief Returns true if pos is between two quotes.
-    @param str The string
-    @param pos The position to check
-    @return True if pos is between two quotes
-*/
-bool isBetweenQuotes(const std::string& str, size_t pos)
-{
-    if (pos == std::string::npos)
-        return false;
-
-    size_t quotecount = 0;
-    size_t quote = (size_t)-1;
-    while ((quote = getNextQuote(str, quote + 1)) < pos)
-    {
-        if (quote == pos)
-            return false;
-        quotecount++;
-    }
-
-    if (quote == std::string::npos)
-        return false;
-
-    return ((quotecount % 2) == 1);
-}
-
-/**
-    @brief Returns true if the string contains something like '..."between quotes"...'.
-    @param The string
-    @return True if there is something between quotes
-*/
-bool hasStringBetweenQuotes(const std::string& str)
-{
-    size_t pos1 = getNextQuote(str, 0);
-    size_t pos2 = getNextQuote(str, pos1 + 1);
-    return (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1);
-}
-
-/**
-    @brief If the string contains something like '..."between quotes"...' then 'between quotes' gets returned (without quotes).
-    @param The string
-    @param The string between the quotes
-*/
-std::string getStringBetweenQuotes(const std::string& str)
-{
-    size_t pos1 = getNextQuote(str, 0);
-    size_t pos2 = getNextQuote(str, pos1 + 1);
-    if (pos1 != std::string::npos && pos2 != std::string::npos)
-        return str.substr(pos1, pos2 - pos1 + 1);
-    else
-        return "";
-}
-
-/**
-    @brief Removes enclosing quotes if available (including whitespaces at the outside of the quotes).
-    @brief str The string to strip
-    @return The string with removed quotes
-*/
-std::string stripEnclosingQuotes(const std::string& str)
-{
-    size_t start = std::string::npos;
-    size_t end = 0;
-
-    for (size_t pos = 0; (pos < str.size()) && (pos < std::string::npos); pos++)
-    {
-        if (str[pos] == '"')
-        {
-            start = pos;
-            break;
-        }
-
-        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
-            return str;
-    }
-
-    for (size_t pos = str.size() - 1; pos < std::string::npos; pos--)
-    {
-        if (str[pos] == '"')
-        {
-            end = pos;
-            break;
-        }
-
-        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
-            return str;
-    }
-
-    if ((start != std::string::npos) && (end != 0))
-        return str.substr(start + 1, end - start - 1);
-    else
-        return str;
-}
-
-/**
-    @brief Removes enclosing {braces} (braces must be exactly on the beginning and the end of the string).
-    @param str The string to strip
-    @return The striped string
-*/
-std::string stripEnclosingBraces(const std::string& str)
-{
-    std::string output = str;
-
-    while (output.size() >= 2 && output[0] == '{' && output[output.size() - 1] == '}')
-        output = output.substr(1, output.size() - 2);
-
-    return output;
-}
-
-/**
-    @brief Determines if a string is a comment (starts with a comment-symbol).
-    @param str The string to check
-    @return True = it's a comment
-
-    A comment is defined by a leading '#', '%', ';' or '//'.
-*/
-bool isComment(const std::string& str)
-{
-    // Strip the line, whitespaces are disturbing
-    std::string teststring = getStripped(str);
-
-    // There are four possible comment-symbols:
-    //  1) #comment in script-language style
-    //  2) %comment in matlab style
-    //  3) ;comment in unreal tournament config-file style
-    //  4) //comment in code style
-    if (teststring.size() >= 2)
-    {
-        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[1] == '/'))
-            return true;
-    }
-    else if (teststring.size() == 1)
-    {
-        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';')
-            return true;
-    }
-
-    return false;
-}
-
-/**
-    @brief Determines if a string is empty (contains only whitespaces).
-    @param str The string to check
-    @return True = it's empty
-*/
-bool isEmpty(const std::string& str)
-{
-    std::string temp = getStripped(str);
-    return ((temp == "") || (temp.size() == 0));
-}
-
-/**
-    @brief Determines if a string contains only numbers and maximal one '.'.
-    @param str The string to check
-    @return True = it's a number
-*/
-bool isNumeric(const std::string& str)
-{
-    bool foundPoint = false;
-
-    for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
-    {
-        if (((*it) < '0' || (*it) > '9'))
-        {
-            if ((*it) != '.' && !foundPoint)
-                foundPoint = true;
-            else
-                return false;
-        }
-    }
-
-    return true;
-}
-
-/**
-    @brief Adds backslashes to the given string which makes special chars visible. Existing slashes will be doubled.
-    @param str The string to manipulate
-    @return The string with added slashes
-*/
-std::string addSlashes(const std::string& str)
-{
-    std::string output = str;
-
-    for (size_t pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\\"); }
-    for (size_t pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\n"); }
-    for (size_t pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\t"); }
-    for (size_t pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\v"); }
-    for (size_t pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\b"); }
-    for (size_t pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\r"); }
-    for (size_t pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\f"); }
-    for (size_t pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\a"); }
-    for (size_t pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\""); }
-    for (size_t pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\0"); }
-
-    return output;
-}
-
-/**
-    @brief Removes backslashes from the given string. Double backslashes are interpreted as one backslash.
-    @param str The string to manipulate
-    @return The string with removed slashes
-*/
-std::string removeSlashes(const std::string& str)
-{
-    if (str.size() <= 1)
-        return str;
-
-    std::string output = "";
-    for (size_t pos = 0; pos < str.size() - 1; )
-    {
-        if (str[pos] == '\\')
-        {
-            if (str[pos + 1] == '\\') { output += '\\'; pos += 2; continue; }
-            else if (str[pos + 1] == 'n') { output += '\n'; pos += 2; continue; }
-            else if (str[pos + 1] == 't') { output += '\t'; pos += 2; continue; }
-            else if (str[pos + 1] == 'v') { output += '\v'; pos += 2; continue; }
-            else if (str[pos + 1] == 'b') { output += '\b'; pos += 2; continue; }
-            else if (str[pos + 1] == 'r') { output += '\r'; pos += 2; continue; }
-            else if (str[pos + 1] == 'f') { output += '\f'; pos += 2; continue; }
-            else if (str[pos + 1] == 'a') { output += '\a'; pos += 2; continue; }
-            else if (str[pos + 1] == '"') { output += '"'; pos += 2; continue; }
-            else if (str[pos + 1] == '0') { output += '\0'; pos += 2; continue; }
-        }
-        output += str[pos];
-        pos++;
-        if (pos == str.size() - 1)
-            output += str[pos];
-    }
-
-    return output;
-}
-
-/**
-    @brief Replaces each char between A and Z with its lowercase equivalent.
-    @param str The string to convert
-*/
-void lowercase(std::string* str)
-{
-    for (size_t i = 0; i < str->size(); ++i)
-    {
-        (*str)[i] = (char)tolower((*str)[i]);
-    }
-}
-
-/**
-    @brief Returns a copy of the given string without uppercase chars.
-    @param str The string
-    @return The copy
-*/
-std::string getLowercase(const std::string& str)
-{
-    std::string output = std::string(str);
-    lowercase(&output);
-    return output;
-}
-
-/**
-    @brief Replaces each char between a and z with its uppercase equivalent.
-    @param str The string to convert
-*/
-void uppercase(std::string* str)
-{
-    for (size_t i = 0; i < str->size(); ++i)
-    {
-        (*str)[i] = (char)toupper((*str)[i]);
-    }
-}
-
-/**
-    @brief Returns a copy of the given string without lowercase chars.
-    @param str The string
-    @return The copy
-*/
-std::string getUppercase(const std::string& str)
-{
-    std::string output = std::string(str);
-    uppercase(&output);
-    return output;
-}
-
-/**
-    @brief Compares two strings ignoring different casing.
-    @param s1 First string
-    @param s2 Second string
-*/
-int nocaseCmp(const std::string& s1, const std::string& s2)
-{
-    std::string::const_iterator it1=s1.begin();
-    std::string::const_iterator it2=s2.begin();
-
-    //stop when either string's end has been reached
-    while ( (it1!=s1.end()) && (it2!=s2.end()) )
-    {
-        if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
-            // return -1 to indicate smaller than, 1 otherwise
-            return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
-        //proceed to the next character in each string
-        ++it1;
-        ++it2;
-    }
-    size_t size1=s1.size(), size2=s2.size();// cache lengths
-    //return -1,0 or 1 according to strings' lengths
-    if (size1==size2)
-        return 0;
-    return (size1<size2) ? -1 : 1;
-}
-
-
-/**
-    @brief Compares the first 'len' chars of two strings ignoring different casing.
-    @param s1 First string
-    @param s2 Second string
-    @param len Maximal number of chars to compare
-*/
-int nocaseCmp(const std::string& s1, const std::string& s2, size_t len)
-{
-    if (len == 0)
-        return 0;
-    std::string::const_iterator it1=s1.begin();
-    std::string::const_iterator it2=s2.begin();
-
-    //stop when either string's end has been reached
-    while ( (it1!=s1.end()) && (it2!=s2.end()) && len-- > 0)
-    {
-        if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
-            // return -1 to indicate smaller than, 1 otherwise
-            return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
-        //proceed to the next character in each string
-        ++it1;
-        ++it2;
-    }
-    return 0;
-}
-
-/**
-    @brief Returns true if the string contains a comment, introduced by #, %, ; or //.
-    @param str The string
-    @return True if the string contains a comment
-*/
-bool hasComment(const std::string& str)
-{
-    return (getCommentPosition(str) != std::string::npos);
-}
-
-/**
-    @brief If the string contains a comment, the comment gets returned (including the comment symbol), an empty string otherwise.
-    @param str The string
-    @return The comment
-*/
-std::string getComment(const std::string& str)
-{
-    return str.substr(getCommentPosition(str));
-}
-
-/**
-    @brief If the string contains a comment, the position of the comment-symbol gets returned, std::string::npos otherwise.
-    @param str The string
-    @return The position
-*/
-size_t getCommentPosition(const std::string& str)
-{
-    return getNextCommentPosition(str, 0);
-}
-
-/**
-    @brief Returns the position of the next comment-symbol, starting with start.
-    @param str The string
-    @param start The startposition
-    @return The position
-*/
-size_t getNextCommentPosition(const std::string& str, size_t start)
-{
-    for (size_t i = start; i < str.size(); i++)
-        if (isComment(str.substr(i)))
-            return i;
-
-    return std::string::npos;
-}
Index: /code/trunk/src/util/String.h
===================================================================
--- /code/trunk/src/util/String.h	(revision 2170)
+++ /code/trunk/src/util/String.h	(revision 2171)
@@ -28,5 +28,5 @@
 
 /**
-    @file String.h
+    @file
     @brief Declaration of several string manipulation functions, used in many parts of the game.
 */
@@ -40,41 +40,44 @@
 #include <sstream>
 
-extern _UtilExport std::string BLANKSTRING;
-_UtilExport std::string getUniqueNumberString();
+namespace orxonox
+{
+    extern _UtilExport std::string BLANKSTRING;
+    _UtilExport std::string getUniqueNumberString();
 
-_UtilExport void        strip(std::string* str);
-_UtilExport std::string getStripped(const std::string& str);
+    _UtilExport void        strip(std::string* str);
+    _UtilExport std::string getStripped(const std::string& str);
 
-_UtilExport std::string removeTrailingWhitespaces(const std::string& str);
+    _UtilExport std::string removeTrailingWhitespaces(const std::string& str);
 
-_UtilExport size_t      getNextQuote(const std::string& str, size_t start);
-_UtilExport bool        isBetweenQuotes(const std::string& str, size_t pos);
+    _UtilExport size_t      getNextQuote(const std::string& str, size_t start);
+    _UtilExport bool        isBetweenQuotes(const std::string& str, size_t pos);
 
-_UtilExport bool        hasStringBetweenQuotes(const std::string& str);
-_UtilExport std::string getStringBetweenQuotes(const std::string& str);
+    _UtilExport bool        hasStringBetweenQuotes(const std::string& str);
+    _UtilExport std::string getStringBetweenQuotes(const std::string& str);
 
-_UtilExport std::string stripEnclosingQuotes(const std::string& str);
-_UtilExport std::string stripEnclosingBraces(const std::string& str);
+    _UtilExport std::string stripEnclosingQuotes(const std::string& str);
+    _UtilExport std::string stripEnclosingBraces(const std::string& str);
 
-_UtilExport bool        isEmpty(const std::string& str);
-_UtilExport bool        isComment(const std::string& str);
-_UtilExport bool        isNumeric(const std::string& str);
+    _UtilExport bool        isEmpty(const std::string& str);
+    _UtilExport bool        isComment(const std::string& str);
+    _UtilExport bool        isNumeric(const std::string& str);
 
-_UtilExport std::string addSlashes(const std::string& str);
-_UtilExport std::string removeSlashes(const std::string& str);
+    _UtilExport std::string addSlashes(const std::string& str);
+    _UtilExport std::string removeSlashes(const std::string& str);
 
-_UtilExport void        lowercase(std::string* str);
-_UtilExport std::string getLowercase(const std::string& str);
+    _UtilExport void        lowercase(std::string* str);
+    _UtilExport std::string getLowercase(const std::string& str);
 
-_UtilExport void        uppercase(std::string* str);
-_UtilExport std::string getUppercase(const std::string& str);
+    _UtilExport void        uppercase(std::string* str);
+    _UtilExport std::string getUppercase(const std::string& str);
 
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
+    _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
+    _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
 
-_UtilExport bool        hasComment(const std::string& str);
-_UtilExport std::string getComment(const std::string& str);
-_UtilExport size_t      getCommentPosition(const std::string& str);
-_UtilExport size_t      getNextCommentPosition(const std::string& str, size_t start = 0);
+    _UtilExport bool        hasComment(const std::string& str);
+    _UtilExport std::string getComment(const std::string& str);
+    _UtilExport size_t      getCommentPosition(const std::string& str);
+    _UtilExport size_t      getNextCommentPosition(const std::string& str, size_t start = 0);
+}
 
 #endif /* _Util_String_H__ */
Index: /code/trunk/src/util/SubString.cc
===================================================================
--- /code/trunk/src/util/SubString.cc	(revision 2170)
+++ /code/trunk/src/util/SubString.cc	(revision 2171)
@@ -40,521 +40,524 @@
 #include "SubString.h"
 
-/**
- * @brief default constructor
- */
-SubString::SubString()
-{}
-
-
-/**
- * @brief create a SubString from
- * @param string the String to Split
- * @param delimiter the Character at which to split string (delimiter)
- */
-SubString::SubString(const std::string& string, char delimiter)
+namespace orxonox
 {
-  this->split(string, delimiter);
-}
-
-
-/**
- * @brief Splits a String into multiple splitters.
- * @param string the String to split
- * @param delimiters multiple set of characters at what to split. (delimiters)
- * @param delimiterNeighbours neighbours of the delimiters, that will be erased only when near a delimiter.
- * @param emptyEntries If empty entries should be allewed or removed.
- * @param escapeChar The Escape Character that overrides splitters commends and so on...
- * @param safemode_char within these characters splitting won't happen
- * @param comment_char the Comment character.
- */
-SubString::SubString(const std::string& string,
-                     const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, bool removeEscapeChar, char safemode_char, bool removeSafemodeChar,
-                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
-{
-  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeEscapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
-}
-
-/**
- * @brief creates a SubSet of a SubString.
- * @param subString the SubString to take a set from.
- * @param subSetBegin the beginning to the end
- */
-SubString::SubString(const SubString& subString, unsigned int subSetBegin)
-{
-  for (unsigned int i = subSetBegin; i < subString.size(); i++)
-  {
-    this->strings.push_back(subString[i]);
-    this->bInSafemode.push_back(subString.isInSafemode(i));
-  }
-}
-
-
-/**
- * @brief creates a SubSet of a SubString.
- * @param subString the SubString to take a Set from
- * @param subSetBegin the beginning to the end
- * @param subSetEnd the end of the SubSet (max subString.size() will be checked internaly)
- */
-SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
-{
-  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
-  {
-    this->strings.push_back(subString[i]);
-    this->bInSafemode.push_back(subString.isInSafemode(i));
-  }
-}
-
-/**
- * @brief creates a Substring from a count and values set.
- * @param argc: the Arguments Count.
- * @param argv: Argument Values.
- */
-SubString::SubString(unsigned int argc, const char** argv)
-{
-  for(unsigned int i = 0; i < argc; ++i)
-  {
-    this->strings.push_back(std::string(argv[i]));
-    this->bInSafemode.push_back(false);
-  }
-}
-
-/**
- * @brief removes the object from memory
- */
-SubString::~SubString()
-{ }
-
-/** @brief An empty String */
-// const std::string SubString::emptyString = "";
-/** @brief Helper that gets you a String consisting of all White Spaces */
-const std::string SubString::WhiteSpaces = " \n\t";
-/** @brief Helper that gets you a String consisting of all WhiteSpaces and the Comma */
-const std::string SubString::WhiteSpacesWithComma = " \n\t,";
-/** An Empty SubString */
-const SubString SubString::NullSubString = SubString();
-
-/**
- * @brief stores the Value of subString in this SubString
- * @param subString will be copied into this String.
- * @returns this SubString.
- */
-SubString& SubString::operator=(const SubString& subString)
-{
-  this->strings = subString.strings;
-  this->bInSafemode = subString.bInSafemode;
-  return *this;
-}
-
-
-/**
- * @brief comparator.
- * @param subString the SubString to compare against this one.
- * @returns true if the Stored Strings match
- */
-bool SubString::operator==(const SubString& subString) const
-{
-  return ((this->strings == subString.strings) && (this->bInSafemode == subString.bInSafemode));
-}
-
-/**
- * @brief comparator.
- * @param subString the SubString to compare against this one.
- * @returns true if the Stored Strings match
- */
-bool SubString::compare(const SubString& subString) const
-{
-  return (*this == subString);
-}
-
-/**
- * @brief comparator.
- * @param subString the SubString to compare against this one.
- * @param length how many entries to compare. (from 0 to length)
- * @returns true if the Stored Strings match
- */
-bool SubString::compare(const SubString& subString, unsigned int length) const
-{
-  if (length > this->size() || length > subString.size())
-    return false;
-
-  for (unsigned int i = 0; i < length; i++)
-    if ((this->strings[i] != subString.strings[i]) || (this->bInSafemode[i] != subString.bInSafemode[i]))
-      return false;
-  return true;
-}
-
-
-/**
- * @brief append operator
- * @param subString the String to append.
- * @returns a SubString where this and subString are appended.
- */
-SubString SubString::operator+(const SubString& subString) const
-{
-  return SubString(*this) += subString;
-}
-
-
-/**
- * @brief append operator.
- * @param subString append subString to this SubString.
- * @returns this substring appended with subString
- */
-SubString& SubString::operator+=(const SubString& subString)
-{
-  for (unsigned int i = 0; i < subString.size(); i++)
-  {
-    this->strings.push_back(subString[i]);
-    this->bInSafemode.push_back(subString.isInSafemode(i));
-  }
-  return *this;
-}
-
-
-/**
- * @brief Split the String at
- * @param string where to split
- * @param splitter delimiter.
- */
-unsigned int SubString::split(const std::string& string, char splitter)
-{
-  this->strings.clear();
-  this->bInSafemode.clear();
-  char split[2];
-  split[0] = splitter;
-  split[1] = '\0';
-  SubString::splitLine(this->strings, this->bInSafemode, string, split);
-  return strings.size();
-}
-
-
-/**
- * @brief Splits a String into multiple splitters.
- * @param string the String to split
- * @param delimiters multiple set of characters at what to split. (delimiters)
- * @param delimiterNeighbours: Neighbours to the Delimiters that will be erased too.
- * @param emptyEntries: If empty entries are added to the List of SubStrings
- * @param escapeChar The Escape Character that overrides splitters commends and so on...
- * @param safemode_char within these characters splitting won't happen
- * @param comment_char the Comment character.
- */
-unsigned int SubString::split(const std::string& string,
-                              const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
-                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
-{
-  this->strings.clear();
-  this->bInSafemode.clear();
-  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
-  return this->strings.size();
-}
-
-
-/**
- * @brief joins together all Strings of this Substring.
- * @param delimiter the String between the subStrings.
- * @returns the joined String.
- */
-std::string SubString::join(const std::string& delimiter) const
-{
-  if (!this->strings.empty())
-  {
-    std::string retVal = this->strings[0];
-    for (unsigned int i = 1; i < this->strings.size(); i++)
-      retVal += delimiter + this->strings[i];
-    return retVal;
-  }
-  else
-  {
-    static std::string empty;
-    return empty;
-  }
-}
-
-
-/**
- * @brief creates a SubSet of a SubString.
- * @param subSetBegin the beginning to the end
- * @returns the SubSet
- *
- * This function is added for your convenience, and does the same as
- * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
- */
-SubString SubString::subSet(unsigned int subSetBegin) const
-{
-  return SubString(*this, subSetBegin);
-}
-
-
-/**
- * @brief creates a SubSet of a SubString.
- * @param subSetBegin the beginning to
- * @param subSetEnd the end of the SubSet to select (if bigger than subString.size() it will be downset.)
- * @returns the SubSet
- *
- * This function is added for your convenience, and does the same as
- * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
- */
-SubString SubString::subSet(unsigned int subSetBegin, unsigned int subSetEnd) const
-{
-  return SubString(*this, subSetBegin, subSetEnd);
-}
-
-
-/**
- * @brief splits line into tokens and stores them in ret.
- * @param ret the Array, where the Splitted strings will be stored in
- * to the beginning of the current token is stored
- * @param line the inputLine to split
- * @param delimiters a String of Delimiters (here the input will be splitted)
- * @param delimiterNeighbours Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter.
- * @param emptyEntries: if empty Strings are added to the List of Strings.
- * @param escape_char: Escape carater (escapes splitters)
- * @param safemode_char: the beginning of the safemode is marked with this
- * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
- * @param openparenthesis_char the beginning of a safemode is marked with this
- * @param closeparenthesis_char the ending of a safemode is marked with this
- * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
- * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
- * @param start_state: the Initial state on how to parse the String.
- * @return SPLIT_LINE_STATE the parser was in when returning
- *
- * This is the Actual Splitting Algorithm from Clemens Wacha
- * Supports delimiters, escape characters,
- * ignores special  characters between safemode_char and between comment_char and linend '\n'.
- */
-SubString::SPLIT_LINE_STATE
-SubString::splitLine(std::vector<std::string>& ret,
-                     std::vector<bool>& bInSafemode,
-                     const std::string& line,
-                     const std::string& delimiters,
-                     const std::string& delimiterNeighbours,
-                     bool emptyEntries,
-                     char escape_char,
-                     bool removeExcapeChar,
-                     char safemode_char,
-                     bool removeSafemodeChar,
-                     char openparenthesis_char,
-                     char closeparenthesis_char,
-                     bool removeParenthesisChars,
-                     char comment_char,
-                     SPLIT_LINE_STATE start_state)
-{
-  SPLIT_LINE_STATE state = start_state;
-  unsigned int i = 0;
-  unsigned int fallBackNeighbours = 0;
-
-  std::string token;
-  bool inSafemode = false;
-
-  if(start_state != SL_NORMAL && ret.size() > 0)
-  {
-    token = ret[ret.size()-1];
-    ret.pop_back();
-  }
-  if(start_state != SL_NORMAL && bInSafemode.size() > 0)
-  {
-    inSafemode = bInSafemode[bInSafemode.size()-1];
-    bInSafemode.pop_back();
-  }
-
-  while(i < line.size())
-  {
-    switch(state)
-    {
-      case SL_NORMAL:
-        if(line[i] == escape_char)
-        {
-          state = SL_ESCAPE;
-          if (!removeExcapeChar)
-            token += line[i];
-        }
-        else if(line[i] == safemode_char)
-        {
-          state = SL_SAFEMODE;
-          inSafemode = true;
-          if (!removeSafemodeChar)
-            token += line[i];
-        }
-        else if(line[i] == openparenthesis_char)
-        {
-          state = SL_PARENTHESES;
-          inSafemode = true;
-          if (!removeParenthesisChars)
-            token += line[i];
-        }
-        else if(line[i] == comment_char)
-        {
-          if (fallBackNeighbours > 0)
+    /**
+     * @brief default constructor
+     */
+    SubString::SubString()
+    {}
+
+
+    /**
+     * @brief create a SubString from
+     * @param string the String to Split
+     * @param delimiter the Character at which to split string (delimiter)
+     */
+    SubString::SubString(const std::string& string, char delimiter)
+    {
+        this->split(string, delimiter);
+    }
+
+
+    /**
+     * @brief Splits a String into multiple splitters.
+     * @param string the String to split
+     * @param delimiters multiple set of characters at what to split. (delimiters)
+     * @param delimiterNeighbours neighbours of the delimiters, that will be erased only when near a delimiter.
+     * @param emptyEntries If empty entries should be allewed or removed.
+     * @param escapeChar The Escape Character that overrides splitters commends and so on...
+     * @param safemode_char within these characters splitting won't happen
+     * @param comment_char the Comment character.
+     */
+    SubString::SubString(const std::string& string,
+                         const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
+                         char escapeChar, bool removeEscapeChar, char safemode_char, bool removeSafemodeChar,
+                         char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+    {
+        SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeEscapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
+    }
+
+    /**
+     * @brief creates a SubSet of a SubString.
+     * @param subString the SubString to take a set from.
+     * @param subSetBegin the beginning to the end
+     */
+    SubString::SubString(const SubString& subString, unsigned int subSetBegin)
+    {
+        for (unsigned int i = subSetBegin; i < subString.size(); i++)
+        {
+            this->strings.push_back(subString[i]);
+            this->bInSafemode.push_back(subString.isInSafemode(i));
+        }
+    }
+
+
+    /**
+     * @brief creates a SubSet of a SubString.
+     * @param subString the SubString to take a Set from
+     * @param subSetBegin the beginning to the end
+     * @param subSetEnd the end of the SubSet (max subString.size() will be checked internaly)
+     */
+    SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
+    {
+        for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
+        {
+            this->strings.push_back(subString[i]);
+            this->bInSafemode.push_back(subString.isInSafemode(i));
+        }
+    }
+
+    /**
+     * @brief creates a Substring from a count and values set.
+     * @param argc: the Arguments Count.
+     * @param argv: Argument Values.
+     */
+    SubString::SubString(unsigned int argc, const char** argv)
+    {
+        for(unsigned int i = 0; i < argc; ++i)
+        {
+            this->strings.push_back(std::string(argv[i]));
+            this->bInSafemode.push_back(false);
+        }
+    }
+
+    /**
+     * @brief removes the object from memory
+     */
+    SubString::~SubString()
+    { }
+
+    /** @brief An empty String */
+    // const std::string SubString::emptyString = "";
+    /** @brief Helper that gets you a String consisting of all White Spaces */
+    const std::string SubString::WhiteSpaces = " \n\t";
+    /** @brief Helper that gets you a String consisting of all WhiteSpaces and the Comma */
+    const std::string SubString::WhiteSpacesWithComma = " \n\t,";
+    /** An Empty SubString */
+    const SubString SubString::NullSubString = SubString();
+
+    /**
+     * @brief stores the Value of subString in this SubString
+     * @param subString will be copied into this String.
+     * @returns this SubString.
+     */
+    SubString& SubString::operator=(const SubString& subString)
+    {
+        this->strings = subString.strings;
+        this->bInSafemode = subString.bInSafemode;
+        return *this;
+    }
+
+
+    /**
+     * @brief comparator.
+     * @param subString the SubString to compare against this one.
+     * @returns true if the Stored Strings match
+     */
+    bool SubString::operator==(const SubString& subString) const
+    {
+        return ((this->strings == subString.strings) && (this->bInSafemode == subString.bInSafemode));
+    }
+
+    /**
+     * @brief comparator.
+     * @param subString the SubString to compare against this one.
+     * @returns true if the Stored Strings match
+     */
+    bool SubString::compare(const SubString& subString) const
+    {
+        return (*this == subString);
+    }
+
+    /**
+     * @brief comparator.
+     * @param subString the SubString to compare against this one.
+     * @param length how many entries to compare. (from 0 to length)
+     * @returns true if the Stored Strings match
+     */
+    bool SubString::compare(const SubString& subString, unsigned int length) const
+    {
+        if (length > this->size() || length > subString.size())
+            return false;
+
+        for (unsigned int i = 0; i < length; i++)
+            if ((this->strings[i] != subString.strings[i]) || (this->bInSafemode[i] != subString.bInSafemode[i]))
+                return false;
+        return true;
+    }
+
+
+    /**
+     * @brief append operator
+     * @param subString the String to append.
+     * @returns a SubString where this and subString are appended.
+     */
+    SubString SubString::operator+(const SubString& subString) const
+    {
+        return SubString(*this) += subString;
+    }
+
+
+    /**
+     * @brief append operator.
+     * @param subString append subString to this SubString.
+     * @returns this substring appended with subString
+     */
+    SubString& SubString::operator+=(const SubString& subString)
+    {
+        for (unsigned int i = 0; i < subString.size(); i++)
+        {
+            this->strings.push_back(subString[i]);
+            this->bInSafemode.push_back(subString.isInSafemode(i));
+        }
+        return *this;
+    }
+
+
+    /**
+     * @brief Split the String at
+     * @param string where to split
+     * @param splitter delimiter.
+     */
+    unsigned int SubString::split(const std::string& string, char splitter)
+    {
+        this->strings.clear();
+        this->bInSafemode.clear();
+        char split[2];
+        split[0] = splitter;
+        split[1] = '\0';
+        SubString::splitLine(this->strings, this->bInSafemode, string, split);
+        return strings.size();
+    }
+
+
+    /**
+     * @brief Splits a String into multiple splitters.
+     * @param string the String to split
+     * @param delimiters multiple set of characters at what to split. (delimiters)
+     * @param delimiterNeighbours: Neighbours to the Delimiters that will be erased too.
+     * @param emptyEntries: If empty entries are added to the List of SubStrings
+     * @param escapeChar The Escape Character that overrides splitters commends and so on...
+     * @param safemode_char within these characters splitting won't happen
+     * @param comment_char the Comment character.
+     */
+    unsigned int SubString::split(const std::string& string,
+                                  const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
+                                  char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                                  char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+    {
+        this->strings.clear();
+        this->bInSafemode.clear();
+        SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
+        return this->strings.size();
+    }
+
+
+    /**
+     * @brief joins together all Strings of this Substring.
+     * @param delimiter the String between the subStrings.
+     * @returns the joined String.
+     */
+    std::string SubString::join(const std::string& delimiter) const
+    {
+        if (!this->strings.empty())
+        {
+            std::string retVal = this->strings[0];
+            for (unsigned int i = 1; i < this->strings.size(); i++)
+                retVal += delimiter + this->strings[i];
+            return retVal;
+        }
+        else
+        {
+            static std::string empty;
+            return empty;
+        }
+    }
+
+
+    /**
+     * @brief creates a SubSet of a SubString.
+     * @param subSetBegin the beginning to the end
+     * @returns the SubSet
+     *
+     * This function is added for your convenience, and does the same as
+     * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
+     */
+    SubString SubString::subSet(unsigned int subSetBegin) const
+    {
+        return SubString(*this, subSetBegin);
+    }
+
+
+    /**
+     * @brief creates a SubSet of a SubString.
+     * @param subSetBegin the beginning to
+     * @param subSetEnd the end of the SubSet to select (if bigger than subString.size() it will be downset.)
+     * @returns the SubSet
+     *
+     * This function is added for your convenience, and does the same as
+     * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
+     */
+    SubString SubString::subSet(unsigned int subSetBegin, unsigned int subSetEnd) const
+    {
+        return SubString(*this, subSetBegin, subSetEnd);
+    }
+
+
+    /**
+     * @brief splits line into tokens and stores them in ret.
+     * @param ret the Array, where the Splitted strings will be stored in
+     * to the beginning of the current token is stored
+     * @param line the inputLine to split
+     * @param delimiters a String of Delimiters (here the input will be splitted)
+     * @param delimiterNeighbours Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter.
+     * @param emptyEntries: if empty Strings are added to the List of Strings.
+     * @param escape_char: Escape carater (escapes splitters)
+     * @param safemode_char: the beginning of the safemode is marked with this
+     * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
+     * @param openparenthesis_char the beginning of a safemode is marked with this
+     * @param closeparenthesis_char the ending of a safemode is marked with this
+     * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
+     * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
+     * @param start_state: the Initial state on how to parse the String.
+     * @return SPLIT_LINE_STATE the parser was in when returning
+     *
+     * This is the Actual Splitting Algorithm from Clemens Wacha
+     * Supports delimiters, escape characters,
+     * ignores special  characters between safemode_char and between comment_char and linend '\n'.
+     */
+    SubString::SPLIT_LINE_STATE
+    SubString::splitLine(std::vector<std::string>& ret,
+                         std::vector<bool>& bInSafemode,
+                         const std::string& line,
+                         const std::string& delimiters,
+                         const std::string& delimiterNeighbours,
+                         bool emptyEntries,
+                         char escape_char,
+                         bool removeExcapeChar,
+                         char safemode_char,
+                         bool removeSafemodeChar,
+                         char openparenthesis_char,
+                         char closeparenthesis_char,
+                         bool removeParenthesisChars,
+                         char comment_char,
+                         SPLIT_LINE_STATE start_state)
+    {
+        SPLIT_LINE_STATE state = start_state;
+        unsigned int i = 0;
+        unsigned int fallBackNeighbours = 0;
+
+        std::string token;
+        bool inSafemode = false;
+
+        if(start_state != SL_NORMAL && ret.size() > 0)
+        {
+            token = ret[ret.size()-1];
+            ret.pop_back();
+        }
+        if(start_state != SL_NORMAL && bInSafemode.size() > 0)
+        {
+            inSafemode = bInSafemode[bInSafemode.size()-1];
+            bInSafemode.pop_back();
+        }
+
+        while(i < line.size())
+        {
+            switch(state)
+            {
+            case SL_NORMAL:
+                if(line[i] == escape_char)
+                {
+                    state = SL_ESCAPE;
+                    if (!removeExcapeChar)
+                        token += line[i];
+                }
+                else if(line[i] == safemode_char)
+                {
+                    state = SL_SAFEMODE;
+                    inSafemode = true;
+                    if (!removeSafemodeChar)
+                        token += line[i];
+                }
+                else if(line[i] == openparenthesis_char)
+                {
+                    state = SL_PARENTHESES;
+                    inSafemode = true;
+                    if (!removeParenthesisChars)
+                        token += line[i];
+                }
+                else if(line[i] == comment_char)
+                {
+                    if (fallBackNeighbours > 0)
+                        token = token.substr(0, token.size() - fallBackNeighbours);
+                    /// FINISH
+                    if(emptyEntries || token.size() > 0)
+                    {
+                        ret.push_back(token);
+                        token.clear();
+                        bInSafemode.push_back(inSafemode);
+                        inSafemode = false;
+                    }
+                    token += line[i];       // EAT
+                    state = SL_COMMENT;
+                }
+                else if(delimiters.find(line[i]) != std::string::npos)
+                {
+                    // line[i] is a delimiter
+                    if (fallBackNeighbours > 0)
+                        token = token.substr(0, token.size() - fallBackNeighbours);
+                    /// FINISH
+                    if(emptyEntries || token.size() > 0)
+                    {
+                        ret.push_back(token);
+                        token.clear();
+                        bInSafemode.push_back(inSafemode);
+                        inSafemode = false;
+                    }
+                    state = SL_NORMAL;
+                }
+                else
+                {
+                    if (delimiterNeighbours.find(line[i]) != std::string::npos)
+                    {
+                        if (token.size() > 0)
+                            ++fallBackNeighbours;
+                        else
+                        {
+                            i++;
+                            continue;
+                        }
+                    }
+                    else
+                        fallBackNeighbours = 0;
+                    token += line[i];       // EAT
+                }
+                break;
+            case SL_ESCAPE:
+                if (!removeSafemodeChar)
+                    token += line[i];
+                else
+                {
+                    if(line[i] == 'n') token += '\n';
+                    else if(line[i] == 't') token += '\t';
+                    else if(line[i] == 'v') token += '\v';
+                    else if(line[i] == 'b') token += '\b';
+                    else if(line[i] == 'r') token += '\r';
+                    else if(line[i] == 'f') token += '\f';
+                    else if(line[i] == 'a') token += '\a';
+                    else if(line[i] == '?') token += '\?';
+                    else token += line[i];  // EAT
+                }
+                state = SL_NORMAL;
+                break;
+            case SL_SAFEMODE:
+                if(line[i] == safemode_char)
+                {
+                    state = SL_NORMAL;
+                    if (!removeSafemodeChar)
+                        token += line[i];
+                }
+                else if(line[i] == escape_char)
+                {
+                    state = SL_SAFEESCAPE;
+                }
+                else
+                {
+                    token += line[i];       // EAT
+                }
+                break;
+
+            case SL_SAFEESCAPE:
+                if(line[i] == 'n') token += '\n';
+                else if(line[i] == 't') token += '\t';
+                else if(line[i] == 'v') token += '\v';
+                else if(line[i] == 'b') token += '\b';
+                else if(line[i] == 'r') token += '\r';
+                else if(line[i] == 'f') token += '\f';
+                else if(line[i] == 'a') token += '\a';
+                else if(line[i] == '?') token += '\?';
+                else token += line[i];  // EAT
+                state = SL_SAFEMODE;
+                break;
+
+            case SL_PARENTHESES:
+                if(line[i] == closeparenthesis_char)
+                {
+                    state = SL_NORMAL;
+                    if (!removeParenthesisChars)
+                        token += line[i];
+                }
+                else if(line[i] == escape_char)
+                {
+                    state = SL_PARENTHESESESCAPE;
+                }
+                else
+                {
+                    token += line[i];       // EAT
+                }
+                break;
+
+            case SL_PARENTHESESESCAPE:
+                if(line[i] == 'n') token += '\n';
+                else if(line[i] == 't') token += '\t';
+                else if(line[i] == 'v') token += '\v';
+                else if(line[i] == 'b') token += '\b';
+                else if(line[i] == 'r') token += '\r';
+                else if(line[i] == 'f') token += '\f';
+                else if(line[i] == 'a') token += '\a';
+                else if(line[i] == '?') token += '\?';
+                else token += line[i];  // EAT
+                state = SL_PARENTHESES;
+                break;
+
+            case SL_COMMENT:
+                if(line[i] == '\n')
+                {
+                    /// FINISH
+                    if(token.size() > 0)
+                    {
+                        ret.push_back(token);
+                        token.clear();
+                        bInSafemode.push_back(inSafemode);
+                        inSafemode = false;
+                    }
+                    state = SL_NORMAL;
+                }
+                else
+                {
+                    token += line[i];       // EAT
+                }
+                break;
+
+            default:
+                // nothing
+                break;
+            }
+            i++;
+        }
+
+        /// FINISH
+        if (fallBackNeighbours > 0)
             token = token.substr(0, token.size() - fallBackNeighbours);
-          /// FINISH
-          if(emptyEntries || token.size() > 0)
-          {
+        if(emptyEntries || token.size() > 0)
+        {
             ret.push_back(token);
             token.clear();
             bInSafemode.push_back(inSafemode);
             inSafemode = false;
-          }
-          token += line[i];       // EAT
-          state = SL_COMMENT;
-        }
-        else if(delimiters.find(line[i]) != std::string::npos)
-        {
-          // line[i] is a delimiter
-          if (fallBackNeighbours > 0)
-            token = token.substr(0, token.size() - fallBackNeighbours);
-          /// FINISH
-          if(emptyEntries || token.size() > 0)
-          {
-            ret.push_back(token);
-            token.clear();
-            bInSafemode.push_back(inSafemode);
-            inSafemode = false;
-          }
-          state = SL_NORMAL;
-        }
-        else
-        {
-          if (delimiterNeighbours.find(line[i]) != std::string::npos)
-          {
-            if (token.size() > 0)
-              ++fallBackNeighbours;
-            else
-            {
-              i++;
-              continue;
-            }
-          }
-          else
-            fallBackNeighbours = 0;
-          token += line[i];       // EAT
-        }
-        break;
-      case SL_ESCAPE:
-        if (!removeSafemodeChar)
-          token += line[i];
-        else
-        {
-          if(line[i] == 'n') token += '\n';
-          else if(line[i] == 't') token += '\t';
-          else if(line[i] == 'v') token += '\v';
-          else if(line[i] == 'b') token += '\b';
-          else if(line[i] == 'r') token += '\r';
-          else if(line[i] == 'f') token += '\f';
-          else if(line[i] == 'a') token += '\a';
-          else if(line[i] == '?') token += '\?';
-          else token += line[i];  // EAT
-        }
-        state = SL_NORMAL;
-        break;
-      case SL_SAFEMODE:
-        if(line[i] == safemode_char)
-        {
-          state = SL_NORMAL;
-          if (!removeSafemodeChar)
-            token += line[i];
-        }
-        else if(line[i] == escape_char)
-        {
-          state = SL_SAFEESCAPE;
-        }
-        else
-        {
-          token += line[i];       // EAT
-        }
-        break;
-
-      case SL_SAFEESCAPE:
-        if(line[i] == 'n') token += '\n';
-        else if(line[i] == 't') token += '\t';
-        else if(line[i] == 'v') token += '\v';
-        else if(line[i] == 'b') token += '\b';
-        else if(line[i] == 'r') token += '\r';
-        else if(line[i] == 'f') token += '\f';
-        else if(line[i] == 'a') token += '\a';
-        else if(line[i] == '?') token += '\?';
-        else token += line[i];  // EAT
-        state = SL_SAFEMODE;
-        break;
-
-      case SL_PARENTHESES:
-        if(line[i] == closeparenthesis_char)
-        {
-          state = SL_NORMAL;
-          if (!removeParenthesisChars)
-            token += line[i];
-        }
-        else if(line[i] == escape_char)
-        {
-          state = SL_PARENTHESESESCAPE;
-        }
-        else
-        {
-          token += line[i];       // EAT
-        }
-        break;
-
-      case SL_PARENTHESESESCAPE:
-        if(line[i] == 'n') token += '\n';
-        else if(line[i] == 't') token += '\t';
-        else if(line[i] == 'v') token += '\v';
-        else if(line[i] == 'b') token += '\b';
-        else if(line[i] == 'r') token += '\r';
-        else if(line[i] == 'f') token += '\f';
-        else if(line[i] == 'a') token += '\a';
-        else if(line[i] == '?') token += '\?';
-        else token += line[i];  // EAT
-        state = SL_PARENTHESES;
-        break;
-
-      case SL_COMMENT:
-        if(line[i] == '\n')
-        {
-          /// FINISH
-          if(token.size() > 0)
-          {
-            ret.push_back(token);
-            token.clear();
-            bInSafemode.push_back(inSafemode);
-            inSafemode = false;
-          }
-          state = SL_NORMAL;
-        }
-        else
-        {
-          token += line[i];       // EAT
-        }
-        break;
-
-      default:
-        // nothing
-        break;
-    }
-    i++;
-  }
-
-  /// FINISH
-  if (fallBackNeighbours > 0)
-    token = token.substr(0, token.size() - fallBackNeighbours);
-  if(emptyEntries || token.size() > 0)
-  {
-    ret.push_back(token);
-    token.clear();
-    bInSafemode.push_back(inSafemode);
-    inSafemode = false;
-  }
-  return(state);
+        }
+        return(state);
+    }
+
+
+    /**
+     * @brief Some nice debug information about this SubString
+     */
+    void SubString::debug() const
+    {
+        printf("Substring-information::count=%d ::", this->strings.size());
+        for (unsigned int i = 0; i < this->strings.size(); i++)
+            printf("s%d='%s'::", i, this->strings[i].c_str());
+        printf("\n");
+    }
 }
-
-
-/**
- * @brief Some nice debug information about this SubString
- */
-void SubString::debug() const
-{
-  printf("Substring-information::count=%d ::", this->strings.size());
-  for (unsigned int i = 0; i < this->strings.size(); i++)
-    printf("s%d='%s'::", i, this->strings[i].c_str());
-  printf("\n");
-}
Index: /code/trunk/src/util/SubString.h
===================================================================
--- /code/trunk/src/util/SubString.h	(revision 2170)
+++ /code/trunk/src/util/SubString.h	(revision 2171)
@@ -38,5 +38,5 @@
 
  /*!
- * @file substring.h
+ * @file
  * @brief a small class to get the parts of a string separated by commas
  *
@@ -64,110 +64,113 @@
 #include <string>
 
-//! A class that can load one string and split it in multipe ones
-/**
- * SubString is a very Powerfull way to create a SubSet from a String
- * It can be used, to Split strings append them and join them again.
- */
-class _UtilExport SubString
+namespace orxonox
 {
-public:
-  //! An enumerator for the State the Parser is in
-  typedef enum {
-    SL_NORMAL,            //!< Normal state
-    SL_ESCAPE,            //!< After an escape character
-    SL_SAFEMODE,          //!< In safe mode (between "" mostly).
-    SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
-    SL_COMMENT,           //!< In Comment mode.
-    SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
-    SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
-  } SPLIT_LINE_STATE;
+    //! A class that can load one string and split it in multipe ones
+    /**
+     * SubString is a very Powerfull way to create a SubSet from a String
+     * It can be used, to Split strings append them and join them again.
+     */
+    class _UtilExport SubString
+    {
+    public:
+        //! An enumerator for the State the Parser is in
+        typedef enum {
+            SL_NORMAL,            //!< Normal state
+            SL_ESCAPE,            //!< After an escape character
+            SL_SAFEMODE,          //!< In safe mode (between "" mostly).
+            SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
+            SL_COMMENT,           //!< In Comment mode.
+            SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
+            SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
+        } SPLIT_LINE_STATE;
 
 
-public:
-  SubString();
-  SubString(const std::string& string, char delimiter = ',');
-  SubString(const std::string& string,
-            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
-  SubString(unsigned int argc, const char** argv);
-  /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
-  SubString(const SubString& subString) { *this = subString; };
-  SubString(const SubString& subString, unsigned int subSetBegin);
-  SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd);
-  ~SubString();
+    public:
+        SubString();
+        SubString(const std::string& string, char delimiter = ',');
+        SubString(const std::string& string,
+                  const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
+                  char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                  char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+        SubString(unsigned int argc, const char** argv);
+        /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
+        SubString(const SubString& subString) { *this = subString; };
+        SubString(const SubString& subString, unsigned int subSetBegin);
+        SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd);
+        ~SubString();
 
-  // operate on the SubString
-  SubString& operator=(const SubString& subString);
-  bool operator==(const SubString& subString) const;
-  bool compare(const SubString& subString) const;
-  bool compare(const SubString& subString, unsigned int length) const;
-  SubString operator+(const SubString& subString) const;
-  SubString& operator+=(const SubString& subString);
-  /** @param subString the String to append @returns appended String. @brief added for convenience */
-  SubString& append(const SubString subString) { return (*this += subString); };
+        // operate on the SubString
+        SubString& operator=(const SubString& subString);
+        bool operator==(const SubString& subString) const;
+        bool compare(const SubString& subString) const;
+        bool compare(const SubString& subString, unsigned int length) const;
+        SubString operator+(const SubString& subString) const;
+        SubString& operator+=(const SubString& subString);
+        /** @param subString the String to append @returns appended String. @brief added for convenience */
+        SubString& append(const SubString subString) { return (*this += subString); };
 
-  /////////////////////////////////////////
-  // Split and Join the any String. ///////
-  unsigned int split(const std::string& string = "", char delimiter = ',');
-  unsigned int split(const std::string& string,
-                     const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
-                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
-  std::string join(const std::string& delimiter = " ") const;
-  ////////////////////////////////////////
+        /////////////////////////////////////////
+        // Split and Join the any String. ///////
+        unsigned int split(const std::string& string = "", char delimiter = ',');
+        unsigned int split(const std::string& string,
+                           const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
+                           char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                           char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+        std::string join(const std::string& delimiter = " ") const;
+        ////////////////////////////////////////
 
-  // retrieve a SubSet from the String
-  SubString subSet(unsigned int subSetBegin) const;
-  SubString subSet(unsigned int subSetBegin, unsigned int subSetEnd) const;
+        // retrieve a SubSet from the String
+        SubString subSet(unsigned int subSetBegin) const;
+        SubString subSet(unsigned int subSetBegin, unsigned int subSetEnd) const;
 
-  // retrieve Information from within
-  /** @brief Returns true if the SubString is empty */
-  inline bool empty() const { return this->strings.empty(); };
-  /** @brief Returns the count of Strings stored in this substring */
-  inline unsigned int size() const { return this->strings.size(); };
-  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
-  inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
-  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
-  inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
-  /** @brief Returns all Strings as std::vector */
-  inline const std::vector<std::string>& getAllStrings() const { return this->strings; }
-  /** @brief Returns true if the token is in safemode. @param i the i'th token */
-  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
-  /** @brief Returns the front of the StringList. */
-  inline const std::string& front() const { return this->strings.front(); };
-  /** @brief Returns the back of the StringList. */
-  inline const std::string& back() const { return this->strings.back(); };
-  /** @brief removes the back of the strings list. */
-  inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
+        // retrieve Information from within
+        /** @brief Returns true if the SubString is empty */
+        inline bool empty() const { return this->strings.empty(); };
+        /** @brief Returns the count of Strings stored in this substring */
+        inline unsigned int size() const { return this->strings.size(); };
+        /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
+        inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
+        /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
+        inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
+        /** @brief Returns all Strings as std::vector */
+        inline const std::vector<std::string>& getAllStrings() const { return this->strings; }
+        /** @brief Returns true if the token is in safemode. @param i the i'th token */
+        inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
+        /** @brief Returns the front of the StringList. */
+        inline const std::string& front() const { return this->strings.front(); };
+        /** @brief Returns the back of the StringList. */
+        inline const std::string& back() const { return this->strings.back(); };
+        /** @brief removes the back of the strings list. */
+        inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
 
-  // the almighty algorithm.
-  static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
-                                    std::vector<bool>& bInSafemode,
-                                    const std::string& line,
-                                    const std::string& delimiters = SubString::WhiteSpaces,
-                                    const std::string& delimiterNeighbours = "",
-                                    bool emptyEntries = false,
-                                    char escape_char = '\\',
-                                    bool removeExcapeChar = true,
-                                    char safemode_char = '"',
-                                    bool removeSafemodeChar = true,
-                                    char openparenthesis_char = '(',
-                                    char closeparenthesis_char = ')',
-                                    bool removeParenthesisChars = true,
-                                    char comment_char = '\0',
-                                    SPLIT_LINE_STATE start_state = SL_NORMAL);
-  // debugging.
-  void debug() const;
+        // the almighty algorithm.
+        static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
+                                          std::vector<bool>& bInSafemode,
+                                          const std::string& line,
+                                          const std::string& delimiters = SubString::WhiteSpaces,
+                                          const std::string& delimiterNeighbours = "",
+                                          bool emptyEntries = false,
+                                          char escape_char = '\\',
+                                          bool removeExcapeChar = true,
+                                          char safemode_char = '"',
+                                          bool removeSafemodeChar = true,
+                                          char openparenthesis_char = '(',
+                                          char closeparenthesis_char = ')',
+                                          bool removeParenthesisChars = true,
+                                          char comment_char = '\0',
+                                          SPLIT_LINE_STATE start_state = SL_NORMAL);
+        // debugging.
+        void debug() const;
 
-public:
-  static const std::string WhiteSpaces;
-  static const std::string WhiteSpacesWithComma;
-  static const SubString   NullSubString;
+    public:
+        static const std::string WhiteSpaces;
+        static const std::string WhiteSpacesWithComma;
+        static const SubString   NullSubString;
 
-private:
-  std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
-  std::vector<bool>         bInSafemode;
-};
+    private:
+        std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
+        std::vector<bool>         bInSafemode;
+    };
+}
 
 #endif /* __SubString_H__ */
Index: /code/trunk/src/util/UtilPrereqs.h
===================================================================
--- /code/trunk/src/util/UtilPrereqs.h	(revision 2170)
+++ /code/trunk/src/util/UtilPrereqs.h	(revision 2171)
@@ -60,15 +60,16 @@
 // Forward declarations
 //-----------------------------------------------------------------------
-class ArgReader;
-class Convert;
-class ExprParser;
-class MultiType;
-class SubString;
 namespace orxonox
 {
+    class Exception;
+    class ExprParser;
+    class IntVector2;
+    class IntVector3;
+    class MultiType;
     class OutputBuffer;
     class OutputBufferListener;
-    class Error;
     class OutputHandler;
+    class SignalHandler;
+    class SubString;
 }
 
Index: /code/trunk/src/util/mbool.h
===================================================================
--- /code/trunk/src/util/mbool.h	(revision 2171)
+++ /code/trunk/src/util/mbool.h	(revision 2171)
@@ -0,0 +1,79 @@
+/*
+ *   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 _mbool_H__
+#define _mbool_H__
+
+#include "UtilPrereqs.h"
+
+namespace orxonox
+{
+    struct _UtilExport mbool
+    {
+        public:
+            inline mbool(bool value = false)
+                { this->value_.memory_ = 0; this->value_.bool_ = value; }
+            inline mbool(const mbool& value)
+                { this->value_.memory_ = value.value_.memory_; }
+
+            inline const mbool& operator=(bool value)
+                { if (value != this->value_.bool_) { ++this->value_.memory_; } return (*this); }
+            inline const mbool& operator=(const mbool& value)
+                { this->value_.memory_ = value.value_.memory_; return (*this); }
+
+            inline mbool& operator++()
+                { ++this->value_.memory_; return (*this); }
+            inline mbool operator++(int i)
+                { mbool temp = (*this); ++this->value_.memory_; return temp; }
+
+            inline operator bool() const
+                { return this->value_.bool_; }
+
+            inline bool operator==(bool other) const
+                { return this->value_.bool_ == other; }
+            inline bool operator!=(bool other) const
+                { return this->value_.bool_ != other; }
+
+            inline bool operator==(const mbool& other) const
+                { return this->value_.memory_ == other.value_.memory_; }
+            inline bool operator!=(const mbool& other) const
+                { return this->value_.memory_ != other.value_.memory_; }
+
+            inline bool operator!() const
+                { return (!this->value_.bool_); }
+
+        private:
+            union
+            {
+                bool bool_ : 1;
+                unsigned char memory_;
+            } value_;
+    };
+}
+
+#endif /* _mbool_H__ */
Index: /code/trunk/visual_studio/vc8/orxonox.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 2170)
+++ /code/trunk/visual_studio/vc8/orxonox.vcproj	(revision 2171)
@@ -167,4 +167,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\orxonox\PlayerManager.cc"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\orxonox\PrecompiledHeaderFiles.cc"
 				>
@@ -206,4 +210,8 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\objects\Level.cc"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\objects\Radar.cc"
 					>
@@ -358,8 +366,4 @@
 					<File
 						RelativePath="..\..\src\orxonox\objects\infos\Info.cc"
-						>
-					</File>
-					<File
-						RelativePath="..\..\src\orxonox\objects\infos\Level.cc"
 						>
 					</File>
@@ -827,4 +831,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\orxonox\PlayerManager.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\orxonox\Settings.h"
 				>
@@ -846,4 +854,8 @@
 				</File>
 				<File
+					RelativePath="..\..\src\orxonox\objects\Level.h"
+					>
+				</File>
+				<File
 					RelativePath="..\..\src\orxonox\objects\Radar.h"
 					>
@@ -978,8 +990,4 @@
 					<File
 						RelativePath="..\..\src\orxonox\objects\infos\Info.h"
-						>
-					</File>
-					<File
-						RelativePath="..\..\src\orxonox\objects\infos\Level.h"
 						>
 					</File>
Index: /code/trunk/visual_studio/vc8/util.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/util.vcproj	(revision 2170)
+++ /code/trunk/visual_studio/vc8/util.vcproj	(revision 2171)
@@ -235,4 +235,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\util\mbool.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\util\MultiType.h"
 				>
