Index: code/trunk/src/libraries/core/BaseObject.cc
===================================================================
--- code/trunk/src/libraries/core/BaseObject.cc	(revision 9576)
+++ code/trunk/src/libraries/core/BaseObject.cc	(revision 9667)
@@ -39,5 +39,4 @@
 #include "Event.h"
 #include "EventIncludes.h"
-#include "Iterator.h"
 #include "Template.h"
 #include "XMLFile.h"
@@ -45,15 +44,18 @@
 #include "XMLPort.h"
 #include "command/Functor.h"
+#include "object/Iterator.h"
+
+#include "class/OrxonoxInterface.h" // we include this only to include OrxonoxInterface.h at least once in core to keep MSVC happy...
 
 namespace orxonox
 {
-    CreateFactory(BaseObject);
+    RegisterClass(BaseObject);
 
     /**
         @brief Constructor: Registers the object in the BaseObject-list.
     */
-    BaseObject::BaseObject(BaseObject* creator) : bInitialized_(false)
-    {
-        RegisterRootObject(BaseObject);
+    BaseObject::BaseObject(Context* context) : bInitialized_(false)
+    {
+        RegisterObject(BaseObject);
 
         this->bInitialized_ = true;
@@ -68,4 +70,8 @@
         this->mainStateFunctor_ = 0;
 
+        if (context)
+            this->setContext(context);
+
+        BaseObject* creator = orxonox_cast<BaseObject*>(context);
         this->setCreator(creator);
         if (this->creator_)
@@ -199,5 +205,5 @@
         {
             this->networkTemplateNames_.insert(temp->getLink());
-            
+
             Template* link;
             assert(!(link = Template::getTemplate(temp->getLink())) || !link->isLink());
Index: code/trunk/src/libraries/core/BaseObject.h
===================================================================
--- code/trunk/src/libraries/core/BaseObject.h	(revision 9576)
+++ code/trunk/src/libraries/core/BaseObject.h	(revision 9667)
@@ -49,7 +49,7 @@
 
 #include "util/mbool.h"
-#include "OrxonoxClass.h"
-#include "Super.h"
-#include "SmartPtr.h"
+#include "class/OrxonoxClass.h"
+#include "class/Super.h"
+#include "object/SmartPtr.h"
 
 namespace orxonox
@@ -60,10 +60,10 @@
 
     /// The BaseObject is the parent of all classes representing an instance in the game.
-    class _CoreExport BaseObject : virtual public OrxonoxClass
+    class _CoreExport BaseObject : public OrxonoxClass
     {
         template <class T> friend class XMLPortClassParamContainer;
 
         public:
-            BaseObject(BaseObject* creator);
+            BaseObject(Context* context);
             virtual ~BaseObject();
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Index: code/trunk/src/libraries/core/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/CMakeLists.txt	(revision 9576)
+++ code/trunk/src/libraries/core/CMakeLists.txt	(revision 9667)
@@ -22,6 +22,4 @@
 #BUILD_UNIT CoreStableBuildUnit.cc
   ClassTreeMask.cc
-  CommandLineParser.cc
-  ConfigValueContainer.cc
   DynLib.cc
   DynLibManager.cc
@@ -30,13 +28,9 @@
   GameMode.cc
   GameState.cc
-  Identifier.cc
   Language.cc
   Loader.cc
   LuaState.cc
-  MetaObjectList.cc
   Namespace.cc
   NamespaceNode.cc
-  ObjectListBase.cc
-  OrxonoxClass.cc
   Template.cc
   ViewportEventListener.cc
@@ -57,5 +51,5 @@
 BUILD_UNIT FilesystemBuildUnit.cc
   command/ArgumentCompletionFunctions.cc
-  ConfigFileManager.cc
+  config/ConfigFile.cc
   PathConfig.cc
 END_BUILD_UNIT
@@ -68,6 +62,9 @@
 )
 
+ADD_SUBDIRECTORY(class)
 ADD_SUBDIRECTORY(command)
+ADD_SUBDIRECTORY(config)
 ADD_SUBDIRECTORY(input)
+ADD_SUBDIRECTORY(object)
 
 ORXONOX_ADD_LIBRARY(core
@@ -75,5 +72,5 @@
   TOLUA_FILES
     command/CommandExecutor.h
-    ConfigFileManager.h
+    config/SettingsConfigFile.h
     Game.h
     GameMode.h
Index: code/trunk/src/libraries/core/ClassFactory.h
===================================================================
--- code/trunk/src/libraries/core/ClassFactory.h	(revision 9576)
+++ 	(revision )
@@ -1,91 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Object Factory
-    @brief Definition and implementation of the ClassFactory class
-
-    The ClassFactory is able to create new objects of a specific class which creates objects.
-*/
-
-#ifndef _ClassFactory_H__
-#define _ClassFactory_H__
-
-#include "CorePrereqs.h"
-
-#include <string>
-
-#include "util/Output.h"
-#include "Identifier.h"
-
-namespace orxonox
-{
-    // ###########################
-    // ###       Factory       ###
-    // ###########################
-    /// Base-class of ClassFactory.
-    class _CoreExport Factory
-    {
-        public:
-            virtual ~Factory() {};
-            virtual BaseObject* fabricate(BaseObject* creator) = 0;
-    };
-
-    // ###############################
-    // ###      ClassFactory       ###
-    // ###############################
-    /// The ClassFactory is able to create new objects of a specific class.
-    template <class T>
-    class ClassFactory : public Factory
-    {
-        public:
-            /**
-                @brief Constructor: Adds the ClassFactory to the Identifier of the same type.
-                @param name The name of the class
-                @param bLoadable True if the class can be loaded through XML
-            */
-            ClassFactory(const std::string& name, bool bLoadable = true)
-            {
-                orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
-                ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
-                ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);
-            }
-
-            /**
-                @brief Creates and returns a new object of class T.
-                @return The new object
-            */
-            inline BaseObject* fabricate(BaseObject* creator)
-            {
-                return static_cast<BaseObject*>(new T(creator));
-            }
-    };
-}
-
-#endif /* _ClassFactory_H__ */
Index: code/trunk/src/libraries/core/ClassTreeMask.cc
===================================================================
--- code/trunk/src/libraries/core/ClassTreeMask.cc	(revision 9576)
+++ code/trunk/src/libraries/core/ClassTreeMask.cc	(revision 9667)
@@ -33,5 +33,5 @@
 
 #include "ClassTreeMask.h"
-#include "Identifier.h"
+#include "class/Identifier.h"
 
 namespace orxonox
@@ -849,5 +849,5 @@
         // If there is a first subclass, move the object-iterator to the first object of this class. Else go to the end
         if (this->subclassIterator_ != this->subclasses_.end())
-            this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
+            this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin();
         else
             this->objectIterator_ = ObjectList<BaseObject>::end();
@@ -881,5 +881,5 @@
                     // Check if there really is a next class. If yes, move the object-iterator to the first object
                     if (this->subclassIterator_ != this->subclasses_.end())
-                        this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
+                        this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin();
                     else
                         return (*this);
Index: code/trunk/src/libraries/core/ClassTreeMask.h
===================================================================
--- code/trunk/src/libraries/core/ClassTreeMask.h	(revision 9576)
+++ code/trunk/src/libraries/core/ClassTreeMask.h	(revision 9667)
@@ -73,5 +73,5 @@
 #include <stack>
 #include "BaseObject.h"
-#include "Iterator.h"
+#include "object/Iterator.h"
 
 namespace orxonox
Index: code/trunk/src/libraries/core/CommandLineParser.cc
===================================================================
--- code/trunk/src/libraries/core/CommandLineParser.cc	(revision 9576)
+++ 	(revision )
@@ -1,340 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "CommandLineParser.h"
-
-#include <algorithm>
-#include <sstream>
-
-#include "util/Convert.h"
-#include "util/Output.h"
-#include "util/Exception.h"
-#include "util/StringUtils.h"
-#include "util/SubString.h"
-#include "PathConfig.h"
-
-namespace orxonox
-{
-    /**
-    @brief
-        Parses a value string for a command line argument.
-        It simply uses convertValue(Output, Input) to do that.
-        Bools are treated specially. That is necessary
-        so that you can have simple command line switches.
-    */
-    void CommandLineArgument::parse(const std::string& value)
-    {
-        if (value_.isType<bool>())
-        {
-            // simulate command line switch
-            bool temp;
-            if (convertValue(&temp, value))
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = temp;
-            }
-            else if (value.empty())
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = true;
-            }
-            else
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-        }
-        else
-        {
-            if (!value_.set(value))
-            {
-                value_.set(defaultValue_);
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-            }
-            else
-                this->bHasDefaultValue_ = false;
-        }
-    }
-
-
-    /**
-    @brief
-        Destructor destroys all CommandLineArguments with it.
-    */
-    CommandLineParser::~CommandLineParser()
-    {
-        CommandLineParser::destroyAllArguments();
-    }
-
-    /**
-    @brief
-        Returns a unique instance (Meyers Singleton).
-    */
-    CommandLineParser& CommandLineParser::_getInstance()
-    {
-        static CommandLineParser instance;
-        return instance;
-    }
-
-    /**
-    @brief
-        Destroys all command line arguments. This should be called at the end
-        of main. Do not use before that.
-    */
-    void CommandLineParser::destroyAllArguments()
-    {
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
-            it != _getInstance().cmdLineArgs_.end(); ++it)
-            delete it->second;
-        _getInstance().cmdLineArgs_.clear();
-    }
-
-    /** Parses the command line string for arguments and stores these.
-    @note
-        The reason that you have to provide the string to be parsed as
-        space separated list is because of argc and argv. If you only have
-        a whole string, simply use getAllStrings() of SubString.
-    @param cmdLine
-        Command line string WITHOUT the execution path.
-    */
-    void CommandLineParser::_parse(const std::string& cmdLine)
-    {
-        std::vector<std::string> arguments;
-        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '\0', '\0', false);
-        for (unsigned i = 0; i < tokens.size(); ++i)
-            arguments.push_back(tokens[i]);
-
-        try
-        {
-            // why this? See bFirstTimeParse_ declaration.
-            if (bFirstTimeParse_)
-            {
-                // first shove all the shortcuts in a map
-                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
-                    it != cmdLineArgs_.end(); ++it)
-                {
-                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
-                        "Cannot have two command line shortcut with the same name.");
-                    if (!it->second->getShortcut().empty())
-                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
-                }
-                bFirstTimeParse_ = false;
-            }
-
-            std::string name;
-            std::string shortcut;
-            std::string value;
-            for (unsigned int i = 0; i < arguments.size(); ++i)
-            {
-                if (arguments[i].size() != 0)
-                {
-                    // sure not ""
-                    if (arguments[i][0] == '-')
-                    {
-                        // start with "-"
-                        if (arguments[i].size() == 1)
-                        {
-                            // argument[i] is "-", probably a minus sign
-                            value += "- ";
-                        }
-                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
-                        {
-                            // negative number as a value
-                            value += arguments[i] + ' ';
-                        }
-                        else
-                        {
-                            // can be shortcut or full name argument
-
-                            // save old data first
-                            value = removeTrailingWhitespaces(value);
-                            if (!name.empty())
-                            {
-                                checkFullArgument(name, value);
-                                name.clear();
-                                assert(shortcut.empty());
-                            }
-                            else if (!shortcut.empty())
-                            {
-                                checkShortcut(shortcut, value);
-                                shortcut.clear();
-                                assert(name.empty());
-                            }
-
-                            if (arguments[i][1] == '-')
-                            {
-                                // full name argument with "--name"
-                                name = arguments[i].substr(2);
-                            }
-                            else
-                            {
-                                // shortcut with "-s"
-                                shortcut = arguments[i].substr(1);
-                            }
-
-                            // reset value string
-                            value.clear();
-                        }
-                    }
-                    else
-                    {
-                        // value string
-
-                        if (name.empty() && shortcut.empty())
-                        {
-                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
-                        }
-
-                        // Concatenate strings as long as there's no new argument by "-" or "--"
-                        value += arguments[i] + ' ';
-                    }
-                }
-            }
-
-            // parse last argument
-            value = removeTrailingWhitespaces(value);
-            if (!name.empty())
-            {
-                checkFullArgument(name, value);
-                assert(shortcut.empty());
-            }
-            else if (!shortcut.empty())
-            {
-                checkShortcut(shortcut, value);
-                assert(name.empty());
-            }
-        }
-        catch (const ArgumentException& ex)
-        {
-            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
-            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
-            throw GeneralException("");
-        }
-    }
-
-    /**
-    @brief
-        Parses an argument based on its full name.
-    @param name
-        Full name of the argument
-    @param value
-        String containing the value
-    @param bParsingFile
-        Parsing a file or the command line itself
-    */
-    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
-        if (it == cmdLineArgs_.end())
-            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
-
-        it->second->parse(value);
-    }
-
-    /**
-    @brief
-        Parses an argument based on its shortcut.
-    @param shortcut
-        Shortcut to the argument
-    @param value
-        String containing the value
-    @param bParsingFile
-        Parsing a file or the command line itself
-    */
-    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
-        if (it == cmdLineArgsShortcut_.end())
-            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
-
-        it->second->parse(value);
-    }
-
-    std::string CommandLineParser::getUsageInformation()
-    {
-        CommandLineParser& inst = _getInstance();
-        std::ostringstream infoStr;
-
-        // determine maximum name size
-        size_t maxNameSize = 0;
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
-        }
-
-        infoStr << endl;
-        infoStr << "Usage: orxonox [options]" << endl;
-        infoStr << "Available options:" << endl;
-
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            if (!it->second->getShortcut().empty())
-                infoStr << " [-" << it->second->getShortcut() << "] ";
-            else
-                infoStr << "      ";
-            infoStr << "--" << it->second->getName() << ' ';
-            if (it->second->getValue().isType<bool>())
-                infoStr << "    ";
-            else
-                infoStr << "ARG ";
-            // fill with the necessary amount of blanks
-            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
-            infoStr << ": " << it->second->getInformation();
-            infoStr << endl;
-        }
-        return infoStr.str();
-    }
-
-    void CommandLineParser::generateDoc(std::ofstream& file)
-    {
-        file << "/** @page cmdargspage Command Line Arguments Reference" << endl;
-        file << "    @verbatim"; /*no endl*/
-        file << getUsageInformation(); /*no endl*/
-        file << "    @endverbatim" << endl;
-        file << "*/" << endl;
-    }
-
-    /**
-    @brief
-        Retrieves a CommandLineArgument.
-        The method throws an exception if 'name' was not found or the value could not be converted.
-    @note
-        You should of course not call this method before the command line has been parsed.
-    */
-    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-        if (it == _getInstance().cmdLineArgs_.end())
-        {
-            ThrowException(Argument, "Could find command line argument '" + name + "'.");
-        }
-        else
-        {
-            return it->second;
-        }
-    }
-}
Index: code/trunk/src/libraries/core/CommandLineParser.h
===================================================================
--- code/trunk/src/libraries/core/CommandLineParser.h	(revision 9576)
+++ 	(revision )
@@ -1,227 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @defgroup CmdArgs Commandline arguments
-    @ingroup Config
-    @brief For a reference of all commandline arguments see @ref cmdargspage
-*/
-
-/**
-    @file
-    @ingroup Config CmdArgs
-    @brief Declaration of CommandLineParser and CommandLineArgument, definition of the SetCommandLineArgument() macros.
-*/
-
-#ifndef _CommandLine_H__
-#define _CommandLine_H__
-
-#include "CorePrereqs.h"
-
-#include <fstream>
-#include <map>
-#include "util/OrxAssert.h"
-#include "util/MultiType.h"
-
-#define SetCommandLineArgument(name, defaultValue) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLineParser::addArgument(#name, defaultValue)
-#define SetCommandLineSwitch(name) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLineParser::addArgument(#name, false)
-
-namespace orxonox
-{
-    /**
-    @brief
-        Container class for a command line argument of any type supported by MultiType.
-
-        Whenever you want to have an option specified by a command line switch,
-        you need to first define it with SetCommandLineArgument(name, defaultValue).
-        It is then added to a map and possibly changed when the command line is being parsed.
-        If the option was not given, you can detect this by asking hasDefaultValue().
-
-        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
-        Note the difference between "-" and "--"!
-        Also, there is no restriction to the number of strings you add after --name.
-        So "--startVector {2, 4, 5}" is perfectly legal.
-
-        Retrieving an argument is possible with the getCommandLineArgument function of the
-        CommandLineParser class. It is a Singleton, but the public interface is static.
-    */
-    class _CoreExport CommandLineArgument
-    {
-        friend class CommandLineParser;
-
-    public:
-        //! Tells whether the value has been changed by the command line.
-        bool hasDefaultValue() const { return bHasDefaultValue_; }
-        //! Returns the name of the argument.
-        const std::string& getName() const { return name_; }
-
-        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
-        //! Evaluates to "" if there is none.
-        const std::string& getShortcut() const { return shortcut_; }
-        //! Sets the shortcut for the argument
-        CommandLineArgument& shortcut(const std::string& shortcut)
-        { this->shortcut_ = shortcut; return *this; }
-
-        //! Returns the usage information
-        const std::string& getInformation() const { return this->usageInformation_; }
-        //! Sets the option information when displaying orxonox usage.
-        CommandLineArgument& information(const std::string& usage)
-        { this->usageInformation_ = usage; return *this; }
-
-        //! Returns the actual value of the argument. Can be equal to default value.
-        const MultiType& getValue() const { return value_; }
-        //! Returns the given default value as type T.
-        const MultiType& getDefaultValue() const { return defaultValue_; }
-
-    private:
-        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
-        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
-            : bHasDefaultValue_(true)
-            , name_(name)
-            , value_(defaultValue)
-            , defaultValue_(defaultValue)
-        { }
-
-        //! Undefined copy constructor
-        CommandLineArgument(const CommandLineArgument& instance);
-        ~CommandLineArgument() { }
-
-        //! Parses the value string of a command line argument.
-        void parse(const std::string& value);
-
-        //! Tells whether the value has been changed by the command line.
-        bool bHasDefaultValue_;
-
-    private:
-        std::string name_;             //!< Name of the argument
-        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
-        std::string usageInformation_; //!< Tells about the usage of this parameter
-
-        MultiType   value_;            //!< The actual value
-        MultiType   defaultValue_;     //!< Default value. Should not be changed.
-    };
-
-
-    /**
-    @brief
-        Global interface to command line options.
-        Allows to add and retrieve command line arguments. Also does the parsing.
-    @note
-        Internally it is a Singleton, but the public interface is static.
-    @see
-        CommandLineArgument
-    */
-    class _CoreExport CommandLineParser
-    {
-    public:
-
-        //! Parse redirection to internal member method.
-        static void parse(const std::string& cmdLine)
-        { _getInstance()._parse(cmdLine); }
-
-        static std::string getUsageInformation();
-
-        static const CommandLineArgument* getArgument(const std::string& name);
-        //! Writes the argument value in the given parameter.
-        template <class T>
-        static void getValue(const std::string& name, T* value)
-        { *value = (T)(getArgument(name)->getValue()); }
-        static const MultiType& getValue(const std::string& name)
-        { return getArgument(name)->getValue(); }
-        template <class T>
-        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
-
-        static bool existsArgument(const std::string& name)
-        {
-            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-            return !(it == _getInstance().cmdLineArgs_.end());
-        }
-
-        static void destroyAllArguments();
-
-        static void generateDoc(std::ofstream& file);
-
-    private:
-        //! Constructor initialises bFirstTimeParse_ with true.
-        CommandLineParser() : bFirstTimeParse_(true) { }
-        //! Undefined copy constructor
-        CommandLineParser(const CommandLineParser& instance);
-        ~CommandLineParser();
-
-        static CommandLineParser& _getInstance();
-
-        void _parse(const std::string& cmdLine);
-        void checkFullArgument(const std::string& name, const std::string& value);
-        void checkShortcut(const std::string& shortcut, const std::string& value);
-
-        /**
-            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
-            So when we call parse() the first time, we need to create a map with all shortcuts since these
-            get added after addCommandLineArgument().
-        */
-        bool bFirstTimeParse_;
-
-        //! Holds all pointers to the arguments and serves as a search map by name.
-        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
-        //! Search map by shortcut for the arguments.
-        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
-    };
-
-    template <>
-    inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value)
-    {
-        *value = getArgument(name)->getValue().get<std::string>();
-    }
-
-    /**
-    @brief
-        Adds a new CommandLineArgument to the internal map.
-        Note that only such arguments are actually valid.
-    @param name
-        Name of the argument. Shortcut can be added later.
-    @param defaultValue
-        Default value that is used when argument was not given.
-    */
-    template <class T>
-    CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue)
-    {
-        OrxAssert(!_getInstance().existsArgument(name),
-            "Cannot add a command line argument with name '" + name + "' twice.");
-        OrxAssert(!MultiType(defaultValue).isType<bool>() || MultiType(defaultValue).get<bool>() != true,
-               "Boolean command line arguments with positive default values are not supported." << endl
-            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
-
-        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
-    }
-}
-
-#endif /* _CommandLine_H__ */
Index: code/trunk/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/trunk/src/libraries/core/ConfigFileManager.cc	(revision 9576)
+++ 	(revision )
@@ -1,771 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of ConfigFileManager and its helper classes.
-*/
-
-#include "ConfigFileManager.h"
-
-#include <boost/filesystem.hpp>
-
-#include "util/Convert.h"
-#include "util/Math.h"
-#include "util/StringUtils.h"
-#include "ConfigValueContainer.h"
-#include "PathConfig.h"
-#include "command/ConsoleCommand.h"
-
-namespace orxonox
-{
-    //////////////////////////
-    // ConfigFileEntryValue //
-    //////////////////////////
-    /**
-        @brief Updates the string that will be stored in the file after one of it's components (name, value, comment) has changed.
-    */
-    void ConfigFileEntryValue::update()
-    {
-        // Make sure we remove the quotes when bString changes
-        if (this->bString_)
-            this->value_ = stripEnclosingQuotes(this->value_);
-        // Assemble the entry line
-        this->fileEntry_ = this->getKeyString() + " = ";
-        if (this->bString_ && !this->value_.empty())
-            this->fileEntry_ += '"' + addSlashes(this->value_) + '"';
-        else
-            this->fileEntry_ += this->value_;
-        if (!this->additionalComment_.empty())
-            this->fileEntry_ += ' ' + this->additionalComment_;
-    }
-
-
-    ////////////////////////////////
-    // ConfigFileEntryVectorValue //
-    ////////////////////////////////
-    /**
-        @brief Updates the string that will be stored in the file after one of it's components (name, value, index, comment) has changed.
-    */
-    void ConfigFileEntryVectorValue::update()
-    {
-        this->keyString_ = this->name_ + '[' + multi_cast<std::string>(this->index_) + ']';
-        ConfigFileEntryValue::update();
-    }
-
-
-    ///////////////////////
-    // ConfigFileSection //
-    ///////////////////////
-    /**
-        @brief Destructor: Deletes all entries.
-    */
-    ConfigFileSection::~ConfigFileSection()
-    {
-        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
-            delete (*(it++));
-    }
-
-    /**
-        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
-
-        @param name         The name of the vector
-        @param startindex   The index of the first element that will be deleted
-    */
-    void ConfigFileSection::deleteVectorEntries(const std::string& name, unsigned int startindex)
-    {
-        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
-        {
-            if (((*it)->getName() == name) && ((*it)->getIndex() >= startindex))
-            {
-                delete (*it);
-                this->entries_.erase(it++);
-            }
-            else
-            {
-                ++it;
-            }
-        }
-    }
-
-    /**
-        @brief Returns the size of a config vector.
-        @param name     The name of the vector
-    */
-    unsigned int ConfigFileSection::getVectorSize(const std::string& name) const
-    {
-        unsigned int size = 0;
-        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
-            if ((*it)->getName() == name)
-                if ((*it)->getIndex() >= size)
-                    size = (*it)->getIndex() + 1;
-        return size;
-    }
-
-    /**
-        @brief Returns the title and comment of the section as it will be stored in the file.
-    */
-    std::string ConfigFileSection::getFileEntry() const
-    {
-        if (this->additionalComment_.empty())
-            return ('[' + this->name_ + ']');
-        else
-            return ('[' + this->name_ + "] " + this->additionalComment_);
-    }
-
-    /**
-        @brief Returns the entry with given name (or NULL if it doesn't exist).
-
-        @param name     The name of the entry
-    */
-    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
-    {
-        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
-        {
-            if ((*it)->getName() == name)
-                return *it;
-        }
-        return NULL;
-    }
-
-    /**
-        @brief Returns the entry of a vector element with given name and index (or NULL if it doesn't exist).
-
-        @param name     The name of the vector
-        @param index    The index of the element in the vector
-    */
-    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
-    {
-        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
-        {
-            if (((*it)->getName() == name) && ((*it)->getIndex() == index))
-                return *it;
-        }
-        return NULL;
-    }
-
-    /**
-        @brief Returns the iterator to the entry with given name. If the entry doesn't exist, it is created using the fallback value.
-
-        @param name     The name of the entry
-        @param fallback The value that will be used if the entry doesn't exist
-        @param bString  If true, the value is treated as string which means some special treatment of special characters.
-    */
-    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString)
-    {
-        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
-        {
-            if ((*it)->getName() == name)
-            {
-                (*it)->setString(bString);
-                return it;
-            }
-        }
-
-        this->bUpdated_ = true;
-
-        return this->entries_.insert(this->entries_.end(), new ConfigFileEntryValue(name, fallback, bString));
-    }
-
-    /**
-        @brief Returns the iterator to the entry of a vector element with given name and index. If the entry doesn't exist, it is created using the fallback value.
-
-        @param name     The name of the vector
-        @param index    The index of the element in the vector
-        @param fallback The value that will be used if the entry doesn't exist
-        @param bString  If true, the value is treated as string which means some special treatment of special characters.
-    */
-    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-    {
-        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
-        {
-            if (((*it)->getName() == name) && ((*it)->getIndex() == index))
-            {
-                (*it)->setString(bString);
-                return it;
-            }
-        }
-
-        this->bUpdated_ = true;
-
-        if (index == 0)
-            return this->entries_.insert(this->entries_.end(), new ConfigFileEntryVectorValue(name, index, fallback, bString));
-        else
-            return this->entries_.insert(++this->getOrCreateEntryIterator(name, index - 1, "", bString), new ConfigFileEntryVectorValue(name, index, fallback, bString));
-    }
-
-
-    ////////////////
-    // ConfigFile //
-    ////////////////
-
-    const char* ConfigFile::DEFAULT_CONFIG_FOLDER = "defaultConfig";
-
-    /**
-        @brief Constructor: Initializes the config file.
-        @param filename The file-name of this config file
-        @param bCopyFallbackFile If true, the default config file is copied into the config-directory before loading the file
-    */
-    ConfigFile::ConfigFile(const std::string& filename, bool bCopyFallbackFile)
-        : filename_(filename)
-        , bCopyFallbackFile_(bCopyFallbackFile)
-        , bUpdated_(false)
-    {
-    }
-
-    /**
-        @brief Destructor: Deletes all sections and entries.
-    */
-    ConfigFile::~ConfigFile()
-    {
-        this->clear();
-    }
-
-    /**
-        @brief Loads the config file from the hard-disk and reads the sections and their values.
-    */
-    void ConfigFile::load()
-    {
-        // Be sure we start from new in the memory
-        this->clear();
-
-        boost::filesystem::path filepath(this->filename_);
-        if (!filepath.is_complete())
-        {
-            filepath = PathConfig::getConfigPath() / filepath;
-            if (this->bCopyFallbackFile_)
-            {
-                // Look for default file in the data folder
-                if (!boost::filesystem::exists(filepath))
-                {
-                    boost::filesystem::path defaultFilepath(PathConfig::getDataPath() / DEFAULT_CONFIG_FOLDER / this->filename_);
-                    if (boost::filesystem::exists(defaultFilepath))
-                    {
-                        // Try to copy default file from the data folder
-                        try
-                        {
-                            boost::filesystem::copy_file(defaultFilepath, filepath);
-                            orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl;
-                        }
-                        catch (const boost::filesystem::filesystem_error& ex)
-                        { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; }
-                    }
-                }
-            }
-        }
-
-        // Open the file
-        std::ifstream file;
-        file.open(filepath.string().c_str(), std::fstream::in);
-        if (file.is_open())
-        {
-            ConfigFileSection* newsection = 0;
-
-            while (file.good() && !file.eof())
-            {
-                std::string line;
-                std::getline(file, line);
-
-                const std::string& temp = getStripped(line);
-                if (!isEmpty(temp) && !isComment(temp))
-                {
-                    size_t   pos1 = temp.find('[');
-                    if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
-                    size_t   pos2 = line.find(']');
-
-                    if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
-                    {
-                        // New section
-                        const std::string& comment = line.substr(pos2 + 1);
-                        if (isComment(comment))
-                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
-                        else
-                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
-                        this->sections_.insert(this->sections_.end(), newsection);
-                        continue;
-                    }
-                }
-
-                if (newsection != 0)
-                {
-                    if (isComment(line))
-                    {
-                        // New comment
-                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
-                        continue;
-                    }
-                    else
-                    {
-                        size_t pos1 = line.find('=');
-
-                        if (pos1 != std::string::npos && pos1 > 0)
-                        {
-                            // New entry
-                            size_t pos2 = line.find('[');
-                            size_t pos3 = line.find(']');
-                            size_t commentposition = getNextCommentPosition(line, pos1 + 1);
-                            while (isBetweenQuotes(line, commentposition))
-                            {
-                                commentposition = getNextCommentPosition(line, commentposition + 1);
-                            }
-                            std::string value, comment;
-                            if (commentposition == std::string::npos)
-                            {
-                                value = line.substr(pos1 + 1);
-                            }
-                            else
-                            {
-                                value = line.substr(pos1 + 1, commentposition - pos1 - 1);
-                                comment = removeTrailingWhitespaces(line.substr(commentposition));
-                            }
-
-                            value = removeTrailingWhitespaces(value);
-                            value = removeSlashes(value);
-
-                            if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
-                            {
-                                // There might be an array index
-                                unsigned int index = 0;
-                                if (convertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
-                                {
-                                    // New array
-                                    std::list<ConfigFileEntry*>::iterator it = newsection->getOrCreateEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
-                                    (*it)->setValue(value);
-                                    (*it)->setComment(comment);
-                                    continue;
-                                }
-                            }
-
-                            // New value
-                            newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
-                            continue;
-                        }
-                    }
-                }
-            }
-
-            file.close();
-
-            orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl;
-
-            // DO NOT save the file --> we can open supposedly read only config files
-        } // end file.is_open()
-    }
-
-    /**
-        @brief Writes the sections and values to the hard-disk.
-    */
-    void ConfigFile::save() const
-    {
-        this->saveAs(this->filename_);
-    }
-
-    /**
-        @brief Writes the sections and values to a given file on the hard-disk.
-    */
-    void ConfigFile::saveAs(const std::string& filename) const
-    {
-        boost::filesystem::path filepath(filename);
-        if (!filepath.is_complete())
-            filepath = PathConfig::getConfigPath() / filename;
-        std::ofstream file;
-        file.open(filepath.string().c_str(), std::fstream::out);
-        file.setf(std::ios::fixed, std::ios::floatfield);
-        file.precision(6);
-
-        if (!file.is_open())
-        {
-            orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl;
-            return;
-        }
-
-        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
-        {
-            file << (*it)->getFileEntry() << endl;
-
-            for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
-                file << (*it_entries)->getFileEntry() << endl;
-
-            file << endl;
-        }
-
-        file.close();
-
-        orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl;
-    }
-
-    /**
-        @brief Deletes all sections (which again delete all their values) and clears the list of sections.
-    */
-    void ConfigFile::clear()
-    {
-        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); )
-            delete (*(it++));
-        this->sections_.clear();
-    }
-
-    /**
-        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
-
-        @param section      The name of the section
-        @param name         The name of the vector
-        @param startindex   The index of the first element that will be deleted
-    */
-    void ConfigFile::deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex)
-    {
-        if (ConfigFileSection* sectionPtr = this->getSection(section))
-        {
-            sectionPtr->deleteVectorEntries(name, startindex);
-            this->save();
-        }
-    }
-
-    /**
-        @brief Returns a pointer to the section with given name (or NULL if the section doesn't exist).
-    */
-    ConfigFileSection* ConfigFile::getSection(const std::string& section) const
-    {
-        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
-            if ((*it)->getName() == section)
-                return (*it);
-        return NULL;
-    }
-
-    /**
-        @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
-    */
-    ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
-    {
-        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
-            if ((*it)->getName() == section)
-                return (*it);
-
-        this->bUpdated_ = true;
-
-        return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section)));
-    }
-
-    /**
-        @brief Saves the config file if it was updated (or if any of its sections were updated).
-    */
-    void ConfigFile::saveIfUpdated()
-    {
-        bool sectionsUpdated = false;
-
-        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
-        {
-            if ((*it)->bUpdated_)
-            {
-                sectionsUpdated = true;
-                (*it)->bUpdated_ = false;
-            }
-        }
-
-        if (this->bUpdated_ || sectionsUpdated)
-        {
-            this->bUpdated_ = false;
-            this->save();
-        }
-    }
-
-
-    ////////////////////////
-    // SettingsConfigFile //
-    ////////////////////////
-
-    static const std::string __CC_load_name = "reloadSettings";
-    static const std::string __CC_setFilename_name = "setSettingsFile";
-    static const std::string __CC_config_name = "config";
-    static const std::string __CC_tconfig_name = "tconfig";
-    static const std::string __CC_getConfig_name = "getConfig";
-
-    SetConsoleCommand(__CC_load_name,            &ConfigFile::load);
-    SetConsoleCommand(__CC_setFilename_name,     &SettingsConfigFile::setFilename);
-    SetConsoleCommand(__CC_config_name,          &SettingsConfigFile::config).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
-    SetConsoleCommand(__CC_tconfig_name,         &SettingsConfigFile::tconfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
-    SetConsoleCommand(__CC_getConfig_name,       &SettingsConfigFile::getConfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries());
-
-    SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;
-
-    /**
-        @brief Constructor: Activates the console commands.
-    */
-    SettingsConfigFile::SettingsConfigFile(const std::string& filename)
-        : ConfigFile(filename)
-    {
-        ModifyConsoleCommand(__CC_load_name).setObject(this);
-        ModifyConsoleCommand(__CC_setFilename_name).setObject(this);
-        ModifyConsoleCommand(__CC_config_name).setObject(this);
-        ModifyConsoleCommand(__CC_tconfig_name).setObject(this);
-        ModifyConsoleCommand(__CC_getConfig_name).setObject(this);
-    }
-
-    /**
-        @brief Destructor: Deactivates the console commands.
-    */
-    SettingsConfigFile::~SettingsConfigFile()
-    {
-        ModifyConsoleCommand(__CC_load_name).setObject(0);
-        ModifyConsoleCommand(__CC_setFilename_name).setObject(0);
-        ModifyConsoleCommand(__CC_config_name).setObject(0);
-        ModifyConsoleCommand(__CC_tconfig_name).setObject(0);
-        ModifyConsoleCommand(__CC_getConfig_name).setObject(0);
-    }
-
-    /**
-        @brief Loads the config file and updates the @ref ConfigValueContainer "config value containers".
-    */
-    void SettingsConfigFile::load()
-    {
-        ConfigFile::load();
-        this->updateConfigValues();
-    }
-
-    /**
-        @brief Changes the file-name.
-    */
-    void SettingsConfigFile::setFilename(const std::string& filename)
-    {
-        ConfigFileManager::getInstance().setFilename(ConfigFileType::Settings, filename);
-    }
-
-    /**
-        @brief Registers a new @ref ConfigValueContainer "config value container".
-    */
-    void SettingsConfigFile::addConfigValueContainer(ConfigValueContainer* container)
-    {
-        if (container == NULL)
-            return;
-        std::pair<std::string, ConfigValueContainer*> second(getLowercase(container->getName()), container);
-        this->containers_.insert(std::make_pair(getLowercase(container->getSectionName()), second));
-        this->sectionNames_.insert(container->getSectionName());
-    }
-
-    /**
-        @brief Unregisters a @ref ConfigValueContainer "config value container".
-    */
-    void SettingsConfigFile::removeConfigValueContainer(ConfigValueContainer* container)
-    {
-        if (container == NULL)
-            return;
-        const std::string& sectionLC = getLowercase(container->getSectionName());
-        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
-        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
-        {
-            if (it->second.second == container)
-            {
-                // Remove entry from section name set this was the last container for that section
-                if (upper == this->containers_.lower_bound(sectionLC))
-                    this->sectionNames_.erase(container->getSectionName());
-                this->containers_.erase(it);
-                break;
-            }
-        }
-    }
-
-    /**
-        @brief Updates all @ref ConfigValueContainer "config value containers".
-    */
-    void SettingsConfigFile::updateConfigValues()
-    {
-        // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
-
-        for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
-        {
-            it->second.second->update();
-            it->second.second->getIdentifier()->updateConfigValues();
-        }
-    }
-
-    /**
-        @brief Removes entries and sections from the file that don't exist anymore (i.e. if there's no corresponding @ref ConfigValueContainer "config value container").
-        @param bCleanComments If true, comments are also removed from the file
-    */
-    void SettingsConfigFile::clean(bool bCleanComments)
-    {
-        for (std::list<ConfigFileSection*>::iterator itSection = this->sections_.begin(); itSection != this->sections_.end(); )
-        {
-            const std::string& sectionLC = getLowercase((*itSection)->getName());
-            ContainerMap::const_iterator lower = this->containers_.lower_bound(sectionLC);
-            ContainerMap::const_iterator upper = this->containers_.upper_bound(sectionLC);
-            if (lower != upper)
-            {
-                // The section exists, delete comment
-                if (bCleanComments)
-                    (*itSection)->setComment("");
-                for (std::list<ConfigFileEntry*>::iterator itEntry = (*itSection)->entries_.begin(); itEntry != (*itSection)->entries_.end(); )
-                {
-                    const std::string& entryLC = getLowercase((*itEntry)->getName());
-                    bool bFound = false;
-                    for (ContainerMap::const_iterator itContainer = lower; itContainer != upper; ++itContainer)
-                    {
-                        if (itContainer->second.first == entryLC)
-                        {
-                            // The config-value exists, delete comment
-                            if (bCleanComments)
-                                (*itEntry)->setComment("");
-                            ++itEntry;
-                            bFound = true;
-                            break;
-                        }
-                    }
-                    if (!bFound)
-                    {
-                        // The config-value doesn't exist
-                        delete (*itEntry);
-                        (*itSection)->entries_.erase(itEntry++);
-                    }
-                }
-                ++itSection;
-            }
-            else
-            {
-                // The section doesn't exist
-                delete (*itSection);
-                this->sections_.erase(itSection++);
-            }
-        }
-
-        // Save the file
-        this->save();
-    }
-
-    /**
-        @brief Console-command: Changes the value of an entry and stores it the file.
-
-        @param section  The section of the config value
-        @param entry    The name of the config value
-        @param value    The new value
-    */
-    void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
-    {
-        if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
-            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
-    }
-
-    /**
-        @brief Console-command: Changes the value of an entry, but doesn't store it in the file (it's only a temporary change).
-
-        @param section  The section of the config value
-        @param entry    The name of the config value
-        @param value    The new value
-    */
-    void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
-    {
-        if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
-            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
-    }
-
-    /**
-        @brief Changes the value of an entry, depending on @a function, either by using "set" or "tset"
-
-        @param section  The section of the config value
-        @param entry    The name of the config value
-        @param value    The new value
-        @param function The function ("set" or "tset") that will be used to change the value.
-    */
-    bool SettingsConfigFile::configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&))
-    {
-        const std::string& sectionLC = getLowercase(section);
-        const std::string& entryLC = getLowercase(entry);
-        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
-        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
-        {
-            // Note: Config value vectors cannot be supported
-            if (it->second.first == entryLC && !it->second.second->isVector())
-            {
-                return (it->second.second->*function)(value);
-            }
-        }
-        return false;
-    }
-
-    /**
-        @brief Console-command: Returns the value of a given entry.
-
-        @param section  The section of the config value
-        @param entry    The name of the config value
-    */
-    std::string SettingsConfigFile::getConfig(const std::string& section, const std::string& entry)
-    {
-        const std::string& sectionLC = getLowercase(section);
-        const std::string& entryLC = getLowercase(entry);
-        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
-        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
-        {
-            // Note: Config value vectors cannot be supported
-            if (it->second.first == entryLC && ! it->second.second->isVector())
-            {
-                std::string value;
-                it->second.second->getValue<std::string, OrxonoxClass>(&value, NULL);
-                return value;
-            }
-        }
-        return "";
-    }
-
-
-    ///////////////////////
-    // ConfigFileManager //
-    ///////////////////////
-
-    ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;
-
-    /// Constructor: Initializes the array of config files with NULL.
-    ConfigFileManager::ConfigFileManager()
-    {
-        this->configFiles_.assign(NULL);
-    }
-
-    /// Destructor: Deletes the config files.
-    ConfigFileManager::~ConfigFileManager()
-    {
-        for (boost::array<ConfigFile*, 3>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
-            if (*it)
-                delete (*it);
-    }
-
-    /// Defines the file-name for the config file of a given type (settings, calibration, etc.).
-    void ConfigFileManager::setFilename(ConfigFileType::Value type, const std::string& filename)
-    {
-        if (this->getConfigFile(type))
-            delete this->configFiles_[type];
-        // Create and load config file
-        switch (type)
-        {
-        case ConfigFileType::Settings:
-            this->configFiles_[type] = new SettingsConfigFile(filename);
-            break;
-        case ConfigFileType::JoyStickCalibration:
-        case ConfigFileType::CommandHistory:
-            this->configFiles_[type] = new ConfigFile(filename);
-            break;
-        }
-        this->configFiles_[type]->load();
-    }
-}
Index: code/trunk/src/libraries/core/ConfigFileManager.h
===================================================================
--- code/trunk/src/libraries/core/ConfigFileManager.h	(revision 9576)
+++ 	(revision )
@@ -1,602 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Config ConfigFile
-    @brief Declaration of ConfigFileManager and its helper classes, used to load and save config files.
-*/
-
-#ifndef _ConfigFileManager_H__
-#define _ConfigFileManager_H__
-
-#include "CorePrereqs.h"
-
-#include <list>
-#include <map>
-#include <set>
-#include <string>
-#include <boost/array.hpp>
-
-#include "util/Singleton.h"
-
-namespace orxonox // tolua_export
-{ // tolua_export
-
-    /////////////////////
-    // ConfigFileEntry //
-    /////////////////////
-    /**
-        @brief This class represents an entry in the config file.
-
-        This class is pure virtual. Use one of the derived classes to define the type of the entry.
-    */
-    class _CoreExport ConfigFileEntry
-    {
-        public:
-            /// Destructor
-            virtual ~ConfigFileEntry() {};
-
-            /// Changes the value of the entry.
-            virtual void setValue(const std::string& value) = 0;
-            /// Returns the value of the entry.
-            virtual const std::string& getValue() const = 0;
-
-            /// Returns the name of the entry
-            virtual const std::string& getName() const = 0;
-
-            /// Changes the comment of the entry (will be placed after the value)
-            virtual void setComment(const std::string& comment) = 0;
-
-            /// Returns the index of the entry in a vector (used only if it is a vector)
-            virtual unsigned int getIndex() const { return 0; }
-
-            /// Defines if this entry is treated as string which means some special treatment of special characters.
-            virtual void setString(bool bString) = 0;
-
-            /// Returns the line as it will be stored in the config file.
-            virtual const std::string& getFileEntry() const = 0;
-    };
-
-
-    //////////////////////////
-    // ConfigFileEntryValue //
-    //////////////////////////
-    /**
-        @brief This class represents a normal value in the config file.
-    */
-    class _CoreExport ConfigFileEntryValue : public ConfigFileEntry
-    {
-        public:
-            /**
-                @brief Constructor: Initializes the entry.
-
-                @param name                 The name of the entry
-                @param value                The value of the entry
-                @param bString              If true, the value is treated as string which means some special treatment of special characters.
-                @param additionalComment    An optional comment that will be placed behind the value in the config file
-            */
-            inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
-                : name_(name)
-                , value_(value)
-                , additionalComment_(additionalComment)
-                , bString_(bString)
-                { this->update(); }
-
-            /// Destructor
-            inline virtual ~ConfigFileEntryValue() {}
-
-            inline virtual const std::string& getName() const
-                { return this->name_; }
-
-            inline virtual void setComment(const std::string& comment)
-                { this->additionalComment_ = comment; this->update(); }
-
-            inline virtual void setValue(const std::string& value)
-                { this->value_ = value; this->update(); }
-            inline virtual const std::string& getValue() const
-                { return this->value_; }
-
-            inline void virtual setString(bool bString)
-                { this->bString_ = bString; this->update(); }
-
-            inline virtual const std::string& getFileEntry() const
-                { return this->fileEntry_; }
-
-            /// Returns the "key" of the value (in this case it's just the name of the entry, but for vectors it's different)
-            inline virtual const std::string& getKeyString() const
-                { return this->name_; }
-
-        protected:
-            virtual void update();
-
-            const std::string name_;            ///< The name of the value
-            std::string value_;                 ///< The value
-            std::string additionalComment_;     ///< The additional comment
-            std::string fileEntry_;             ///< The string as it will be stored in the config file
-            bool bString_;                      ///< If true, the value is treated as string which means some special treatment of special characters.
-    };
-
-
-    ////////////////////////////////
-    // ConfigFileEntryVectorValue //
-    ////////////////////////////////
-    /**
-        @brief Subclass of ConfigFileEntryValue, represents an element of a vector.
-    */
-    class _CoreExport ConfigFileEntryVectorValue : public ConfigFileEntryValue
-    {
-        public:
-            /**
-                @brief Constructor: Initializes the entry.
-
-                @param name                 The name of the vector
-                @param index                The index of the element in the vector
-                @param value                The value of the element
-                @param bString              If true, the value is treated as string which means some special treatment of special characters.
-                @param additionalComment    An optional comment that will be placed behind the value in the config file
-            */
-            inline ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
-                : ConfigFileEntryValue(name, value, bString, additionalComment)
-                , index_(index)
-                { this->update(); /*No virtual calls in base class ctor*/ }
-
-            /// Destructor
-            inline ~ConfigFileEntryVectorValue() {}
-
-            inline unsigned int getIndex() const
-                { return this->index_; }
-
-            /// Returns the "key" of the value (the name of the vector plus the index of the element)
-            inline const std::string& getKeyString() const
-                { return this->keyString_; }
-
-        private:
-            void update();
-
-            unsigned int index_;        ///< The index of the element in the vector
-            std::string keyString_;     ///< The full name of the entry (the name of the vector plus the index of the element)
-    };
-
-
-    ////////////////////////////
-    // ConfigFileEntryComment //
-    ////////////////////////////
-    /**
-        @brief This class represents a line in the config file which contains only a comment.
-    */
-    class _CoreExport ConfigFileEntryComment : public ConfigFileEntry
-    {
-        public:
-            /// Constructor: Initializes the object.
-            inline ConfigFileEntryComment(const std::string& comment) : comment_(comment) {}
-
-            /// Destructor
-            inline virtual ~ConfigFileEntryComment() {}
-
-            inline virtual const std::string& getName() const
-                { return this->comment_; }
-
-            inline virtual void setComment(const std::string& comment)
-                { this->comment_ = comment; }
-
-            inline virtual void setValue(const std::string& value)
-                {}
-            inline virtual const std::string& getValue() const
-                { return BLANKSTRING; }
-
-            inline void setString(bool bString)
-                {}
-
-            inline virtual const std::string& getFileEntry() const
-                { return this->comment_; }
-
-        private:
-            std::string comment_;   ///< The comment
-    };
-
-
-    ///////////////////////
-    // ConfigFileSection //
-    ///////////////////////
-    /**
-        @brief Represents a section in a config file.
-
-        A section has a name and a list of config values.
-    */
-    class _CoreExport ConfigFileSection
-    {
-        friend class ConfigFile;
-        friend class SettingsConfigFile;
-
-        public:
-            /**
-                @brief Constructor: Initializes the section.
-
-                @param name The name of the section
-                @param additionalComment An additional comment placed after the title of the section in the config file
-            */
-            inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "")
-                : name_(name)
-                , additionalComment_(additionalComment)
-                , bUpdated_(false)
-                {}
-            ~ConfigFileSection();
-
-            /// Returns the name of the section.
-            inline const std::string& getName() const
-                { return this->name_; }
-
-            /// Changes the comment which is placed after the title of the section in the config file.
-            inline void setComment(const std::string& comment)
-                { this->additionalComment_ = comment; }
-
-            /**
-                @brief Stores a value in the section. If the entry doesn't exist, it's created.
-
-                @param name     The name of the entry
-                @param value    The new value
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline void setValue(const std::string& name, const std::string& value, bool bString)
-                { this->getOrCreateEntry(name, value, bString)->setValue(value); }
-            /**
-                @brief Returns the value of a given entry in the section. Returns a blank string if the value doesn't exist.
-
-                @param name     The name of the entry
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getValue(const std::string& name, bool bString)
-            {
-                ConfigFileEntry* entry = this->getEntry(name);
-                if (entry)
-                {
-                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
-                    return entry->getValue();
-                }
-                return BLANKSTRING;
-            }
-            /**
-                @brief Returns the value of a given entry in the section. If it doesn't exist, the entry is created using the fallback value.
-
-                @param name     The name of the entry
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getOrCreateValue(const std::string& name, const std::string& fallback, bool bString)
-                { return this->getOrCreateEntry(name, fallback, bString)->getValue(); }
-
-            /**
-                @brief Stores the value of an element of a vector in the section. If the entry doesn't exist, it's created.
-
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param value    The new value
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)
-                { this->getOrCreateEntry(name, index, value, bString)->setValue(value); }
-            /**
-                @brief Returns the value of a given element of a vector in the section. Returns a blank string if the value doesn't exist.
-
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getValue(const std::string& name, unsigned int index, bool bString)
-            {
-                ConfigFileEntry* entry = this->getEntry(name, index);
-                if (entry)
-                {
-                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
-                    return entry->getValue();
-                }
-                return BLANKSTRING;
-            }
-            /**
-                @brief Returns the value of a given element of a vector in the section. If it doesn't exist, the entry is created using the fallback value.
-
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getOrCreateValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-                { return this->getOrCreateEntry(name, index, fallback, bString)->getValue(); }
-
-            void deleteVectorEntries(const std::string& name, unsigned int startindex = 0);
-            unsigned int getVectorSize(const std::string& name) const;
-
-            std::string getFileEntry() const;
-
-        private:
-            /// Returns the list of entries in this section.
-            std::list<ConfigFileEntry*>& getEntries()
-                { return this->entries_; }
-            /// Returns the begin-iterator of the list of entries in this section.
-            std::list<ConfigFileEntry*>::const_iterator getEntriesBegin() const
-                { return this->entries_.begin(); }
-            /// Returns the end-iterator of the list of entries in this section.
-            std::list<ConfigFileEntry*>::const_iterator getEntriesEnd() const
-                { return this->entries_.end(); }
-
-            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString);
-            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString);
-
-            ConfigFileEntry* getEntry(const std::string& name) const;
-            /**
-                @brief Returns the entry with given name. If it doesn't exist, the entry is created using the fallback value.
-
-                @param name     The name of the entry
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline ConfigFileEntry* getOrCreateEntry(const std::string& name, const std::string& fallback, bool bString)
-                { return (*this->getOrCreateEntryIterator(name, fallback, bString)); }
-
-            ConfigFileEntry* getEntry(const std::string& name, unsigned int index) const;
-            /**
-                @brief Returns the entry that contains an element of a vector with given name. If it doesn't exist, the entry is created using the fallback value.
-
-                @param name     The name of the entry
-                @param index    The index of the element in the vector
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline ConfigFileEntry* getOrCreateEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-                { return (*this->getOrCreateEntryIterator(name, index, fallback, bString)); }
-
-            std::string name_;                      ///< The name of the section
-            std::string additionalComment_;         ///< The additional comment which is placed after the title of the section in the config file
-            std::list<ConfigFileEntry*> entries_;   ///< The list of entries in this section
-            bool bUpdated_;                         ///< True if an entry is created
-    };
-
-
-    ////////////////
-    // ConfigFile //
-    ////////////////
-    /**
-        @brief This class represents a config file, which is stored on the hard-disk and contains config values in different sections.
-
-        It provides an interface to manipulate the sections and values.
-    */
-    class _CoreExport ConfigFile
-    {
-        public:
-            ConfigFile(const std::string& filename, bool bCopyFallbackFile = true);
-            virtual ~ConfigFile();
-
-            virtual void load();
-            virtual void save() const;
-            virtual void saveAs(const std::string& filename) const;
-            virtual void clear();
-
-            /// Returns the file-name of this config file
-            inline const std::string& getFilename()
-                { return this->filename_; }
-
-            /**
-                @brief Stores a value in the config file. If the entry or its section doesn't exist, it's created.
-
-                @param section  The name of the section
-                @param name     The name of the entry
-                @param value    The new value
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)
-            {
-                this->getOrCreateSection(section)->setValue(name, value, bString);
-                this->save();
-            }
-            /**
-                @brief Returns the value of a given entry in the config file. Returns a blank string if the value doesn't exist.
-
-                @param section  The name of the section
-                @param name     The name of the entry
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getValue(const std::string& section, const std::string& name, bool bString)
-            {
-                ConfigFileSection* sectionPtr = this->getSection(section);
-                return (sectionPtr ? sectionPtr->getValue(name, bString) : BLANKSTRING);
-            }
-            /**
-                @brief Returns the value of a given entry in the config file. If it doesn't exist, the entry is created using the fallback value.
-
-                @param section  The name of the section
-                @param name     The name of the entry
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
-            {
-                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, fallback, bString);
-                this->saveIfUpdated();
-                return output;
-            }
-
-            /**
-                @brief Stores the value of an element of a vector in the config file. If the entry or its section doesn't exist, it's created.
-
-                @param section  The name of the section
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param value    The new value
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
-            {
-                this->getOrCreateSection(section)->setValue(name, index, value, bString);
-                this->save();
-            }
-            /**
-                @brief Returns the value of a given element of a vector in the config file. Returns a blank string if the value doesn't exist.
-
-                @param section  The name of the section
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index, bool bString)
-            {
-                ConfigFileSection* sectionPtr = this->getSection(section);
-                return (sectionPtr ? sectionPtr->getValue(name, index, bString) : BLANKSTRING);
-            }
-            /**
-                @brief Returns the value of a given element of a vector in the config file. If it doesn't exist, the entry is created using the fallback value.
-
-                @param section  The name of the section
-                @param name     The name of the vector
-                @param index    The index of the element in the vector
-                @param fallback The value that will be used if the entry doesn't exist
-                @param bString  If true, the value is treated as string which means some special treatment of special characters.
-            */
-            const std::string& getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-            {
-                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, index, fallback, bString);
-                this->saveIfUpdated();
-                return output;
-            }
-
-            void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0);
-            /**
-                @brief Returns the size of a config vector.
-                @param section  The section of the vector
-                @param name     The name of the vector
-            */
-            inline unsigned int getVectorSize(const std::string& section, const std::string& name) const
-            {
-                ConfigFileSection* sectionPtr = this->getSection(section);
-                return (sectionPtr ? sectionPtr->getVectorSize(name) : 0);
-            }
-
-            static const char* DEFAULT_CONFIG_FOLDER;   ///< The folder where the default config files will be stored
-
-        protected:
-            ConfigFileSection* getSection(const std::string& section) const;
-            ConfigFileSection* getOrCreateSection(const std::string& section);
-
-            std::list<ConfigFileSection*> sections_;    ///< A list of sections in this config file
-
-        private:
-            void saveIfUpdated();
-
-            const std::string filename_;                ///< The filename of this config file
-            const bool bCopyFallbackFile_;              ///< If true, the default config file is copied into the config-directory before loading the file
-            bool bUpdated_;                             ///< Becomes true if a section is added
-    };
-
-
-    ////////////////////////
-    // SettingsConfigFile //
-    ////////////////////////
-    /**
-        @brief Child class of ConfigFile, used to store the settings of the game.
-
-        In addition to ConfigFile, this class provides an interface to manipulate the settings
-        with console commands and to cache entries in instances of ConfigValueContainer.
-
-        SettingsConfigFile is a Singleton, meaning there's only one instance of this class
-        (and thus only one config file that stores settings).
-    */
-    class _CoreExport SettingsConfigFile // tolua_export
-        : public ConfigFile, public Singleton<SettingsConfigFile>
-    { // tolua_export
-        friend class Singleton<SettingsConfigFile>;
-
-        public:
-            typedef std::multimap<std::string, std::pair<std::string, ConfigValueContainer*> > ContainerMap;
-
-            SettingsConfigFile(const std::string& filename);
-            ~SettingsConfigFile();
-
-            void load(); // tolua_export
-            void setFilename(const std::string& filename); // tolua_export
-            void clean(bool bCleanComments = false); // tolua_export
-
-            void config(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
-            void tconfig(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
-            std::string getConfig(const std::string& section, const std::string& entry); // tolua_export
-
-            void addConfigValueContainer(ConfigValueContainer* container);
-            void removeConfigValueContainer(ConfigValueContainer* container);
-
-            /// Returns a set containing the names of all sections in this config file.
-            inline const std::set<std::string>& getSectionNames()
-                { return this->sectionNames_; }
-            /// Returns the lower-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
-            inline ContainerMap::const_iterator getContainerLowerBound(const std::string section)
-                { return this->containers_.lower_bound(section); }
-            /// Returns the upper-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
-            inline ContainerMap::const_iterator getContainerUpperBound(const std::string section)
-                { return this->containers_.upper_bound(section); }
-
-            static SettingsConfigFile& getInstance() { return Singleton<SettingsConfigFile>::getInstance(); } // tolua_export
-
-        private:
-            void updateConfigValues();
-            bool configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&));
-
-            ContainerMap containers_;                   ///< Stores all @ref ConfigValueContainer "config value containers"
-            std::set<std::string> sectionNames_;        ///< Stores all section names
-            static SettingsConfigFile* singletonPtr_s;  ///< The singleton pointer
-    }; // tolua_export
-
-
-    ///////////////////////
-    // ConfigFileManager //
-    ///////////////////////
-    /**
-        @brief Manages the different config files (settings, calibration, etc). Implemented as Singleton.
-    */
-    class _CoreExport ConfigFileManager : public Singleton<ConfigFileManager>
-    {
-        friend class Singleton<ConfigFileManager>;
-        public:
-            ConfigFileManager();
-            ~ConfigFileManager();
-
-            void setFilename(ConfigFileType::Value type, const std::string& filename);
-
-            /// Returns the config file of a given type (settings, calibration, etc.)
-            inline ConfigFile* getConfigFile(ConfigFileType::Value type)
-            {
-                // Check array bounds
-                return configFiles_.at(type);
-            }
-
-        private:
-            ConfigFileManager(const ConfigFileManager&);    ///< Copy-constructor: not implemented
-
-            boost::array<ConfigFile*, 3> configFiles_;      ///< Stores the config files for each type in an array (must have the same size like ConfigFileType::Value)
-            static ConfigFileManager* singletonPtr_s;       ///< Stores the singleton-pointer
-    };
-} // tolua_export
-
-#endif /* _ConfigFileManager_H__ */
Index: code/trunk/src/libraries/core/ConfigValueContainer.cc
===================================================================
--- code/trunk/src/libraries/core/ConfigValueContainer.cc	(revision 9576)
+++ 	(revision )
@@ -1,352 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of the ConfigValueContainer class.
-*/
-
-#include "ConfigValueContainer.h"
-
-#include "util/Convert.h"
-#include "util/SubString.h"
-#include "ConfigFileManager.h"
-#include "Language.h"
-
-namespace orxonox
-{
-    const unsigned int MAX_VECTOR_INDEX  = 255; // to avoid up to 4*10^9 vector entries in the config file after accidentally using a wrong argument
-
-    /**
-        @brief Initializes the ConfigValueContainer with default values.
-    */
-    void ConfigValueContainer::init(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname)
-    {
-        this->type_ = type;
-        this->identifier_ = identifier;
-        this->sectionname_ = sectionname;
-        this->varname_ = varname;
-        this->callback_ = 0;
-        this->bContainerIsNew_ = true;
-        this->bDoInitialCallback_ = false;
-        this->bAddedDescription_ = false;
-
-        // Register containers for general settings
-        if (this->type_ == ConfigFileType::Settings)
-            SettingsConfigFile::getInstance().addConfigValueContainer(this);
-    }
-
-    /**
-        @brief Does some special initialization for single config-values.
-    */
-    void ConfigValueContainer::initValue(const MultiType& defvalue)
-    {
-        this->value_ = defvalue;
-        this->bIsVector_ = false;
-
-        this->defvalueString_ = this->value_.get<std::string>();
-        this->update();
-    }
-
-    /**
-        @brief Does some special initialization for vector config-values.
-    */
-    void ConfigValueContainer::initVector()
-    {
-        this->bIsVector_ = true;
-
-        for (unsigned int i = 0; i < this->valueVector_.size(); i++)
-        {
-            ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType<std::string>());
-            this->defvalueStringVector_.push_back(this->valueVector_[i]);
-        }
-
-        this->update();
-    }
-
-    /**
-        @brief Destructor: Deletes the callback object if necessary.
-    */
-    ConfigValueContainer::~ConfigValueContainer()
-    {
-        if (this->callback_)
-            delete this->callback_;
-
-        // Unregister general settings containers
-        if (this->type_ == ConfigFileType::Settings && SettingsConfigFile::exists())
-            SettingsConfigFile::getInstance().removeConfigValueContainer(this);
-    }
-
-    /**
-        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
-        @param input The new value
-        @return True if the new value was successfully assigned
-    */
-    bool ConfigValueContainer::set(const MultiType& input)
-    {
-        if (this->bIsVector_)
-        {
-            return this->callFunctionWithIndex(&ConfigValueContainer::set, input);
-        }
-        else
-        {
-            if (this->tset(input))
-            {
-                ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, input, this->value_.isType<std::string>());
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
-        @param index The index in the vector
-        @param input The new value
-        @return True if the new value was successfully assigned
-    */
-    bool ConfigValueContainer::set(unsigned int index, const MultiType& input)
-    {
-        if (this->bIsVector_)
-        {
-            if (this->tset(index, input))
-            {
-                ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, index, input, this->value_.isType<std::string>());
-                return true;
-            }
-        }
-        else
-        {
-            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
-        }
-        return false;
-    }
-
-    /**
-        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
-        @param input The new value. If bIsVector_ then write "index value"
-        @return True if the new value was successfully assigned
-    */
-    bool ConfigValueContainer::tset(const MultiType& input)
-    {
-        if (this->bIsVector_)
-        {
-            return this->callFunctionWithIndex(&ConfigValueContainer::tset, input);
-        }
-        else
-        {
-            this->value_ = input;
-
-            if (this->identifier_)
-                this->identifier_->updateConfigValues();
-
-            return true;
-        }
-    }
-
-    /**
-        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
-        @param index The index in the vector
-        @param input The new value
-        @return True if the new value was successfully assigned
-    */
-    bool ConfigValueContainer::tset(unsigned int index, const MultiType& input)
-    {
-        if (this->bIsVector_)
-        {
-            if (index > MAX_VECTOR_INDEX)
-            {
-                orxout(user_error, context::config) << "Index " << index << " is too large." << endl;
-                return false;
-            }
-
-            if (index >= this->valueVector_.size())
-            {
-                for (unsigned int i = this->valueVector_.size(); i <= index; i++)
-                {
-                    this->valueVector_.push_back(MultiType());
-                }
-            }
-
-            this->valueVector_[index] = input;
-
-            if (this->identifier_)
-                this->identifier_->updateConfigValues();
-
-            return true;
-        }
-        else
-        {
-            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
-            return false;
-        }
-    }
-
-    /**
-        @brief Adds a new entry to the end of the vector.
-        @param input The new entry
-        @return True if the new entry was successfully added
-    */
-    bool ConfigValueContainer::add(const MultiType& input)
-    {
-        if (this->bIsVector_)
-            return this->set(this->valueVector_.size(), input);
-
-        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
-        return false;
-    }
-
-    /**
-        @brief Removes an existing entry from the vector.
-        @param index The index of the entry
-        @return True if the entry was removed
-    */
-    bool ConfigValueContainer::remove(unsigned int index)
-    {
-        if (this->bIsVector_)
-        {
-            if (index < this->valueVector_.size())
-            {
-                // Erase the entry from the vector, change (shift) all entries beginning with index in the config file, remove the last entry from the file
-                this->valueVector_.erase(this->valueVector_.begin() + index);
-                for (unsigned int i = index; i < this->valueVector_.size(); i++)
-                    ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType<std::string>());
-                ConfigFileManager::getInstance().getConfigFile(this->type_)->deleteVectorEntries(this->sectionname_, this->varname_, this->valueVector_.size());
-
-                return true;
-            }
-            orxout(user_error, context::config) << "Invalid vector-index." << endl;
-        }
-
-        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
-        return false;
-    }
-
-    /**
-        @brief Sets the value of the variable back to the default value and resets the config-file entry.
-    */
-    bool ConfigValueContainer::reset()
-    {
-        if (!this->bIsVector_)
-            return this->set(this->defvalueString_);
-        else
-        {
-            bool success = true;
-            for (unsigned int i = 0; i < this->defvalueStringVector_.size(); i++)
-                if (!this->set(i, this->defvalueStringVector_[i]))
-                    success = false;
-            ConfigFileManager::getInstance().getConfigFile(this->type_)->deleteVectorEntries(this->sectionname_, this->varname_, this->defvalueStringVector_.size());
-            return success;
-        }
-    }
-
-    /**
-        @brief Retrieves the configured value from the currently loaded config-file.
-    */
-    void ConfigValueContainer::update()
-    {
-        if (!this->bIsVector_)
-            this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType<std::string>());
-        else
-        {
-            this->valueVector_.clear();
-            unsigned int vectorSize = ConfigFileManager::getInstance().getConfigFile(this->type_)->getVectorSize(this->sectionname_, this->varname_);
-            for (unsigned int i = 0; i < vectorSize; i++)
-            {
-                if (i < this->defvalueStringVector_.size())
-                {
-                    this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType<std::string>());
-                }
-                else
-                {
-                    this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, MultiType(), this->value_.isType<std::string>());
-                }
-
-                this->valueVector_.push_back(this->value_);
-            }
-        }
-    }
-
-    /**
-        @brief Calls the given function with parsed index and the parsed argument from the input string.
-        @param function The function to call
-        @param input The input string
-        @return The returnvalue of the functioncall
-    */
-    bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input)
-    {
-        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '\0', '\0', false, '\0');
-        int index = -1;
-        bool success = false;
-
-        if (token.size() > 0)
-            success = convertValue(&index, token[0]);
-
-        if (!success || index < 0 || index > (signed int)MAX_VECTOR_INDEX)
-        {
-            if (!success)
-            {
-                orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << endl;
-            }
-            else
-            {
-                orxout(user_error, context::config) << "Invalid vector-index." << endl;
-            }
-            return false;
-        }
-
-        if (token.size() >= 2)
-            return (this->*function)(index, token.subSet(1).join());
-        else
-            return (this->*function)(index, "");
-    }
-
-    /**
-        @brief Adds a description to the config-value.
-        @param description The description
-    */
-    ConfigValueContainer& ConfigValueContainer::description(const std::string& description)
-    {
-        if (!this->bAddedDescription_)
-        {
-            this->description_ = std::string("ConfigValueDescription::" + this->sectionname_ + "::" + this->varname_);
-            AddLanguageEntry(this->description_, description);
-            this->bAddedDescription_ = true;
-        }
-        return (*this);
-    }
-
-    /**
-        @brief Returns the description of the config-value.
-        @return The description
-    */
-    const std::string& ConfigValueContainer::getDescription() const
-    {
-        return GetLocalisation(this->description_);
-    }
-}
Index: code/trunk/src/libraries/core/ConfigValueContainer.h
===================================================================
--- code/trunk/src/libraries/core/ConfigValueContainer.h	(revision 9576)
+++ 	(revision )
@@ -1,305 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Config ConfigFile
-    @brief Declaration of the ConfigValueContainer class, caches a config-value.
-
-    The ConfigValueContainer class contains all needed information about a configurable variable:
-     - the name of the variable
-     - the name of the class the variable belongs to
-     - the default value
-     - the user-specified value
-     - a pointer to the entry in the config-file
-
-    This is needed to assign the configured values to all newly created objects.
-*/
-
-#ifndef _ConfigValueContainer_H__
-#define _ConfigValueContainer_H__
-
-#include "CorePrereqs.h"
-
-#include <string>
-#include <vector>
-
-#include "util/MultiType.h"
-#include "Identifier.h"
-
-namespace orxonox
-{
-    class ConfigValueCallbackBase
-    {
-        public:
-            virtual void call(void* object) = 0;
-            inline virtual ~ConfigValueCallbackBase() {}
-    };
-
-    template <class T>
-    class ConfigValueCallback: public ConfigValueCallbackBase
-    {
-        public:
-            inline ConfigValueCallback(void (T::*function) (void)) : function_(function) {}
-            inline virtual ~ConfigValueCallback() {}
-            inline virtual void call(void* object)
-            {
-                if (!Identifier::isCreatingHierarchy())
-                    (static_cast<T*>(object)->*this->function_)();
-            }
-
-        private:
-            void (T::*function_) (void);
-    };
-
-
-    /**
-        @brief The ConfigValuecontainer contains all needed information about a configurable variable.
-
-        The ConfigValueContainer class contains all needed information about a configurable variable:
-         - the name of the variable
-         - the name of the class the variable belongs to
-         - the default value
-         - the user-specified value
-         - a pointer to the entry in the config-file
-
-        This is needed to assign the configured values to all newly created objects.
-
-        The container searches for the entry in the config file.
-        If there is an entry, it parses the specified value and assigns it to the variable of the right type.
-        If there is no entry, it adds the entry with the default-value to the section of the variables class.
-        If there is no section, the section and the entry are added to the end of the config-file.
-    */
-    class _CoreExport ConfigValueContainer
-    {
-        public:
-            /**
-                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
-                @param type The type of the corresponding config-file
-                @param identifier The identifier of the class the variable belongs to
-                @param sectionname Name of the section the configValue should be put in.
-                @param varname The name of the variable
-                @param defvalue The default-value
-                @param value Only needed do determine the right type.
-            */
-            template <class D, class V>
-            ConfigValueContainer(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname, const D& defvalue, const V&)
-            {
-                this->init(type, identifier, sectionname, varname);
-                this->initValue(static_cast<V>(defvalue));
-            }
-
-            /**
-                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
-                @param type The type of the corresponding config-file
-                @param identifier The identifier of the class the variable belongs to
-                @param sectionname Name of the section the configValue should be put in.
-                @param varname The name of the variable
-                @param defvalue The default-value
-                @param value Only needed do determine the right type.
-            */
-            template <class D, class V>
-            ConfigValueContainer(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname, const std::vector<D>& defvalue, const std::vector<V>&)
-            {
-                this->init(type, identifier, sectionname, varname);
-
-                this->value_ = V();
-                for (unsigned int i = 0; i < defvalue.size(); i++)
-                    this->valueVector_.push_back(MultiType(defvalue[i]));
-
-                this->initVector();
-            }
-
-            ~ConfigValueContainer();
-
-            /**
-                @brief Returns the configured value.
-                @param value A pointer to the variable to store the value.
-                @param object The object calling this function
-                @return The ConfigValueContainer
-            */
-            template <typename T, class C>
-            ConfigValueContainer& getValue(T* value, C* object)
-            {
-                if ((this->callback_ && object) || this->bContainerIsNew_)
-                {
-                    T temp = *value;
-                    this->value_.getValue(value);
-                    if (this->bContainerIsNew_ || (*value) != temp)
-                    {
-                        this->bContainerIsNew_ = false;
-                        if (this->callback_ && object)
-                            this->callback_->call(object);
-                        else
-                            this->bDoInitialCallback_ = true;
-                    }
-                }
-                else
-                {
-                    this->value_.getValue(value);
-                }
-                return *this;
-            }
-
-            /**
-                @brief Returns the configured vector.
-                @param value A pointer to the vector to store the values.
-                @param object The object calling this function
-                @return The ConfigValueContainer
-            */
-            template <typename T, class C>
-            ConfigValueContainer& getValue(std::vector<T>* value, C* object)
-            {
-                if ((this->callback_ && object) || this->bContainerIsNew_)
-                {
-                    if (this->bContainerIsNew_)
-                        this->bContainerIsNew_ = false;
-
-                    std::vector<T> temp = *value;
-                    value->clear();
-                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
-                        value->push_back(this->valueVector_[i]);
-
-                    if (value->size() != temp.size())
-                    {
-                        if (this->callback_ && object)
-                            this->callback_->call(object);
-                        else
-                            this->bDoInitialCallback_ = true;
-                    }
-                    else
-                    {
-                        for (unsigned int i = 0; i < value->size(); ++i)
-                        {
-                            if ((*value)[i] != temp[i])
-                            {
-                                if (this->callback_ && object)
-                                    this->callback_->call(object);
-                                else
-                                    this->bDoInitialCallback_ = true;
-                                break;
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    value->clear();
-                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
-                        value->push_back(this->valueVector_[i]);
-                }
-                return *this;
-            }
-
-            /// Returns the name of this container.
-            inline const std::string& getName() const
-                { return this->varname_; }
-            /// Returns the name of the section this config value is in.
-            inline const std::string& getSectionName() const
-                { return this->sectionname_; }
-            /// Returns the associated identifier (can be NULL).
-            inline Identifier* getIdentifier() const
-                { return this->identifier_; }
-            /// Returns true if this config-value is a vector.
-            inline bool isVector() const
-                { return this->bIsVector_; }
-            /// Returns the vectors size (or zero if it's not a vector).
-            inline unsigned int getVectorSize() const
-                { return this->valueVector_.size(); }
-
-            ConfigValueContainer& description(const std::string& description);
-            const std::string& getDescription() const;
-
-            /**
-                @brief Adds a callback function, that gets called after getValue() if the newly assigned value differs from the old value of the variable.
-                @param object The object to call the function
-                @param function The callback function
-            */
-            template <class T>
-            inline ConfigValueContainer& callback(T* object, void (T::*function) (void))
-            {
-                if (!this->callback_)
-                {
-                    this->callback_ = new ConfigValueCallback<T>(function);
-
-                    if (this->bDoInitialCallback_)
-                    {
-                        this->bDoInitialCallback_ = false;
-                        this->callback_->call(object);
-                    }
-                }
-
-                return (*this);
-            }
-
-            bool set(const MultiType& input);
-            bool tset(const MultiType& input);
-
-            bool set(unsigned int index, const MultiType& input);
-            bool tset(unsigned int index, const MultiType& input);
-            bool add(const MultiType& input);
-            bool remove(unsigned int index);
-
-            bool reset();
-            void update();
-
-            /// Converts the config-value to a string.
-            inline std::string toString() const
-                { return this->value_; }
-            /// Returns the typename of the assigned config-value.
-            inline std::string getTypename() const
-                { return this->value_.getTypename(); }
-
-        private:
-            void init(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname);
-            void initValue(const MultiType& defvalue);
-            void initVector();
-            bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input);
-
-            bool                       bIsVector_;                  //!< True if the container contains a std::vector
-
-            ConfigFileType::Value      type_;                       //!< The type of the corresponding config-file
-            Identifier*                identifier_;                 //!< The identifier of the class
-            std::string                sectionname_;                //!< The name of the class the variable belongs to
-            std::string                varname_;                    //!< The name of the variable
-            std::string                defvalueString_;             //!< The string of the default-value
-            std::vector<std::string>   defvalueStringVector_;       //!< A vector, containg the strings of the default-values in case we're storing a vector
-
-            MultiType                  value_;                      //!< The value
-            std::vector<MultiType>     valueVector_;                //!< A vector, containg the values in case we're storing a vector
-
-            bool                       bAddedDescription_;          //!< True if a description was added
-            LanguageEntryLabel         description_;                //!< The description
-            ConfigValueCallbackBase*   callback_;                   //!< A callback function to call after getValue if the value changed
-
-            bool                       bContainerIsNew_;            //!< True if it's the first time getValue() gets called
-            bool                       bDoInitialCallback_;         //!< True if the callback should be called as soon as it gets created
-    };
-}
-
-#endif /* _ConfigValueContainer_H__ */
Index: code/trunk/src/libraries/core/ConfigValueIncludes.h
===================================================================
--- code/trunk/src/libraries/core/ConfigValueIncludes.h	(revision 9576)
+++ 	(revision )
@@ -1,272 +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:
- *      Reto Grieder (functions)
- *
- */
-
-/**
-    @defgroup ConfigFile Config file
-    @ingroup Config
-*/
-
-/**
-    @file
-    @ingroup Config ConfigFile
-    @brief Definition of macros and functions for config-values.
-
-    An example of how to use SetConfigValue():
-
-    Definition of a class in the header-file:
-    @code
-    class MyClass : public BaseObject
-    {
-        public:
-            MyClass();              // Constructor
-            void setConfigValues(); // Inherited function
-
-            const std::string& getName()
-                { return this->name_; }
-
-            float getVersion()
-                { return this->version_; }
-
-        private:
-            std::string name_;
-            float version_;
-    };
-    @endcode
-
-    Implementation of the class source-file:
-    @code
-    MyClass::MyClass()
-    {
-        // Macro-call to create an Identifier
-        RegisterObject(MyClass);
-
-        // Function-call to assign the config-values to the new object
-        this->setConfigValues();
-    }
-
-    void MyClass::setConfigValues()
-    {
-        SetConfigValue(name_, "Orxonox").description("The name of the game");
-        SetConfigValue(version_, "1.0").description("The version-number");
-    }
-    @endcode
-
-    Extract of orxonox.ini:
-    @code
-    [MyClass]
-    name_ = "Orxonox"
-    version_ = 1.1 // We have changed this value from 1.0 to 1.1
-    @endcode
-
-    Some other code:
-    @code
-    MyObject orxonoxobject;
-    orxout() << "Name:    " << orxonoxobject.getName() << endl;
-    orxout() << "Version: " << orxonoxobject.getVersion() << endl;
-    @endcode
-
-    Output:
-    @code
-    Name:    Orxonox
-    Version: 1.1
-    @endcode
-*/
-
-#ifndef _ConfigValueIncludes_H__
-#define _ConfigValueIncludes_H__
-
-#include "CorePrereqs.h"
-
-#include "Identifier.h"
-#include "ConfigValueContainer.h"
-
-namespace orxonox
-{
-    /** Sets a runtime configurable value.
-        If the container for the value doesn't yet exist, a new one is created.
-        Also, the @a variable argument will be modified and set to the new value (default or from ini file).
-    @param object
-        Class instance that the config value should belong to (usually just 'this')
-    @param variable
-        Pointer to the variable where the value should be written to
-    @param type
-        Type of the config file, usually ConfigFileType::Settings
-    @param sectionName
-        Name of the section in the ini file (e.g. [MySection])
-    @param entryName
-        Name of the entry in the ini file (e.g. [MySection] myValue)
-    @param defaultValue
-        Value to be used if it cannot be read from the ini file
-    */
-    template <class T, class D, class V>
-    inline ConfigValueContainer& setConfigValueGeneric(T* object, V* variable, ConfigFileType::Value type, const std::string& sectionName, const std::string& entryName, const D& defaultValue)
-    {
-        ConfigValueContainer* container = ClassIdentifier<T>::getIdentifier()->getConfigValueContainer(entryName);
-        if (!container)
-        {
-            container = new ConfigValueContainer(type, ClassIdentifier<T>::getIdentifier(), sectionName, entryName, defaultValue, *variable);
-            ClassIdentifier<T>::getIdentifier()->addConfigValueContainer(entryName, container);
-        }
-        return container->getValue(variable, object);
-    }
-}
-
-/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
-    If the container for the value doesn't yet exist, a new one is created.
-    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
-@param varname
-    Variable name as C++ identifier. It will be used as entry name and as variable pointer
-@param defaultValue
-    Value to be used if it cannot be read from the ini file
-*/
-#define SetConfigValue(varname, defaultValue) \
-    orxonox::setConfigValueGeneric(this, &varname, ConfigFileType::Settings, this->getIdentifier()->getName(), #varname, defaultValue)
-
-/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
-    If the container for the value doesn't yet exist, a new one is created.
-    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
-@param variable
-    Variable name as C++ identifier.
-@param entryName
-    Name of the entry in the ini file (e.g. [MySection] myValue)
-@param defaultValue
-    Value to be used if it cannot be read from the ini file
-*/
-#define SetConfigValueAlias(variable, entryName, defaultValue) \
-    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, this->getIdentifier()->getName(), entryName, defaultValue)
-
-/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
-    If the container for the value doesn't yet exist, a new one is created.
-    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
-@param variable
-    Variable name as C++ identifier.
-@param sectionName
-    Name of the section in the ini file (e.g. [MySection])
-@param entryName
-    Name of the entry in the ini file (e.g. [MySection] myValue)
-@param defaultValue
-    Value to be used if it cannot be read from the ini file
-*/
-#define SetConfigValueExternal(variable, sectionName, entryName, defaultValue) \
-    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, sectionName, entryName, defaultValue)
-
-
-namespace orxonox
-{
-    /** Resets a runtime configurable value to its default.
-        If the container for the value doesn't yet exist, a warning is displayed.
-        Also, the @a variable argument will be modified and set to the default value.
-    @param object
-        Class instance that the config value should belong to (usually just 'this')
-    @param variable
-        Pointer to the variable where the value should be written to
-    @param entryName
-        Name of the entry in the ini file (e.g. [MySection] myValue)
-    */
-    template <class T, class V>
-    inline void resetConfigValueGeneric(T* object, V* variable, const std::string& entryName)
-    {
-        ConfigValueContainer* container = ClassIdentifier<T>::getIdentifier()->getConfigValueContainer(entryName);
-        if (container)
-        {
-            container->reset();
-            container->getValue(variable, object);
-        }
-        else
-        {
-            orxout(user_warning, context::config) << "Couldn't reset config-value '" << entryName << "' in class '"
-                                                  << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << endl;
-        }
-    }
-}
-
-/** Resets a runtime configurable value to its default (simplified macro version of modifyConfigValueGeneric)
-    If the container for the value doesn't yet exist, a warning is displayed.
-    Also, the @a varname argument will be modified and set to the default value.
-@param varname
-    Variable name as C++ identifier. It will be used as entry name and as variable pointer
-*/
-#define ResetConfigValue(varname) \
-    orxonox::resetConfigValueGeneric(this, &varname, #varname)
-
-
-/** Modifies a runtime configurable value by using a modifier and some arguments.
-    If the container for the value doesn't yet exist, a warning is displayed.
-    Also, the @a variable argument will be modified and set to the current value.
-@param object
-    Class instance that the config value should belong to (usually just 'this')
-@param variable
-    Pointer to the variable where the value should be written to
-@param entryName
-    Name of the entry in the ini file (e.g. [MySection] myValue)
-@param modifier
-    On of these functions: set, tset, add, remove, reset, update
-@param ...
-    Arguments for the modifier function
-*/
-#define ModifyConfigValueGeneric(object, variable, entryName, modifier, ...) \
-    if (orxonox::ConfigValueContainer* container = ClassByObjectType(object)->getConfigValueContainer(entryName)) \
-    { \
-        container->modifier(__VA_ARGS__); \
-        container->getValue(variable, object); \
-    } \
-    else \
-    { \
-        orxout(user_warning, context::config) << "Couldn't modify config-value '" << entryName << "' in class '" \
-                                              << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << endl; \
-    }
-
-/** Modifies a runtime configurable value by using a modifier and some arguments.
-    If the container for the value doesn't yet exist, a warning is displayed.
-    Also, the @a varname argument will be modified and set to the current value.
-@param varname
-    Variable name as C++ identifier. It will be used as entry name and as variable pointer
-@param modifier
-    On of these functions: set, tset, add, remove, reset, update
-@param ...
-    Arguments for the modifier function
-*/
-#define ModifyConfigValue(varname, modifier, ...) \
-    ModifyConfigValueGeneric(this, &varname, #varname, modifier, __VA_ARGS__)
-
-/** Modifies a runtime configurable value by using a modifier and some arguments.
-    If the container for the value doesn't yet exist, a warning is displayed.
-    Also, the @a variable argument will be modified and set to the current value.
-@param variable
-    Pointer to the variable where the value should be written to
-@param entryName
-    Name of the entry in the ini file (e.g. [MySection] myValue)
-@param modifier
-    On of these functions: set, tset, add, remove, reset, update
-@param ...
-    Arguments for the modifier function
-*/
-#define ModifyConfigValueExternal(variable, entryName, modifier, ...) \
-    ModifyConfigValueGeneric(this, &variable, entryName, modifier, __VA_ARGS__)
-
-#endif /* _ConfigValueIncludes_H__ */
Index: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Core.cc	(revision 9667)
@@ -60,7 +60,7 @@
 #include "util/SignalHandler.h"
 #include "PathConfig.h"
-#include "CommandLineParser.h"
-#include "ConfigFileManager.h"
-#include "ConfigValueIncludes.h"
+#include "config/CommandLineParser.h"
+#include "config/ConfigFileManager.h"
+#include "config/ConfigValueIncludes.h"
 #include "CoreIncludes.h"
 #include "DynLibManager.h"
@@ -68,8 +68,7 @@
 #include "GraphicsManager.h"
 #include "GUIManager.h"
-#include "Identifier.h"
+#include "class/Identifier.h"
 #include "Language.h"
 #include "LuaState.h"
-#include "ObjectList.h"
 #include "command/ConsoleCommand.h"
 #include "command/IOConsole.h"
@@ -77,4 +76,5 @@
 #include "command/TclThreadManager.h"
 #include "input/InputManager.h"
+#include "object/ObjectList.h"
 
 namespace orxonox
@@ -91,4 +91,7 @@
     SetCommandLineArgument(limitToCPU, 0).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is off = 0.");
 #endif
+
+    // register Core as an abstract class to avoid problems if the class hierarchy is created within Core-constructor
+    RegisterAbstractClass(Core).inheritsFrom(Class(Configurable));
 
     Core::Core(const std::string& cmdLine)
@@ -176,5 +179,5 @@
         // Do this soon after the ConfigFileManager has been created to open up the
         // possibility to configure everything below here
-        RegisterRootObject(Core);
+        RegisterObject(Core);
         orxout(internal_info) << "configuring Core" << endl;
         this->setConfigValues();
@@ -198,5 +201,5 @@
         // creates the class hierarchy for all classes with factories
         orxout(internal_info) << "creating class hierarchy" << endl;
-        Identifier::createClassHierarchy();
+        IdentifierManager::getInstance().createClassHierarchy();
 
         // Load OGRE excluding the renderer and the render window
@@ -248,5 +251,6 @@
         safeObjectDelete(&configFileManager_);
         ConsoleCommand::destroyAll();
-        Identifier::destroyAllIdentifiers();
+        Context::setRootContext(NULL);
+        IdentifierManager::getInstance().destroyAllIdentifiers();
         safeObjectDelete(&signalHandler_);
         safeObjectDelete(&dynLibManager_);
@@ -508,7 +512,9 @@
 
 
+    RegisterAbstractClass(DevModeListener).inheritsFrom(Class(Listable));
+
     DevModeListener::DevModeListener()
     {
-        RegisterRootObject(DevModeListener);
+        RegisterObject(DevModeListener);
     }
 }
Index: code/trunk/src/libraries/core/Core.h
===================================================================
--- code/trunk/src/libraries/core/Core.h	(revision 9576)
+++ code/trunk/src/libraries/core/Core.h	(revision 9667)
@@ -47,10 +47,10 @@
 #include "util/DestructionHelper.h"
 #include "util/Singleton.h"
-#include "OrxonoxClass.h"
+#include "config/Configurable.h"
 
 namespace orxonox
 {
     //! Informs about changes in the Development Mode.
-    class DevModeListener : virtual public OrxonoxClass
+    class DevModeListener : virtual public Listable
     {
     public:
@@ -66,5 +66,5 @@
         You should only create this singleton once because it destroys the identifiers!
     */
-    class _CoreExport Core : public Singleton<Core>, public OrxonoxClass
+    class _CoreExport Core : public Singleton<Core>, public Configurable
     {
         friend class Singleton<Core>;
Index: code/trunk/src/libraries/core/CoreIncludes.h
===================================================================
--- code/trunk/src/libraries/core/CoreIncludes.h	(revision 9576)
+++ code/trunk/src/libraries/core/CoreIncludes.h	(revision 9667)
@@ -28,5 +28,5 @@
 
 /**
-    @defgroup Factory RegisterObject() and CreateFactory()
+    @defgroup Factory RegisterObject() and RegisterClass()
     @ingroup Object
 */
@@ -35,18 +35,20 @@
     @file
     @ingroup Object Factory Class Identifier
-    @brief Defines several very important macros used to register objects, create factories, and to work with identifiers.
-
-    Every class needs the @c RegisterObject(class) macro in its constructor. If the class is an interface
-    or the @c BaseObject itself, it needs the macro @c RegisterRootObject(class) instead.
-
-    To allow the object being created through the factory, use the @c CreateFactory(class) macro outside
-    of the class implementation, so it gets executed statically before @c main(). This will at the same time
-    register @a class in the class-hierarchy. If you don't want @a class to be loadable, but still
-    register it, call @c CreateUnloadableFactory(class).
+    @brief Defines several very important macros used to register objects, register classes, and to work with identifiers.
+
+    Every class needs the @c RegisterObject(class) macro in its constructor.
+
+    To register @a class in the class-hierarchy, use the @c RegisterClass(class) macro outside of the class implementation,
+    so it gets executed statically before @c main(). If you don't want @a class to be loadable, but still register it, call
+    @c RegisterUnloadableClass(class).
+
+    Abstract classes are registered with @c RegisterAbstractClass(class). For abstract classes, the inheritance must be
+    defined manually with @c RegisterAbstractClass(class).inheritsFrom(Class(parent)). Multiple parent classes can be defined
+    by chaining the above command.
 
     Example:
     @code
-    // Create the factory for MyClass
-    CreateFactory(MyClass);
+    // register MyClass
+    RegisterClass(MyClass);
 
     // Constructor:
@@ -79,16 +81,56 @@
 
 #include "util/Output.h"
-#include "Identifier.h"
-#include "ClassFactory.h"
-#include "ObjectList.h"
-
-
-/**
-    @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject.
-    @param ClassName The name of the class
-    @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass
-*/
-#define InternRegisterObject(ClassName, bRootClass) \
-    if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initialiseObject(this, #ClassName, bRootClass)) \
+#include "class/IdentifierManager.h"
+#include "object/ClassFactory.h"
+#include "object/ObjectList.h"
+
+// resolve macro conflict on windows
+#if defined(ORXONOX_PLATFORM_WINDOWS)
+#   include <windows.h>
+#   undef RegisterClass
+#endif
+
+
+/**
+    @brief Registers the class in the framework.
+    @param ClassName The name of the class
+*/
+#define RegisterClass(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), true)
+
+/**
+    @brief Registers the class in the framework (for classes without arguments in their constructor).
+    @param ClassName The name of the class
+*/
+#define RegisterClassNoArgs(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryNoArgs<ClassName>(), true)
+
+/**
+    @brief Registers the class in the framework (for classes which should not be loaded through XML).
+    @param ClassName The name of the class
+*/
+#define RegisterUnloadableClass(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), false)
+
+/**
+    @brief Registers an abstract class in the framework.
+    @param ClassName The name of the class
+*/
+#define RegisterAbstractClass(ClassName) \
+    RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>(NULL), false)
+
+/**
+    @brief Registers the class in the framework with a given Factory.
+    @param ClassName The name of the class
+*/
+#define RegisterClassWithFactory(ClassName, FactoryInstance, bLoadable) \
+    Identifier& _##ClassName##Identifier = orxonox::registerClass<ClassName>(#ClassName, FactoryInstance, bLoadable)
+
+/**
+    @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName.
+    @param ClassName The name of the class
+*/
+#define RegisterObject(ClassName) \
+    if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this)) \
         return; \
     else \
@@ -96,35 +138,4 @@
 
 /**
-    @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.
-    @param ClassName The name of the class
-*/
-#define RegisterObject(ClassName) \
-    InternRegisterObject(ClassName, false)
-
-/**
-    @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.
-    @param ClassName The name of the class
-
-    In contrast to RegisterObject, this is used for classes that inherit directly from
-    orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject.
-*/
-#define RegisterRootObject(ClassName) \
-    InternRegisterObject(ClassName, true)
-
-/**
-    @brief Creates the Factory.
-    @param ClassName The name of the class
-*/
-#define CreateFactory(ClassName) \
-    Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName, true)
-
-/**
-    @brief Creates the Factory for classes which should not be loaded through XML.
-    @param ClassName The name of the class
-*/
-#define CreateUnloadableFactory(ClassName) \
-    Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName, false)
-
-/**
     @brief Returns the Identifier of the given class.
     @param ClassName The name of the class
@@ -137,4 +148,29 @@
 {
     /**
+     * @brief Overload of registerClass() which determines T implicitly by the template argument of the ClassFactory.
+     */
+    template <class T>
+    inline Identifier& registerClass(const std::string& name, ClassFactory<T>* factory, bool bLoadable = true)
+    {
+        return registerClass<T>(name, static_cast<Factory*>(factory), bLoadable);
+    }
+
+    /**
+     * @brief Registers a class in the framework.
+     * @param name The name of the class
+     * @param factory The factory which is able to create new instances of this class
+     * @param bLoadable Whether the class is allowed to be loaded through XML
+     */
+    template <class T>
+    inline Identifier& registerClass(const std::string& name, Factory* factory, bool bLoadable = true)
+    {
+        orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
+        Identifier* identifier = ClassIdentifier<T>::getIdentifier(name);
+        identifier->setFactory(factory);
+        identifier->setLoadable(bLoadable);
+        return *identifier;
+    }
+
+    /**
         @brief Returns the Identifier with a given name.
         @param name The name of the class
@@ -142,5 +178,5 @@
     inline Identifier* ClassByString(const std::string& name)
     {
-        return Identifier::getIdentifierByString(name);
+        return IdentifierManager::getInstance().getIdentifierByString(name);
     }
 
@@ -151,5 +187,5 @@
     inline Identifier* ClassByLowercaseString(const std::string& name)
     {
-        return Identifier::getIdentifierByLowercaseString(name);
+        return IdentifierManager::getInstance().getIdentifierByLowercaseString(name);
     }
 
@@ -160,12 +196,12 @@
     inline Identifier* ClassByID(uint32_t id)
     {
-        return Identifier::getIdentifierByID(id);
+        return IdentifierManager::getInstance().getIdentifierByID(id);
     }
 
     /**
         @brief Returns the Identifier with a given 'this' pointer.
-        @note This of course only works with OrxonoxClasses.
+        @note This of course only works with Identifiables.
               The only use is in conjunction with macros that don't know the class type.
-        @param object Pointer to an OrxonoxClass
+        @param object Pointer to an Identifiable
     */
     template <class T>
Index: code/trunk/src/libraries/core/CorePrereqs.h
===================================================================
--- code/trunk/src/libraries/core/CorePrereqs.h	(revision 9576)
+++ code/trunk/src/libraries/core/CorePrereqs.h	(revision 9667)
@@ -127,4 +127,6 @@
     class ClassFactory;
     template <class T>
+    class ClassFactoryWithContext;
+    template <class T>
     class ClassIdentifier;
     class ClassTreeMask;
@@ -140,6 +142,9 @@
     class ConfigFileManager;
     class ConfigFileSection;
+    class Configurable;
     class ConfigValueContainer;
+    class Context;
     class Core;
+    class Destroyable;
     class DestructionListener;
     class DynLib;
@@ -154,14 +159,14 @@
     class GraphicsManager;
     class GUIManager;
+    class Identifiable;
     class Identifier;
     template <class T>
     class Iterator;
     class Language;
+    class Listable;
     class LuaFunctor;
     class LuaState;
     class MemoryArchive;
     class MemoryArchiveFactory;
-    class MetaObjectList;
-    class MetaObjectListElement;
     class Namespace;
     class NamespaceNode;
@@ -176,4 +181,5 @@
     class OgreWindowEventListener;
     class OrxonoxClass;
+    class OrxonoxInterface;
     class PathConfig;
     struct ResourceInfo;
Index: code/trunk/src/libraries/core/Event.cc
===================================================================
--- code/trunk/src/libraries/core/Event.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Event.cc	(revision 9667)
@@ -35,5 +35,5 @@
 
 #include "BaseObject.h"
-#include "Identifier.h"
+#include "class/Identifier.h"
 
 namespace orxonox
Index: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc	(revision 9576)
+++ code/trunk/src/libraries/core/GUIManager.cc	(revision 9667)
@@ -78,5 +78,5 @@
 #include "util/OrxAssert.h"
 #include "util/output/BaseWriter.h"
-#include "ConfigValueIncludes.h"
+#include "config/ConfigValueIncludes.h"
 #include "Core.h"
 #include "CoreIncludes.h"
@@ -256,5 +256,5 @@
         , destructionHelper_(this)
     {
-        RegisterRootObject(GUIManager);
+        RegisterObject(GUIManager);
 
         orxout(internal_status) << "initializing GUIManager..." << endl;
Index: code/trunk/src/libraries/core/GUIManager.h
===================================================================
--- code/trunk/src/libraries/core/GUIManager.h	(revision 9576)
+++ code/trunk/src/libraries/core/GUIManager.h	(revision 9667)
@@ -49,5 +49,4 @@
 #include "util/Singleton.h"
 #include "input/InputHandler.h"
-#include "OrxonoxClass.h"
 #include "WindowEventListener.h"
 
Index: code/trunk/src/libraries/core/Game.cc
===================================================================
--- code/trunk/src/libraries/core/Game.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Game.cc	(revision 9667)
@@ -44,8 +44,8 @@
 #include "util/Sleep.h"
 #include "util/SubString.h"
-#include "CommandLineParser.h"
 #include "Core.h"
 #include "CoreIncludes.h"
-#include "ConfigValueIncludes.h"
+#include "config/CommandLineParser.h"
+#include "config/ConfigValueIncludes.h"
 #include "GameMode.h"
 #include "GameState.h"
@@ -112,5 +112,5 @@
 
         // Do this after the Core creation!
-        RegisterRootObject(Game);
+        RegisterObject(Game);
         this->setConfigValues();
 
Index: code/trunk/src/libraries/core/Game.h
===================================================================
--- code/trunk/src/libraries/core/Game.h	(revision 9576)
+++ code/trunk/src/libraries/core/Game.h	(revision 9667)
@@ -50,5 +50,5 @@
 #include "util/DestructionHelper.h"
 #include "util/Singleton.h"
-#include "OrxonoxClass.h"
+#include "config/Configurable.h"
 
 /**
@@ -82,5 +82,5 @@
     class _CoreExport Game
 // tolua_end
-        : public Singleton<Game>, public OrxonoxClass
+        : public Singleton<Game>, public Configurable
     { // tolua_export
         friend class Singleton<Game>;
Index: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc	(revision 9576)
+++ code/trunk/src/libraries/core/GraphicsManager.cc	(revision 9667)
@@ -52,5 +52,5 @@
 #include "util/StringUtils.h"
 #include "util/SubString.h"
-#include "ConfigValueIncludes.h"
+#include "config/ConfigValueIncludes.h"
 #include "CoreIncludes.h"
 #include "Core.h"
Index: code/trunk/src/libraries/core/GraphicsManager.h
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.h	(revision 9576)
+++ code/trunk/src/libraries/core/GraphicsManager.h	(revision 9667)
@@ -52,5 +52,5 @@
 #include "util/DestructionHelper.h"
 #include "util/Singleton.h"
-#include "OrxonoxClass.h"
+#include "config/Configurable.h"
 
 // tolua_begin
@@ -63,5 +63,5 @@
     class _CoreExport GraphicsManager
 // tolua_end
-        : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
+        : public Singleton<GraphicsManager>, public Configurable, public Ogre::LogListener
     { // tolua_export
         friend class Singleton<GraphicsManager>;
Index: code/trunk/src/libraries/core/Identifier.cc
===================================================================
--- code/trunk/src/libraries/core/Identifier.cc	(revision 9576)
+++ 	(revision )
@@ -1,507 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of the Identifier class.
-*/
-
-#include "Identifier.h"
-
-#include <ostream>
-
-#include "util/StringUtils.h"
-#include "ConfigValueContainer.h"
-#include "ClassFactory.h"
-#include "XMLPort.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###       Identifier        ###
-    // ###############################
-    int Identifier::hierarchyCreatingCounter_s = 0;
-    unsigned int Identifier::classIDCounter_s = 0;
-
-    /**
-        @brief Constructor: No factory, no object created, new ObjectList and a unique networkID.
-    */
-    Identifier::Identifier()
-        : classID_(classIDCounter_s++)
-    {
-        this->objects_ = new ObjectListBase(this);
-
-        this->bCreatedOneObject_ = false;
-        this->bSetName_ = false;
-        this->factory_ = 0;
-        this->bLoadable_ = false;
-
-        this->bHasConfigValues_ = false;
-
-        // Default network ID is the class ID
-        this->networkID_ = this->classID_;
-    }
-
-    /**
-        @brief Destructor: Deletes the list containing the children.
-    */
-    Identifier::~Identifier()
-    {
-        delete this->objects_;
-
-        if (this->factory_)
-            delete this->factory_;
-
-        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
-            delete (it->second);
-        for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it)
-            delete (it->second);
-        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
-            delete (it->second);
-    }
-
-    /**
-        @brief Returns the identifier map with the names as received by typeid(). This is only used internally.
-    */
-    std::map<std::string, Identifier*>& Identifier::getTypeIDIdentifierMap()
-    {
-        static std::map<std::string, Identifier*> identifiers;    //!< The map to store all Identifiers.
-        return identifiers;
-    }
-
-    /**
-        @brief Returns an identifier by name and adds it if not available
-        @param name The name of the identifier as typeid().name() suggests
-        @param proposal A pointer to a newly created identifier for the case of non existence in the map
-        @return The identifier (unique instance)
-    */
-    Identifier* Identifier::getIdentifierSingleton(const std::string& name, Identifier* proposal)
-    {
-        std::map<std::string, Identifier*>::const_iterator it = getTypeIDIdentifierMap().find(name);
-
-        if (it != getTypeIDIdentifierMap().end())
-        {
-            // There is already an entry: return it and delete the proposal
-            delete proposal;
-            return it->second;
-        }
-        else
-        {
-            // There is no entry: put the proposal into the map and return it
-            getTypeIDIdentifierMap()[name] = proposal;
-            return proposal;
-        }
-    }
-
-    /**
-        @brief Registers a class, which means that the name and the parents get stored.
-        @param parents A list, containing the Identifiers of all parents of the class
-        @param bRootClass True if the class is either an Interface or the BaseObject itself
-    */
-    void Identifier::initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass)
-    {
-        // Check if at least one object of the given type was created
-        if (!this->bCreatedOneObject_ && Identifier::isCreatingHierarchy())
-        {
-            // If no: We have to store the information and initialize the Identifier
-            orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;
-            if (bRootClass)
-                this->initialize(0); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
-            else
-                this->initialize(parents);
-        }
-    }
-
-    /**
-        @brief Initializes the Identifier with a list containing all parents of the class the Identifier belongs to.
-        @param parents A list containing all parents
-    */
-    void Identifier::initialize(std::set<const Identifier*>* parents)
-    {
-        orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;
-        this->bCreatedOneObject_ = true;
-
-        if (parents)
-        {
-            this->parents_ = (*parents);
-            this->directParents_ = (*parents);
-
-            // Iterate through all parents
-            for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
-            {
-                // Tell the parent we're one of it's children
-                (*it)->children_.insert((*it)->children_.end(), this);
-
-                // Erase all parents of our parent from our direct-parent-list
-                for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)
-                {
-                    // Search for the parent's parent in our direct-parent-list
-                    for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)
-                    {
-                        if ((*it1) == (*it2))
-                        {
-                            // We've found a non-direct parent in our list: Erase it
-                            this->directParents_.erase(it2);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            // Now iterate through all direct parents
-            for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
-            {
-                // Tell the parent we're one of it's direct children
-                (*it)->directChildren_.insert((*it)->directChildren_.end(), this);
-
-                // Create the super-function dependencies
-                (*it)->createSuperFunctionCaller();
-            }
-        }
-    }
-
-    /**
-        @brief Creates the class-hierarchy by creating and destroying one object of each type.
-    */
-    void Identifier::createClassHierarchy()
-    {
-        orxout(internal_status) << "Create class-hierarchy" << endl;
-        Identifier::startCreatingHierarchy();
-        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMap().begin(); it != Identifier::getStringIdentifierMap().end(); ++it)
-        {
-            // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
-            if (it->second->hasFactory())
-            {
-                BaseObject* temp = it->second->fabricate(0);
-                temp->destroy();
-            }
-        }
-        Identifier::stopCreatingHierarchy();
-        orxout(internal_status) << "Finished class-hierarchy creation" << endl;
-    }
-
-    /**
-        @brief Destroys all Identifiers. Called when exiting the program.
-    */
-    void Identifier::destroyAllIdentifiers()
-    {
-        for (std::map<std::string, Identifier*>::iterator it = Identifier::getTypeIDIdentifierMap().begin(); it != Identifier::getTypeIDIdentifierMap().end(); ++it)
-            delete (it->second);
-    }
-
-    /**
-        @brief Sets the name of the class.
-    */
-    void Identifier::setName(const std::string& name)
-    {
-        if (!this->bSetName_)
-        {
-            this->name_ = name;
-            this->bSetName_ = true;
-            Identifier::getStringIdentifierMapIntern()[name] = this;
-            Identifier::getLowercaseStringIdentifierMapIntern()[getLowercase(name)] = this;
-            Identifier::getIDIdentifierMapIntern()[this->networkID_] = this;
-        }
-    }
-
-    /**
-        @brief Creates an object of the type the Identifier belongs to.
-        @return The new object
-    */
-    BaseObject* Identifier::fabricate(BaseObject* creator)
-    {
-        if (this->factory_)
-        {
-            return this->factory_->fabricate(creator); // We have to return a BaseObject, because we don't know the exact type.
-        }
-        else
-        {
-            orxout(user_error) << "An error occurred in Identifier.cc:" << endl;
-            orxout(user_error) << "Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << endl;
-            orxout(user_error) << "Aborting..." << endl;
-            abort();
-            return 0;
-        }
-    }
-
-    /**
-        @brief Sets the network ID to a new value and changes the entry in the ID-Identifier-map.
-    */
-    void Identifier::setNetworkID(uint32_t id)
-    {
-//        Identifier::getIDIdentifierMapIntern().erase(this->networkID_);
-        Identifier::getIDIdentifierMapIntern()[id] = this;
-        this->networkID_ = id;
-    }
-
-    /**
-        @brief Returns true, if the Identifier is at least of the given type.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isA(const Identifier* identifier) const
-    {
-        return (identifier == this || (this->parents_.find(identifier) != this->parents_.end()));
-    }
-
-    /**
-        @brief Returns true, if the Identifier is exactly of the given type.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isExactlyA(const Identifier* identifier) const
-    {
-        return (identifier == this);
-    }
-
-    /**
-        @brief Returns true, if the assigned identifier is a child of the given identifier.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isChildOf(const Identifier* identifier) const
-    {
-        return (this->parents_.find(identifier) != this->parents_.end());
-    }
-
-    /**
-        @brief Returns true, if the assigned identifier is a direct child of the given identifier.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isDirectChildOf(const Identifier* identifier) const
-    {
-        return (this->directParents_.find(identifier) != this->directParents_.end());
-    }
-
-    /**
-        @brief Returns true, if the assigned identifier is a parent of the given identifier.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isParentOf(const Identifier* identifier) const
-    {
-        return (this->children_.find(identifier) != this->children_.end());
-    }
-
-    /**
-        @brief Returns true, if the assigned identifier is a direct parent of the given identifier.
-        @param identifier The identifier to compare with
-    */
-    bool Identifier::isDirectParentOf(const Identifier* identifier) const
-    {
-        return (this->directChildren_.find(identifier) != this->directChildren_.end());
-    }
-
-    /**
-        @brief Returns the map that stores all Identifiers with their names.
-        @return The map
-    */
-    std::map<std::string, Identifier*>& Identifier::getStringIdentifierMapIntern()
-    {
-        static std::map<std::string, Identifier*> identifierMap;
-        return identifierMap;
-    }
-
-    /**
-        @brief Returns the map that stores all Identifiers with their names in lowercase.
-        @return The map
-    */
-    std::map<std::string, Identifier*>& Identifier::getLowercaseStringIdentifierMapIntern()
-    {
-        static std::map<std::string, Identifier*> lowercaseIdentifierMap;
-        return lowercaseIdentifierMap;
-    }
-
-    /**
-        @brief Returns the map that stores all Identifiers with their network IDs.
-        @return The map
-    */
-    std::map<uint32_t, Identifier*>& Identifier::getIDIdentifierMapIntern()
-    {
-        static std::map<uint32_t, Identifier*> identifierMap;
-        return identifierMap;
-    }
-
-    /**
-        @brief Returns the Identifier with a given name.
-        @param name The name of the wanted Identifier
-        @return The Identifier
-    */
-    Identifier* Identifier::getIdentifierByString(const std::string& name)
-    {
-        std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapIntern().find(name);
-        if (it != Identifier::getStringIdentifierMapIntern().end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Returns the Identifier with a given name in lowercase.
-        @param name The name of the wanted Identifier
-        @return The Identifier
-    */
-    Identifier* Identifier::getIdentifierByLowercaseString(const std::string& name)
-    {
-        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseStringIdentifierMapIntern().find(name);
-        if (it != Identifier::getLowercaseStringIdentifierMapIntern().end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Returns the Identifier with a given network ID.
-        @param id The network ID of the wanted Identifier
-        @return The Identifier
-    */
-    Identifier* Identifier::getIdentifierByID(const uint32_t id)
-    {
-        std::map<uint32_t, Identifier*>::const_iterator it = Identifier::getIDIdentifierMapIntern().find(id);
-        if (it != Identifier::getIDIdentifierMapIntern().end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Cleans the NetworkID map (needed on clients for correct initialization)
-    */
-    void Identifier::clearNetworkIDs()
-    {
-        Identifier::getIDIdentifierMapIntern().clear();
-    }
-
-    /**
-        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.
-        @param varname The name of the variablee
-        @param container The container
-    */
-    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
-    {
-        std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);
-        if (it != this->configValues_.end())
-        {
-            orxout(internal_warning) << "Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << endl;
-            delete (it->second);
-        }
-
-        this->bHasConfigValues_ = true;
-        this->configValues_[varname] = container;
-    }
-
-    /**
-        @brief Returns the ConfigValueContainer of a variable, given by the string of its name.
-        @param varname The name of the variable
-        @return The ConfigValueContainer
-    */
-    ConfigValueContainer* Identifier::getConfigValueContainer(const std::string& varname)
-    {
-        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_.find(varname);
-        if (it != configValues_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
-        @param paramname The name of the parameter
-        @return The container
-    */
-    XMLPortParamContainer* Identifier::getXMLPortParamContainer(const std::string& paramname)
-    {
-        std::map<std::string, XMLPortParamContainer*>::const_iterator it = this->xmlportParamContainers_.find(paramname);
-        if (it != this->xmlportParamContainers_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
-        @param paramname The name of the parameter
-        @param container The container
-    */
-    void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
-    {
-        std::map<std::string, XMLPortParamContainer*>::const_iterator it = this->xmlportParamContainers_.find(paramname);
-        if (it != this->xmlportParamContainers_.end())
-        {
-            orxout(internal_warning) << "Overwriting XMLPortParamContainer in class " << this->getName() << '.' << endl;
-            delete (it->second);
-        }
-
-        this->xmlportParamContainers_[paramname] = container;
-    }
-
-    /**
-        @brief Returns a XMLPortObjectContainer that attaches an object to this class.
-        @param sectionname The name of the section that contains the attachable objects
-        @return The container
-    */
-    XMLPortObjectContainer* Identifier::getXMLPortObjectContainer(const std::string& sectionname)
-    {
-        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = this->xmlportObjectContainers_.find(sectionname);
-        if (it != this->xmlportObjectContainers_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
-        @param sectionname The name of the section that contains the attachable objects
-        @param container The container
-    */
-    void Identifier::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
-    {
-        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = this->xmlportObjectContainers_.find(sectionname);
-        if (it != this->xmlportObjectContainers_.end())
-        {
-            orxout(internal_warning) << "Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << endl;
-            delete (it->second);
-        }
-
-        this->xmlportObjectContainers_[sectionname] = container;
-    }
-
-    /**
-        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
-        @param out The outstream
-        @param list The list (or set) of Identifiers
-        @return The outstream
-    */
-    std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list)
-    {
-        for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
-        {
-            if (it != list.begin())
-                out << ' ';
-            out << (*it)->getName();
-        }
-
-        return out;
-    }
-}
Index: code/trunk/src/libraries/core/Identifier.h
===================================================================
--- code/trunk/src/libraries/core/Identifier.h	(revision 9576)
+++ 	(revision )
@@ -1,502 +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:
- *      ...
- *
- */
-
-/**
-    @defgroup Identifier Identifier
-    @ingroup Class
-*/
-
-/**
-    @file
-    @ingroup Class Identifier
-    @brief Declaration of Identifier, definition of ClassIdentifier<T>; used to identify the class of an object.
-
-    @anchor IdentifierExample
-
-    An Identifier "identifies" the class of an object. It contains different information about
-    the class: Its name and ID, a list of all instances of this class, a factory to create new
-    instances of this class, and more.
-
-    It also contains information about the inheritance of this class: It stores a list of the
-    Identifiers of all parent-classes as well as a list of all child-classes. These relationships
-    can be tested using functions like @c isA(), @c isChildOf(), @c isParentOf(), and more.
-
-    Every Identifier is in fact a ClassIdentifier<T> (where T is the class that is identified
-    by the Identifier), Identifier is just the common base-class.
-
-    Example:
-    @code
-    MyClass* object = new MyClass();                                            // create an instance of MyClass
-
-    object->getIdentifier()->getName();                                         // returns "MyClass"
-
-    BaseObject* other = object->getIdentifier()->fabricate(0);                  // fabricates a new instance of MyClass
-
-
-    // iterate through all objects of type MyClass:
-    ObjectListBase* objects = object->getIdentifier()->getObjects();            // get a pointer to the object-list
-    int count;
-    for (Iterator<BaseObject> it = objects.begin(); it != objects.end(); ++it)  // iterate through the objects
-        ++count;
-    orxout() << count << endl;                                                  // prints "2" because we created 2 instances of MyClass so far
-
-
-    // test the class hierarchy
-    object->getIdentifier()->isA(Class(MyClass));                               // returns true
-    object->isA(Class(MyClass));                                                // returns true (short version)
-
-    object->isA(Class(BaseClass));                                              // returns true if MyClass is a child of BaseClass
-
-    Class(ChildClass)->isChildOf(object->getIdentifier());                      // returns true if ChildClass is a child of MyClass
-    @endcode
-*/
-
-#ifndef _Identifier_H__
-#define _Identifier_H__
-
-#include "CorePrereqs.h"
-
-#include <cassert>
-#include <map>
-#include <set>
-#include <string>
-#include <typeinfo>
-#include <loki/TypeTraits.h>
-
-#include "util/Output.h"
-#include "MetaObjectList.h"
-#include "ObjectList.h"
-#include "ObjectListBase.h"
-#include "Super.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###       Identifier        ###
-    // ###############################
-    /**
-        @brief The Identifier is used to identify the class of an object and to store information about the class.
-
-        Each Identifier stores information about one class. The Identifier can then be used to identify
-        this class. On the other hand it's also possible to get the corresponding Identifier of a class,
-        for example by using the macro Class().
-
-        @see See @ref IdentifierExample "Identifier.h" for more information and some examples.
-
-        @note You can't directly create an Identifier, it's just the base-class of ClassIdentifier<T>.
-    */
-    class _CoreExport Identifier
-    {
-        public:
-            /// Returns the name of the class the Identifier belongs to.
-            inline const std::string& getName() const { return this->name_; }
-            void setName(const std::string& name);
-
-            /// Returns the network ID to identify a class through the network.
-            inline uint32_t getNetworkID() const { return this->networkID_; }
-            void setNetworkID(uint32_t id);
-
-            /// Returns the unique ID of the class.
-            ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
-
-            /// Returns the list of all existing objects of this class.
-            inline ObjectListBase* getObjects() const { return this->objects_; }
-
-            /// Sets the Factory.
-            inline void addFactory(Factory* factory) { this->factory_ = factory; }
-            /// Returns true if the Identifier has a Factory.
-            inline bool hasFactory() const { return (this->factory_ != 0); }
-
-            BaseObject* fabricate(BaseObject* creator);
-
-            /// Returns true if the class can be loaded through XML.
-            inline bool isLoadable() const { return this->bLoadable_; }
-            /// Set the class to be loadable through XML or not.
-            inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; }
-
-            bool isA(const Identifier* identifier) const;
-            bool isExactlyA(const Identifier* identifier) const;
-            bool isChildOf(const Identifier* identifier) const;
-            bool isDirectChildOf(const Identifier* identifier) const;
-            bool isParentOf(const Identifier* identifier) const;
-            bool isDirectParentOf(const Identifier* identifier) const;
-
-
-            /////////////////////////////
-            ////// Class Hierarchy //////
-            /////////////////////////////
-            static void createClassHierarchy();
-
-            /// Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.
-            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
-
-            /// Returns the parents of the class the Identifier belongs to.
-            inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
-            /// Returns the begin-iterator of the parents-list.
-            inline std::set<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); }
-            /// Returns the end-iterator of the parents-list.
-            inline std::set<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); }
-
-            /// Returns the children of the class the Identifier belongs to.
-            inline const std::set<const Identifier*>& getChildren() const { return this->children_; }
-            /// Returns the begin-iterator of the children-list.
-            inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_.begin(); }
-            /// Returns the end-iterator of the children-list.
-            inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_.end(); }
-
-            /// Returns the direct parents of the class the Identifier belongs to.
-            inline const std::set<const Identifier*>& getDirectParents() const { return this->directParents_; }
-            /// Returns the begin-iterator of the direct-parents-list.
-            inline std::set<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); }
-            /// Returns the end-iterator of the direct-parents-list.
-            inline std::set<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); }
-
-            /// Returns the direct children the class the Identifier belongs to.
-            inline const std::set<const Identifier*>& getDirectChildren() const { return this->directChildren_; }
-            /// Returns the begin-iterator of the direct-children-list.
-            inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_.begin(); }
-            /// Returns the end-iterator of the direct-children-list.
-            inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_.end(); }
-
-
-            //////////////////////////
-            ///// Identifier Map /////
-            //////////////////////////
-            static void destroyAllIdentifiers();
-
-            static Identifier* getIdentifierByString(const std::string& name);
-            static Identifier* getIdentifierByLowercaseString(const std::string& name);
-            static Identifier* getIdentifierByID(uint32_t id);
-
-            static void clearNetworkIDs();
-
-            /// Returns the map that stores all Identifiers with their names.
-            static inline const std::map<std::string, Identifier*>& getStringIdentifierMap() { return Identifier::getStringIdentifierMapIntern(); }
-            /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their names.
-            static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapBegin() { return Identifier::getStringIdentifierMap().begin(); }
-            /// Returns a const_iterator to the end of the map that stores all Identifiers with their names.
-            static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapEnd() { return Identifier::getStringIdentifierMap().end(); }
-
-            /// Returns the map that stores all Identifiers with their names in lowercase.
-            static inline const std::map<std::string, Identifier*>& getLowercaseStringIdentifierMap() { return Identifier::getLowercaseStringIdentifierMapIntern(); }
-            /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase.
-            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapBegin() { return Identifier::getLowercaseStringIdentifierMap().begin(); }
-            /// Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase.
-            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapEnd() { return Identifier::getLowercaseStringIdentifierMap().end(); }
-
-            /// Returns the map that stores all Identifiers with their IDs.
-            static inline const std::map<uint32_t, Identifier*>& getIDIdentifierMap() { return Identifier::getIDIdentifierMapIntern(); }
-            /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their IDs.
-            static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapBegin() { return Identifier::getIDIdentifierMap().begin(); }
-            /// Returns a const_iterator to the end of the map that stores all Identifiers with their IDs.
-            static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapEnd() { return Identifier::getIDIdentifierMap().end(); }
-
-
-            /////////////////////////
-            ///// Config Values /////
-            /////////////////////////
-            virtual void updateConfigValues(bool updateChildren = true) const = 0;
-
-            /// Returns true if this class has at least one config value.
-            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
-
-            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
-            ConfigValueContainer* getConfigValueContainer(const std::string& varname);
-
-
-            ///////////////////
-            ///// XMLPort /////
-            ///////////////////
-            /// Returns the map that stores all XMLPort params.
-            inline const std::map<std::string, XMLPortParamContainer*>& getXMLPortParamMap() const { return this->xmlportParamContainers_; }
-            /// Returns a const_iterator to the beginning of the map that stores all XMLPort params.
-            inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapBegin() const { return this->xmlportParamContainers_.begin(); }
-            /// Returns a const_iterator to the end of the map that stores all XMLPort params.
-            inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapEnd() const { return this->xmlportParamContainers_.end(); }
-
-            /// Returns the map that stores all XMLPort objects.
-            inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortObjectMap() const { return this->xmlportObjectContainers_; }
-            /// Returns a const_iterator to the beginning of the map that stores all XMLPort objects.
-            inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapBegin() const { return this->xmlportObjectContainers_.begin(); }
-            /// Returns a const_iterator to the end of the map that stores all XMLPort objects.
-            inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapEnd() const { return this->xmlportObjectContainers_.end(); }
-
-            void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
-            XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
-
-            void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
-            XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
-
-
-        protected:
-            Identifier();
-            Identifier(const Identifier& identifier); // don't copy
-            virtual ~Identifier();
-
-            static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
-            virtual void createSuperFunctionCaller() const = 0;
-
-            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
-
-            /// Returns the map that stores all Identifiers with their names.
-            static std::map<std::string, Identifier*>& getStringIdentifierMapIntern();
-            /// Returns the map that stores all Identifiers with their names in lowercase.
-            static std::map<std::string, Identifier*>& getLowercaseStringIdentifierMapIntern();
-            /// Returns the map that stores all Identifiers with their network IDs.
-            static std::map<uint32_t, Identifier*>& getIDIdentifierMapIntern();
-
-            /// Returns the children of the class the Identifier belongs to.
-            inline std::set<const Identifier*>& getChildrenIntern() const { return this->children_; }
-            /// Returns the direct children of the class the Identifier belongs to.
-            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return this->directChildren_; }
-
-            ObjectListBase* objects_;                                      //!< The list of all objects of this class
-
-        private:
-            /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
-            inline static void startCreatingHierarchy() { hierarchyCreatingCounter_s++; }
-            /// Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.
-            inline static void stopCreatingHierarchy()  { hierarchyCreatingCounter_s--; }
-
-            static std::map<std::string, Identifier*>& getTypeIDIdentifierMap();
-
-            void initialize(std::set<const Identifier*>* parents);
-
-            std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
-            mutable std::set<const Identifier*> children_;                 //!< The children of the class the Identifier belongs to
-
-            std::set<const Identifier*> directParents_;                    //!< The direct parents of the class the Identifier belongs to
-            mutable std::set<const Identifier*> directChildren_;           //!< The direct children of the class the Identifier belongs to
-
-            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
-            bool bSetName_;                                                //!< True if the name is set
-            bool bLoadable_;                                               //!< False = it's not permitted to load the object through XML
-            std::string name_;                                             //!< The name of the class the Identifier belongs to
-            Factory* factory_;                                             //!< The Factory, able to create new objects of the given class (if available)
-            static int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
-            uint32_t networkID_;                                           //!< The network ID to identify a class through the network
-            const unsigned int classID_;                                   //!< Uniquely identifies a class (might not be the same as the networkID_)
-            static unsigned int classIDCounter_s;                          //!< Static counter for the unique classIDs
-
-            bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
-            std::map<std::string, ConfigValueContainer*> configValues_;    //!< A map to link the string of configurable variables with their ConfigValueContainer
-
-            std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
-            std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_;   //!< All attachable objects
-    };
-
-    _CoreExport std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list);
-
-
-    // ###############################
-    // ###     ClassIdentifier     ###
-    // ###############################
-    /**
-        @brief The ClassIdentifier is derived from Identifier and holds all class-specific functions and variables the Identifier cannot have.
-
-        ClassIdentifier is a Singleton, which means that only one ClassIdentifier for a given type T exists.
-        This makes it possible to store information about a class, sharing them with all
-        objects of that class without defining static variables in every class.
-
-        To be really sure that not more than exactly one object exists (even with libraries),
-        ClassIdentifiers are stored in a static map in Identifier.
-    */
-    template <class T>
-    class ClassIdentifier : public Identifier
-    {
-        #ifndef DOXYGEN_SHOULD_SKIP_THIS
-          #define SUPER_INTRUSIVE_DECLARATION_INCLUDE
-          #include "Super.h"
-        #endif
-
-        public:
-            static ClassIdentifier<T>* getIdentifier();
-            static ClassIdentifier<T>* getIdentifier(const std::string& name);
-
-            bool initialiseObject(T* object, const std::string& className, bool bRootClass);
-
-            void updateConfigValues(bool updateChildren = true) const;
-
-        private:
-            static void initialiseIdentifier();
-            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
-            ClassIdentifier()
-            {
-                SuperFunctionInitialization<0, T>::initialize(this);
-            }
-            ~ClassIdentifier()
-            {
-                SuperFunctionDestruction<0, T>::destroy(this);
-            }
-
-            static ClassIdentifier<T>* classIdentifier_s;
-    };
-
-    template <class T>
-    ClassIdentifier<T>* ClassIdentifier<T>::classIdentifier_s = 0;
-
-    /**
-        @brief Returns the only instance of this class.
-        @return The unique Identifier
-    */
-    template <class T>
-    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
-    {
-        // check if the Identifier already exists
-        if (!ClassIdentifier<T>::classIdentifier_s)
-            ClassIdentifier<T>::initialiseIdentifier();
-
-        return ClassIdentifier<T>::classIdentifier_s;
-    }
-
-    /**
-        @brief Does the same as getIdentifier() but sets the name if this wasn't done yet.
-        @param name The name of this Identifier
-        @return The Identifier
-    */
-    template <class T>
-    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
-    {
-        ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
-        identifier->setName(name);
-        return identifier;
-    }
-
-    /**
-        @brief Assigns the static field for the identifier singleton.
-    */
-    template <class T>
-    void ClassIdentifier<T>::initialiseIdentifier()
-    {
-        // Get the name of the class
-        std::string name = typeid(T).name();
-
-        // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used.
-        ClassIdentifier<T>* proposal = new ClassIdentifier<T>();
-
-        // Get the entry from the map
-        ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)Identifier::getIdentifierSingleton(name, proposal);
-
-        if (ClassIdentifier<T>::classIdentifier_s == proposal)
-        {
-            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was not yet existing and got created." << endl;
-        }
-        else
-        {
-            orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was already existing and got assigned." << endl;
-        }
-    }
-
-    /**
-        @brief Adds an object of the given type to the ObjectList.
-        @param object The object to add
-        @param className The name of the class T
-        @param bRootClass True if this is a root class (i.e. it inherits directly from OrxonoxClass)
-    */
-    template <class T>
-    bool ClassIdentifier<T>::initialiseObject(T* object, const std::string& className, bool bRootClass)
-    {
-        if (bRootClass)
-            orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl;
-        else
-            orxout(verbose, context::object_list) << "Register Object: " << className << endl;
-
-        object->identifier_ = this;
-        if (Identifier::isCreatingHierarchy())
-        {
-            if (bRootClass && !object->parents_)
-                object->parents_ = new std::set<const Identifier*>();
-
-            if (object->parents_)
-            {
-                this->initializeClassHierarchy(object->parents_, bRootClass);
-                object->parents_->insert(object->parents_->end(), this);
-            }
-
-            object->setConfigValues();
-            return true;
-        }
-        else
-        {
-            orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
-            object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
-
-            // Add pointer of type T to the map in the OrxonoxClass instance that enables "dynamic_casts"
-            object->objectPointers_.push_back(std::make_pair(this->getClassID(), static_cast<void*>(object)));
-            return false;
-        }
-    }
-
-    /**
-        @brief Updates the config-values of all existing objects of this class by calling their setConfigValues() function.
-    */
-    template <class T>
-    void ClassIdentifier<T>::updateConfigValues(bool updateChildren) const
-    {
-        if (!this->hasConfigValues())
-            return;
-
-        for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
-            it->setConfigValues();
-
-        if (updateChildren)
-            for (std::set<const Identifier*>::const_iterator it = this->getChildrenBegin(); it != this->getChildrenEnd(); ++it)
-                (*it)->updateConfigValues(false);
-    }
-
-
-    // ###############################
-    // ###      orxonox_cast       ###
-    // ###############################
-    /**
-    @brief
-        Casts on object of type OrxonoxClass to any derived type that is
-        registered in the class hierarchy.
-    @return
-        Returns NULL if the cast is not possible
-    @note
-        In case of NULL return (and using MSVC), a dynamic_cast might still be possible if
-        a class forgot to register its objects.
-        Also note that the function is implemented differently for GCC/MSVC.
-    */
-    template <class T, class U>
-    ORX_FORCEINLINE T orxonox_cast(U* source)
-    {
-#ifdef ORXONOX_COMPILER_MSVC
-        typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType;
-        if (source != NULL)
-            return source->template getDerivedPointer<ClassType>(ClassIdentifier<ClassType>::getIdentifier()->getClassID());
-        else
-            return NULL;
-#else
-        return dynamic_cast<T>(source);
-#endif
-    }
-}
-
-#endif /* _Identifier_H__ */
Index: code/trunk/src/libraries/core/Iterator.h
===================================================================
--- code/trunk/src/libraries/core/Iterator.h	(revision 9576)
+++ 	(revision )
@@ -1,311 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Object ObjectList
-    @brief Definition of the Iterator class, used to iterate through object-lists.
-
-    @anchor IteratorExample
-
-    @ref orxonox::Iterator "Iterator" allows to iterate through an @ref orxonox::ObjectListBase
-    "ObjectListBase". Objects in this list are cast to the template argument @a T of Iterator<T> using
-    @c dynamic_cast. In contrast to @ref orxonox::ObjectListIterator "ObjectListIterator<T>",
-    @ref orxonox::Iterator "Iterator<T>" can iterate through every object-list. In practice though it
-    is limited to objects of type @a T and its subclasses. Because of the @c dynamic_cast, this iterator
-    is much slower than ObjectListIterator.
-
-    Usage:
-    @code
-    for (Iterator<myClass> it = anyidentifier->getObjects()->begin(); it != anyidentifier->getObjects()->end(); ++it)
-    {
-        it->someFunction(...);
-        myClass* myObject = *it;
-    }
-    @endcode
-*/
-
-#ifndef _Iterator_H__
-#define _Iterator_H__
-
-#include "CorePrereqs.h"
-
-#include "Identifier.h"
-#include "ObjectListBase.h"
-
-namespace orxonox
-{
-    /**
-        @brief The Iterator allows to iterate through a given ObjectList.
-
-        Independent of the object-list's type, the objects in the list are always casted
-        to @a T using @c dynamic_cast.
-
-        @see See @ref IteratorExample "Iterator.h" for more information an example.
-    */
-    template <class T = OrxonoxClass>
-    class Iterator
-    {
-        public:
-            /**
-                @brief Constructor: Sets the element, whereon the iterator points, to zero.
-            */
-            inline Iterator()
-            {
-                this->element_ = 0;
-                this->list_ = 0;
-            }
-
-            /**
-                @brief Constructor: Sets this element to the exported element.
-                @param exp The exported element
-            */
-            inline Iterator(const ObjectListBase::Export& exp)
-            {
-                this->element_ = exp.element_;
-                this->list_ = exp.list_;
-                this->list_->registerIterator(this);
-            }
-
-            /**
-                @brief Constructor: Sets this element to the element of another Iterator.
-                @param other The other Iterator
-            */
-            inline Iterator(const Iterator<T>& other)
-            {
-                this->element_ = other.element_;
-                this->list_ = other.list_;
-                this->list_->registerIterator(this);
-            }
-
-            /**
-                @brief Constructor: Sets this element to a given element
-                @param element The element
-            */
-            template <class O>
-            inline Iterator(ObjectListElement<O>* element)
-            {
-                this->element_ = element;
-                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
-                this->list_->registerIterator(this);
-            }
-
-            /**
-                @brief Constructor: Sets this element to the element an ObjectListIterator.
-                @param other The ObjectListIterator
-            */
-            template <class O>
-            inline Iterator(const ObjectListIterator<O>& other)
-            {
-                this->element_ = other.element_;
-                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
-                this->list_->registerIterator(this);
-            }
-
-            /**
-                @brief Unregisters the Iterator from the ObjectList.
-            */
-            inline ~Iterator()
-            {
-                this->list_->unregisterIterator(this);
-            }
-
-            /**
-                @brief Assigns an exported element.
-                @param exp The exported element
-            */
-            inline Iterator<T>& operator=(const ObjectListBase::Export& exp)
-            {
-                if (this->list_)
-                    this->list_->unregisterIterator(this);
-
-                this->element_ = exp.element_;
-                this->list_ = exp.list_;
-                this->list_->registerIterator(this);
-
-                return (*this);
-            }
-
-            /**
-                @brief Assigns the element of another Iterator.
-                @param other The other Iterator
-            */
-            inline Iterator<T>& operator=(const Iterator<T>& other)
-            {
-                if (this->list_)
-                    this->list_->unregisterIterator(this);
-
-                this->element_ = other.element_;
-                this->list_ = other.list_;
-                this->list_->registerIterator(this);
-
-                return (*this);
-            }
-
-            /**
-                @brief Assigns a given element.
-                @param element The element
-            */
-            template <class O>
-            inline Iterator<T>& operator=(ObjectListElement<O>* element)
-            {
-                if (this->list_)
-                    this->list_->unregisterIterator(this);
-
-                this->element_ = element;
-                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
-                this->list_->registerIterator(this);
-
-                return (*this);
-            }
-
-            /**
-                @brief Assigns the element of an ObjectListIterator.
-                @param other The ObjectListIterator
-            */
-            template <class O>
-            inline Iterator<T>& operator=(const ObjectListIterator<O>& other)
-            {
-                if (this->list_)
-                    this->list_->unregisterIterator(this);
-
-                this->element_ = other.element_;
-                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
-                this->list_->registerIterator(this);
-
-                return (*this);
-            }
-
-            /**
-                @brief Overloading of the ++it operator: Iterator points to the next object in the list.
-                @return The Iterator itself
-            */
-            inline const Iterator<T>& operator++()
-            {
-                this->element_ = this->element_->next_;
-                return *this;
-            }
-
-            /**
-                @brief Overloading of the it++ operator: Iterator points to the next object in the list.
-                @return The Iterator itself
-            */
-            inline Iterator<T> operator++(int)
-            {
-                Iterator<T> copy = *this;
-                this->element_ = this->element_->next_;
-                return copy;
-            }
-
-            /**
-                @brief Overloading of the --it operator: Iterator points to the previous object in the list.
-                @return The Iterator itself
-            */
-            inline const Iterator<T>& operator--()
-            {
-                this->element_ = this->element_->prev_;
-                return *this;
-            }
-
-            /**
-                @brief Overloading of the it-- operator: Iterator points to the previous object in the list.
-                @return The Iterator itself
-            */
-            inline Iterator<T> operator--(int i)
-            {
-                Iterator<T> copy = *this;
-                this->element_ = this->element_->prev_;
-                return copy;
-            }
-
-            /**
-                @brief Overloading of the *it operator: returns the pointer to the object.
-                @return The object the Iterator points at
-            */
-            inline T* operator*() const
-            {
-                return orxonox_cast<T*>(this->element_->objectBase_);
-            }
-
-            /**
-                @brief Overloading of the it-> operator: returns the pointer to the object.
-                @return The object the Iterator points at
-            */
-            inline T* operator->() const
-            {
-                return orxonox_cast<T*>(this->element_->objectBase_);
-            }
-
-            /**
-                @brief Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.
-                @return True if the Iterator points to an existing object.
-            */
-            inline operator bool() const
-            {
-                return (this->element_ != 0);
-            }
-
-            /**
-                @brief Overloading of the == operator to compare with another Iterator.
-                @param compare The other Iterator
-                @return True if the iterators point to the same element
-            */
-            inline bool operator==(const Iterator<T>& compare) const
-            {
-                return (this->element_ == compare.element_);
-            }
-
-            /**
-                @brief Overloading of the != operator to compare with another Iterator.
-                @param compare The other Iterator
-                @return True if the iterators point to different elements
-            */
-            inline bool operator!=(const Iterator<T>& compare) const
-            {
-                return (this->element_ != compare.element_);
-            }
-
-            /**
-                @brief Increments the Iterator if it points at the given object.
-                @param object The object to compare with
-            */
-            inline void incrementIfEqual(OrxonoxClass* object)
-            {
-                if (this->element_ && this->element_->objectBase_ == object)
-                    this->operator++();
-            }
-
-        protected:
-            ObjectListBaseElement* element_;       //!< The element the Iterator points at
-            ObjectListBase* list_;                 //!< The list wherein the element is
-    };
-
-    typedef Iterator<OrxonoxClass> BaseIterator;
-}
-
-#endif /* _Iterator_H__ */
Index: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Loader.cc	(revision 9667)
@@ -37,10 +37,10 @@
 #include "util/StringUtils.h"
 #include "BaseObject.h"
-#include "Iterator.h"
-#include "ObjectList.h"
 #include "LuaState.h"
 #include "Namespace.h"
 #include "Resource.h"
 #include "XMLFile.h"
+#include "object/Iterator.h"
+#include "object/ObjectList.h"
 
 namespace orxonox
@@ -209,5 +209,5 @@
 
             orxout(verbose, context::loader) << "  creating root-namespace..." << endl;
-            Namespace* rootNamespace = new Namespace(0);
+            Namespace* rootNamespace = new Namespace(Context::getRootContext());
             rootNamespace->setLoaderIndentation("    ");
             rootNamespace->setFile(file);
Index: code/trunk/src/libraries/core/MetaObjectList.cc
===================================================================
--- code/trunk/src/libraries/core/MetaObjectList.cc	(revision 9576)
+++ 	(revision )
@@ -1,103 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of the MetaObjectList class.
-*/
-
-#include "MetaObjectList.h"
-
-#include "util/Output.h"
-#include "Identifier.h"
-#include "ObjectListBase.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###  MetaObjectListElement  ###
-    // ###############################
-    /**
-        @brief Destructor: Removes the ObjectListBaseElement from the ObjectListBase by linking next_ and prev_ of the ObjectListBaseElement.
-    */
-    MetaObjectListElement::~MetaObjectListElement()
-    {
-        orxout(verbose, context::object_list) << "Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << endl;
-        this->list_->notifyIterators(this->element_->objectBase_);
-
-        if (this->element_->next_)
-            this->element_->next_->prev_ = this->element_->prev_;
-        else
-            this->list_->last_ = this->element_->prev_; // If there is no next_, we deleted the last object and have to update the last_ pointer of the list
-
-        if (this->element_->prev_)
-            this->element_->prev_->next_ = this->element_->next_;
-        else
-            this->list_->first_ = this->element_->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
-
-        delete this->element_;
-    }
-
-
-    // ###############################
-    // ###     MetaObjectList      ###
-    // ###############################
-    /**
-        @brief Constructor: Sets first_ to zero.
-    */
-    MetaObjectList::MetaObjectList()
-    {
-        this->first_ = 0;
-    }
-
-    /**
-        @brief Destructor: Removes all elements from the list, causing them to remove the stored ObjectListElement from the ObjectList.
-    */
-    MetaObjectList::~MetaObjectList()
-    {
-        MetaObjectListElement* temp;
-        while (this->first_)
-        {
-            temp = this->first_->next_;
-            delete this->first_;
-            this->first_ = temp;
-        }
-    }
-
-    /**
-        @brief Adds an ObjectList and an element of that list to the MetaObjectList.
-        @param list The ObjectList wherein the element is
-        @param element The element wherein the object is
-    */
-    void MetaObjectList::add(ObjectListBase* list, ObjectListBaseElement* element)
-    {
-        MetaObjectListElement* temp = this->first_;
-        this->first_ = new MetaObjectListElement(list, element);
-        this->first_->next_ = temp;
-    }
-}
Index: code/trunk/src/libraries/core/MetaObjectList.h
===================================================================
--- code/trunk/src/libraries/core/MetaObjectList.h	(revision 9576)
+++ 	(revision )
@@ -1,86 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Object ObjectList
-    @brief Declaration of the MetaObjectList class.
-
-    The MetaObjectList is a single-linked list, containing all list-elements and their
-    lists wherein the object, owning the MetaObjectList, is registered.
-    This allows much faster deletion of objects because no iteration is needed.
-*/
-
-#ifndef _MetaObjectList_H__
-#define _MetaObjectList_H__
-
-#include "CorePrereqs.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###  MetaObjectListElement  ###
-    // ###############################
-    /// The list-element of the MetaObjectList
-    class _CoreExport MetaObjectListElement
-    {
-        public:
-            /**
-                @brief Constructor: Creates the list-element with given list and element.
-            */
-            MetaObjectListElement(ObjectListBase* list, ObjectListBaseElement* element) : next_(0), element_(element), list_(list) {}
-            ~MetaObjectListElement();
-
-            MetaObjectListElement* next_;       //!< The next Element in the list
-            ObjectListBaseElement* element_;    //!< The list element, containing the object
-            ObjectListBase* list_;              //!< The list, containing the element
-    };
-
-
-    // ###############################
-    // ###     MetaObjectList      ###
-    // ###############################
-    /**
-        @brief The MetaObjectList contains ObjectListBaseElements and their ObjectListBases.
-
-        The MetaObjectList is a single-linked list, containing all list-elements and their
-        lists wherein the object that owns the MetaObjectList is registered.
-        This allows much faster deletion of objects because no iteration is needed.
-    */
-    class _CoreExport MetaObjectList
-    {
-        public:
-            MetaObjectList();
-            ~MetaObjectList();
-            void add(ObjectListBase* list, ObjectListBaseElement* element);
-
-            MetaObjectListElement* first_;      //!< The first element in the list
-    };
-}
-
-#endif /* _MetaObjectList_H__ */
Index: code/trunk/src/libraries/core/Namespace.cc
===================================================================
--- code/trunk/src/libraries/core/Namespace.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Namespace.cc	(revision 9667)
@@ -38,7 +38,7 @@
 namespace orxonox
 {
-    CreateFactory(Namespace);
+    RegisterClass(Namespace);
 
-    Namespace::Namespace(BaseObject* creator) : BaseObject(creator),
+    Namespace::Namespace(Context* context) : BaseObject(context), Context(context),
       bAutogeneratedFileRootNamespace_(false),
       bRoot_(false),
Index: code/trunk/src/libraries/core/Namespace.h
===================================================================
--- code/trunk/src/libraries/core/Namespace.h	(revision 9576)
+++ code/trunk/src/libraries/core/Namespace.h	(revision 9667)
@@ -40,11 +40,12 @@
 #include <string>
 #include "BaseObject.h"
+#include "object/Context.h"
 
 namespace orxonox
 {
-    class Namespace : public BaseObject
+    class Namespace : public BaseObject, public Context
     {
         public:
-            Namespace(BaseObject* creator);
+            Namespace(Context* context);
             virtual ~Namespace();
 
Index: code/trunk/src/libraries/core/ObjectList.h
===================================================================
--- code/trunk/src/libraries/core/ObjectList.h	(revision 9576)
+++ 	(revision )
@@ -1,101 +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:
- *      ...
- *
- */
-
-/**
-    @defgroup ObjectList Object-lists and iterators
-    @ingroup Object
-*/
-
-/**
-    @file
-    @ingroup Object ObjectList
-    @brief Definition of the ObjectList class, a wrapper of ObjectListBase.
-
-    @ref orxonox::ObjectList "ObjectList<T>" is a wrapper of an @ref orxonox::ObjectListBase
-    "ObjectListBase" of class @a T. Use @ref orxonox::ObjectListIterator "ObjectListIterator<T>"
-    to iterate through the list.
-*/
-
-#ifndef _ObjectList_H__
-#define _ObjectList_H__
-
-#include "CorePrereqs.h"
-
-#include "Identifier.h"
-#include "ObjectListBase.h"
-#include "ObjectListIterator.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###       ObjectList        ###
-    // ###############################
-    /**
-        @brief The ObjectList contains all objects of the given class.
-
-        Wraps the ObjectListBase which contains all objects of type @a T. Use @ref ObjectListIterator
-        "ObjectListIterator<T>" or its typedef ObjectList<T>::iterator to iterate through all objects
-        in the list.
-    */
-    template <class T>
-    class ObjectList
-    {
-        public:
-            typedef ObjectListIterator<T> iterator;
-
-            /// Returns an Iterator to the first element in the list.
-            inline static ObjectListElement<T>* begin()
-            {
-                ObjectListBase* list = ClassIdentifier<T>::getIdentifier()->getObjects();
-                return static_cast<ObjectListElement<T>*>(list->begin().element_);
-            }
-
-            /// Returns an Iterator to the element after the last element in the list.
-            inline static ObjectListElement<T>* end()
-            {
-                ObjectListBase* list = ClassIdentifier<T>::getIdentifier()->getObjects();
-                return static_cast<ObjectListElement<T>*>(list->end().element_);
-            }
-
-            /// Returns an Iterator to the last element in the list.
-            inline static ObjectListElement<T>* rbegin()
-            {
-                ObjectListBase* list = ClassIdentifier<T>::getIdentifier()->getObjects();
-                return static_cast<ObjectListElement<T>*>(list->rbegin().element_);
-            }
-
-            /// Returns an Iterator to the element before the first element in the list.
-            inline static ObjectListElement<T>* rend()
-            {
-                ObjectListBase* list = ClassIdentifier<T>::getIdentifier()->getObjects();
-                return static_cast<ObjectListElement<T>*>(list->rend().element_);
-            }
-    };
-}
-
-#endif /* _ObjectList_H__ */
Index: code/trunk/src/libraries/core/ObjectListBase.cc
===================================================================
--- code/trunk/src/libraries/core/ObjectListBase.cc	(revision 9576)
+++ 	(revision )
@@ -1,103 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of the ObjectListBase class.
-*/
-
-#include "ObjectListBase.h"
-
-#include <set>
-#include "Identifier.h"
-#include "Iterator.h"
-#include "ObjectListIterator.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor: Sets default values.
-    */
-    ObjectListBase::ObjectListBase(Identifier* identifier)
-    {
-        this->identifier_ = identifier;
-        this->first_ = 0;
-        this->last_ = 0;
-    }
-
-    /**
-        @brief Destructor: Deletes all list-elements, but NOT THE OBJECTS.
-    */
-    ObjectListBase::~ObjectListBase()
-    {
-        ObjectListBaseElement* temp;
-        while (this->first_)
-        {
-            temp = this->first_->next_;
-            delete this->first_;
-            this->first_ = temp;
-        }
-    }
-
-    /**
-        @brief Increases all Iterators that currently point on the given element (because it gets removed).
-        @param object The object that gets removed
-    */
-    void ObjectListBase::notifyIterators(OrxonoxClass* object) const
-    {
-        for (std::vector<void*>::const_iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it)
-            ((Iterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
-        for (std::vector<void*>::const_iterator it = this->objectListIterators_.begin(); it != this->objectListIterators_.end(); ++it)
-            ((ObjectListIterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
-    }
-
-    /**
-        @brief Adds a new object to the end of the list.
-        @param element The element to add
-        @return The pointer to the new ObjectListBaseElement, needed by the MetaObjectList of the added object
-    */
-    ObjectListBaseElement* ObjectListBase::add(ObjectListBaseElement* element)
-    {
-        if (!this->last_)
-        {
-            // If the list is empty
-            this->last_ = element;
-            this->first_ = this->last_; // There's only one object in the list now
-        }
-        else
-        {
-            // If the list isn't empty
-            ObjectListBaseElement* temp = this->last_;
-            this->last_ = element;
-            this->last_->prev_ = temp;
-            temp->next_ = this->last_;
-        }
-
-        return this->last_;
-    }
-}
Index: code/trunk/src/libraries/core/ObjectListBase.h
===================================================================
--- code/trunk/src/libraries/core/ObjectListBase.h	(revision 9576)
+++ 	(revision )
@@ -1,157 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Object ObjectList
-    @brief Declaration of the ObjectListBase class which stores all objects of each class.
-
-    orxonox::ObjectListBase is a double-linked list, used by @ref orxonox::Identifier "Identifiers"
-    to store all objects of a given class. Newly created objects are added to the list through the
-    @c RegisterObject() macro in the constructor.
-*/
-
-#ifndef _ObjectListBase_H__
-#define _ObjectListBase_H__
-
-#include "CorePrereqs.h"
-#include <vector>
-
-namespace orxonox
-{
-    // ###############################
-    // ###  ObjectListBaseElement  ###
-    // ###############################
-    /// The list-element of the ObjectListBase
-    class _CoreExport ObjectListBaseElement
-    {
-        public:
-            /**
-                @brief Constructor: Creates the list-element with an object.
-                @param objectBase The object to store
-            */
-            ObjectListBaseElement(OrxonoxClass* objectBase) : next_(0), prev_(0), objectBase_(objectBase) {}
-
-            ObjectListBaseElement* next_;       //!< The next element in the list
-            ObjectListBaseElement* prev_;       //!< The previous element in the list
-            OrxonoxClass* objectBase_;
-    };
-
-
-    // ###############################
-    // ###    ObjectListElement    ###
-    // ###############################
-    /// The list-element that actually contains the object
-    template <class T>
-    class ObjectListElement : public ObjectListBaseElement
-    {
-        public:
-            ObjectListElement(T* object) : ObjectListBaseElement(static_cast<OrxonoxClass*>(object)), object_(object) {}
-            T* object_;              //!< The object
-    };
-
-
-    // ###############################
-    // ###     ObjectListBase      ###
-    // ###############################
-    /**
-        @brief The ObjectListBase contains all objects of a given class.
-
-        The ObjectListBase is used by Identifiers to store all objects of their class.
-        You can use Identifier::getObjects() to get the object-list from an Identifier.
-        Use @ref Iterator "Iterator<T>" to iterate through them.
-
-        Alternatively you can also use the static helper class @ref orxonox::ObjectList "ObjectList<T>"
-        to get the list of all objects of type @a T. Use @ref ObjectListIterator "ObjectListIterator<T>"
-        or @ref Iterator "Iterator<T>" to iterate through them.
-    */
-    class _CoreExport ObjectListBase
-    {
-        friend class MetaObjectListElement;
-
-        public:
-            ObjectListBase(Identifier* identifier);
-            ~ObjectListBase();
-
-            ObjectListBaseElement* add(ObjectListBaseElement* element);
-
-            /// Helper struct, used to export an element and the list to an instance of Iterator.
-            struct Export
-            {
-                Export(ObjectListBase* list, ObjectListBaseElement* element) : list_(list), element_(element) {}
-                ObjectListBase* list_;
-                ObjectListBaseElement* element_;
-            };
-
-            /// Returns a pointer to the first element in the list. Works only with Iterator.
-            inline Export begin() { return ObjectListBase::Export(this, this->first_); }
-            /// Returns a pointer to the element after the last element in the list. Works only with Iterator.
-            inline Export end() { return ObjectListBase::Export(this, 0); }
-            /// Returns a pointer to the last element in the list. Works only with Iterator.
-            inline Export rbegin() { return ObjectListBase::Export(this, this->last_); }
-            /// Returns a pointer to the element in front of the first element in the list. Works only with Iterator.
-            inline Export rend() { return ObjectListBase::Export(this, 0); }
-
-            inline void registerIterator(void* iterator) { this->iterators_.push_back(iterator); }
-            inline void unregisterIterator(void* iterator)
-            {
-                for (unsigned int i = 0; i < this->iterators_.size(); ++i)
-                {
-                    if (iterators_[i] == iterator)
-                    {
-                        iterators_.erase(iterators_.begin() + i);
-                        break;
-                    }
-                }
-            }
-            inline void registerObjectListIterator(void* iterator) { this->objectListIterators_.push_back(iterator); }
-            inline void unregisterObjectListIterator(void* iterator)
-            {
-                for (unsigned int i = 0; i < this->objectListIterators_.size(); ++i)
-                {
-                    if (objectListIterators_[i] == iterator)
-                    {
-                        objectListIterators_.erase(objectListIterators_.begin() + i);
-                        break;
-                    }
-                }
-            }
-            void notifyIterators(OrxonoxClass* object) const;
-
-            inline Identifier* getIdentifier() const { return this->identifier_; }
-
-        private:
-            Identifier* identifier_;                 //!< The Iterator owning this list
-            ObjectListBaseElement* first_;           //!< The first element in the list
-            ObjectListBaseElement* last_;            //!< The last element in the list
-            std::vector<void*> iterators_;           //!< A list of Iterators pointing on an element in this list
-            std::vector<void*> objectListIterators_; //!< A list of ObjectListIterators pointing on an element in this list
-    };
-}
-
-#endif /* _ObjectListBase_H__ */
Index: code/trunk/src/libraries/core/ObjectListIterator.h
===================================================================
--- code/trunk/src/libraries/core/ObjectListIterator.h	(revision 9576)
+++ 	(revision )
@@ -1,236 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Object ObjectList
-    @brief Definition of the ObjectListIterator class, used to iterate through object-lists.
-
-    @anchor ObjectListIteratorExample
-
-    @ref orxonox::ObjectListIterator "ObjectListIterator<T>" allows to iterate through
-    @ref orxonox::ObjectList "ObjectList<T>", containing all objects of type @a T. In contrast to
-    @ref orxonox::Iterator "Iterator<T>", this iterator is limited to the object-list of type @a T.
-    It is, however, much faster as it doesn't need a @c dynamic_cast.
-
-    Usage:
-    @code
-    for (ObjectListIterator<myClass> it = ObjectList<myClass>::begin(); it != ObjectList<myClass>::end(); ++it)
-    {
-        it->someFunction(...);
-        myClass* myObject = *it;
-    }
-    @endcode
-
-    @note @ref orxonox::ObjectList::iterator "ObjectList<T>::iterator" is identical to
-          @ref orxonox::ObjectListIterator "ObjectListIterator<T>" (it's just a typedef).
-*/
-
-#ifndef _ObjectListIterator_H__
-#define _ObjectListIterator_H__
-
-#include "CorePrereqs.h"
-#include "Identifier.h"
-#include "ObjectList.h"
-
-namespace orxonox
-{
-    /**
-        @brief ObjectListIterator<T> allows to iterate through the ObjectList of class @a T.
-
-        @see See @ref ObjectListIteratorExample "ObjectListIterator.h" for more information an example.
-    */
-    template <class T>
-    class ObjectListIterator
-    {
-        template <class I>
-        friend class Iterator;
-
-        public:
-            /**
-                @brief Constructor: Sets the element, whereon the ObjectListIterator points, to zero.
-            */
-            inline ObjectListIterator()
-            {
-                this->element_ = 0;
-                ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this);
-            }
-
-            /**
-                @brief Constructor: Sets this element to a given element.
-                @param element The element to start with
-            */
-            inline ObjectListIterator(ObjectListElement<T>* element)
-            {
-                this->element_ = element;
-                ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this);
-            }
-
-            /**
-                @brief Constructor: Sets this element to the element of another ObjectListIterator.
-                @param other The other ObjectListIterator
-            */
-            inline ObjectListIterator(const ObjectListIterator<T>& other)
-            {
-                this->element_ = other.element_;
-                ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this);
-            }
-
-            /**
-                @brief Unregisters the ObjectListIterator from the ObjectList.
-            */
-            inline ~ObjectListIterator()
-            {
-                ClassIdentifier<T>::getIdentifier()->getObjects()->unregisterObjectListIterator(this);
-            }
-
-            /**
-                @brief Assigns an ObjectListElement.
-                @param element The ObjectListElement
-            */
-            inline ObjectListIterator<T>& operator=(ObjectListElement<T>* element)
-            {
-                this->element_ = element;
-                return (*this);
-            }
-
-            /**
-                @brief Assigns the element of another ObjectListIterator.
-                @param other The other ObjectListIterator
-            */
-            inline ObjectListIterator<T>& operator=(const ObjectListIterator<T>& other)
-            {
-                this->element_ = other.element_;
-                return (*this);
-            }
-
-            /**
-                @brief Overloading of the ++it operator: ObjectListIterator points to the next object in the list.
-                @return The ObjectListIterator itself
-            */
-            inline const ObjectListIterator<T>& operator++()
-            {
-                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
-                return *this;
-            }
-
-            /**
-                @brief Overloading of the it++ operator: ObjectListIterator points to the next object in the list.
-                @return The ObjectListIterator itself
-            */
-            inline ObjectListIterator<T> operator++(int)
-            {
-                ObjectListIterator<T> copy = *this;
-                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
-                return copy;
-            }
-
-            /**
-                @brief Overloading of the --it operator: ObjectListIterator points to the previous object in the list.
-                @return The ObjectListIterator itself
-            */
-            inline const ObjectListIterator<T>& operator--()
-            {
-                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
-                return *this;
-            }
-
-            /**
-                @brief Overloading of the it-- operator: ObjectListIterator points to the previous object in the list.
-                @return The ObjectListIterator itself
-            */
-            inline ObjectListIterator<T> operator--(int i)
-            {
-                ObjectListIterator<T> copy = *this;
-                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
-                return copy;
-            }
-
-            /**
-                @brief Overloading of the *it operator: returns the pointer to the object.
-                @return The object the ObjectListIterator points at
-            */
-            inline T* operator*() const
-            {
-                return this->element_->object_;
-            }
-
-            /**
-                @brief Overloading of the it-> operator: returns the pointer to the object.
-                @return The object the ObjectListIterator points at
-            */
-            inline T* operator->() const
-            {
-                return this->element_->object_;
-            }
-
-            /**
-                @brief Overloading of the typecast-operator to bool: returns true if the ObjectListIterator points to an existing object.
-                @return True if the ObjectListIterator points to an existing object.
-            */
-            inline operator bool() const
-            {
-                return (this->element_ != 0);
-            }
-
-            /**
-                @brief Overloading of the == operator to compare with another ObjectListIterator.
-                @param compare The other ObjectListIterator
-                @return True if the ObjectListIterator point to the same element
-            */
-            inline bool operator==(const ObjectListIterator<T>& compare) const
-            {
-                return (this->element_ == compare.element_);
-            }
-
-            /**
-                @brief Overloading of the != operator to compare with another ObjectListIterator.
-                @param compare The other ObjectListIterator
-                @return True if the ObjectListIterator point to different elements
-            */
-            inline bool operator!=(const ObjectListIterator<T>& compare) const
-            {
-                return (this->element_ != compare.element_);
-            }
-
-            /**
-                @brief Increments the ObjectListIterator if it points at the given object.
-                @param object The object to compare with
-            */
-            inline void incrementIfEqual(OrxonoxClass* object)
-            {
-                if (this->element_ && this->element_->objectBase_ == object)
-                    this->operator++();
-            }
-
-        private:
-            ObjectListElement<T>* element_;        //!< The element the iterator points at
-    };
-}
-
-#endif /* _ObjectListIterator_H__ */
Index: code/trunk/src/libraries/core/OrxonoxClass.cc
===================================================================
--- code/trunk/src/libraries/core/OrxonoxClass.cc	(revision 9576)
+++ 	(revision )
@@ -1,140 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of OrxonoxClass.
-*/
-
-#include "OrxonoxClass.h"
-
-#include <cassert>
-#include "MetaObjectList.h"
-#include "Identifier.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor: Sets the default values.
-    */
-    OrxonoxClass::OrxonoxClass()
-    {
-        this->identifier_ = 0;
-        this->parents_ = 0;
-        this->metaList_ = new MetaObjectList();
-        this->referenceCount_ = 0;
-        this->requestedDestruction_ = false;
-        // Optimisation
-        this->objectPointers_.reserve(6);
-    }
-
-    /**
-        @brief Destructor: Removes the object from the object-lists, notifies all DestructionListener (for example @ref WeakPtr "weak pointers") that this object is being deleted.
-    */
-    OrxonoxClass::~OrxonoxClass()
-    {
-//        if (!this->requestedDestruction_)
-//            orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;
-
-        assert(this->referenceCount_ <= 0);
-
-        this->unregisterObject();
-
-        // parents_ exists only if isCreatingHierarchy() of the associated Identifier returned true while creating the class
-        if (this->parents_)
-            delete this->parents_;
-
-        // notify all destruction listeners
-        for (std::set<DestructionListener*>::iterator it = this->destructionListeners_.begin(); it != this->destructionListeners_.end(); )
-            (*(it++))->objectDeleted();
-    }
-
-    /**
-        @brief Deletes the object if no @ref orxonox::SmartPtr "smart pointers" point to this object. Otherwise schedules the object to be deleted as soon as possible.
-    */
-    void OrxonoxClass::destroy()
-    {
-        assert(this); // Just in case someone tries to delete a NULL pointer
-        this->requestedDestruction_ = true;
-        if (this->referenceCount_ == 0)
-        {
-            this->preDestroy();
-            if (this->referenceCount_ == 0)
-                delete this;
-        }
-    }
-
-    /**
-        @brief Removes this object from the object-lists.
-    */
-    void OrxonoxClass::unregisterObject()
-    {
-        if (this->metaList_)
-            delete this->metaList_;
-        this->metaList_ = 0;
-    }
-
-    /// Returns true if the object's class is of the given type or a derivative.
-    bool OrxonoxClass::isA(const Identifier* identifier)
-        { return this->getIdentifier()->isA(identifier); }
-    /// Returns true if the object's class is exactly of the given type.
-    bool OrxonoxClass::isExactlyA(const Identifier* identifier)
-        { return this->getIdentifier()->isExactlyA(identifier); }
-    /// Returns true if the object's class is a child of the given type.
-    bool OrxonoxClass::isChildOf(const Identifier* identifier)
-        { return this->getIdentifier()->isChildOf(identifier); }
-    /// Returns true if the object's class is a direct child of the given type.
-    bool OrxonoxClass::isDirectChildOf(const Identifier* identifier)
-        { return this->getIdentifier()->isDirectChildOf(identifier); }
-    /// Returns true if the object's class is a parent of the given type.
-    bool OrxonoxClass::isParentOf(const Identifier* identifier)
-        { return this->getIdentifier()->isParentOf(identifier); }
-    /// Returns true if the object's class is a direct parent of the given type.
-    bool OrxonoxClass::isDirectParentOf(const Identifier* identifier)
-        { return this->getIdentifier()->isDirectParentOf(identifier); }
-
-
-    /// Returns true if the object's class is of the given type or a derivative.
-    bool OrxonoxClass::isA(const OrxonoxClass* object)
-        { return this->getIdentifier()->isA(object->getIdentifier()); }
-    /// Returns true if the object's class is exactly of the given type.
-    bool OrxonoxClass::isExactlyA(const OrxonoxClass* object)
-        { return this->getIdentifier()->isExactlyA(object->getIdentifier()); }
-    /// Returns true if the object's class is a child of the given type.
-    bool OrxonoxClass::isChildOf(const OrxonoxClass* object)
-        { return this->getIdentifier()->isChildOf(object->getIdentifier()); }
-    /// Returns true if the object's class is a direct child of the given type.
-    bool OrxonoxClass::isDirectChildOf(const OrxonoxClass* object)
-        { return this->getIdentifier()->isDirectChildOf(object->getIdentifier()); }
-    /// Returns true if the object's class is a parent of the given type.
-    bool OrxonoxClass::isParentOf(const OrxonoxClass* object)
-        { return this->getIdentifier()->isParentOf(object->getIdentifier()); }
-    /// Returns true if the object's class is a direct child of the given type.
-    bool OrxonoxClass::isDirectParentOf(const OrxonoxClass* object)
-        { return this->getIdentifier()->isDirectParentOf(object->getIdentifier()); }
-}
Index: code/trunk/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/trunk/src/libraries/core/OrxonoxClass.h	(revision 9576)
+++ 	(revision )
@@ -1,199 +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:
- *      ...
- *
- */
-
-/**
-    @defgroup OrxonoxClass OrxonoxClass
-    @ingroup Class
-*/
-
-/**
-    @file
-    @ingroup Class OrxonoxClass
-    @brief Declaration of OrxonoxClass, the base class of all objects and interfaces in Orxonox.
-
-    All objects and interfaces of the game-logic (not the engine) are derived from OrxonoxClass.
-    It stores the Identifier and the MetaObjectList and has all needed functions to create and use the class-hierarchy.
-*/
-
-#ifndef _OrxonoxClass_H__
-#define _OrxonoxClass_H__
-
-#include "CorePrereqs.h"
-
-#include <set>
-#include <vector>
-#include "Super.h"
-
-namespace orxonox
-{
-    /**
-        @brief The class all objects and interfaces of the game-logic (not the engine) are derived from.
-
-        The BaseObject and Interfaces are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass.
-        OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the
-        MetaObjectList, as well as to provide an interface for SmartPtr and WeakPtr.
-    */
-    class _CoreExport OrxonoxClass
-    {
-        template <class T>
-        friend class ClassIdentifier;
-
-        template <class T>
-        friend class SmartPtr;
-
-        friend class DestructionListener;
-
-        public:
-            OrxonoxClass();
-            virtual ~OrxonoxClass();
-
-            void destroy();
-            void unregisterObject();
-
-            /// Function to collect the SetConfigValue-macro calls.
-            void setConfigValues() {};
-
-            /// Returns the Identifier of the object.
-            inline Identifier* getIdentifier() const { return this->identifier_; }
-
-            bool isA(const Identifier* identifier);
-            bool isExactlyA(const Identifier* identifier);
-            bool isChildOf(const Identifier* identifier);
-            bool isDirectChildOf(const Identifier* identifier);
-            bool isParentOf(const Identifier* identifier);
-            bool isDirectParentOf(const Identifier* identifier);
-
-            /// Returns true if the object's class is of the given type or a derivative.
-            template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
-                { return this->isA(*identifier); }
-            /// Returns true if the object's class is exactly of the given type.
-            template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
-                { return this->isExactlyA(*identifier); }
-            /// Returns true if the object's class is a child of the given type.
-            template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
-                { return this->isChildOf(*identifier); }
-            /// Returns true if the object's class is a direct child of the given type.
-            template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
-                { return this->isDirectChildOf(*identifier); }
-            /// Returns true if the object's class is a parent of the given type.
-            template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
-                { return this->isParentOf(*identifier); }
-            /// Returns true if the object's class is a direct parent of the given type.
-            template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
-                { return this->isDirectParentOf(*identifier); }
-
-            bool isA(const OrxonoxClass* object);
-            bool isExactlyA(const OrxonoxClass* object);
-            bool isChildOf(const OrxonoxClass* object);
-            bool isDirectChildOf(const OrxonoxClass* object);
-            bool isParentOf(const OrxonoxClass* object);
-            bool isDirectParentOf(const OrxonoxClass* object);
-
-            /// Returns the number of @ref orxonox::SmartPtr "smart pointers" that point to this object.
-            inline unsigned int getReferenceCount() const
-                { return this->referenceCount_; }
-
-            /**
-            @brief
-                Returns a valid pointer of any derived type that is
-                registered in the class hierarchy.
-            @return
-                Returns NULL if the no pointer was found.
-            */
-            ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID)
-            {
-                for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
-                {
-                    if (this->objectPointers_[i].first == classID)
-                        return this->objectPointers_[i].second;
-                }
-                return NULL;
-            }
-
-            /// Version of getDerivedPointer with template
-            template <class T> ORX_FORCEINLINE T* getDerivedPointer(unsigned int classID)
-            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
-            /// Const version of getDerivedPointer with template
-            template <class T> ORX_FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
-            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
-
-        protected:
-            /// This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction.
-            virtual void preDestroy() {}
-
-        private:
-            /// Increments the reference counter (for smart pointers).
-            inline void incrementReferenceCount()
-                { ++this->referenceCount_; }
-            /// Decrements the reference counter (for smart pointers).
-            inline void decrementReferenceCount()
-            {
-                --this->referenceCount_;
-                if (this->referenceCount_ == 0 && this->requestedDestruction_)
-                    this->destroy();
-            }
-
-            /// Register a destruction listener (for example a weak pointer which points to this object).
-            inline void registerDestructionListener(DestructionListener* pointer)
-                { this->destructionListeners_.insert(pointer); }
-            /// Unegister a destruction listener (for example a weak pointer which pointed to this object before).
-            inline void unregisterDestructionListener(DestructionListener* pointer)
-                { this->destructionListeners_.erase(pointer); }
-
-            Identifier* identifier_;                                //!< The Identifier of the object
-            std::set<const Identifier*>* parents_;                  //!< List of all parents of the object
-            MetaObjectList* metaList_;                              //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
-            int referenceCount_;                                    //!< Counts the references from smart pointers to this object
-            bool requestedDestruction_;                             //!< Becomes true after someone called delete on this object
-            std::set<DestructionListener*> destructionListeners_;   //!< All destruction listeners (for example weak pointers which point to this object and like to get notified if it dies)
-
-            /// 'Fast map' that holds this-pointers of all derived types
-            std::vector<std::pair<unsigned int, void*> > objectPointers_;
-    };
-
-    /**
-        @brief This listener is used to inform weak pointers if an object of type OrxonoxClass gets destroyed.
-    */
-    class _CoreExport DestructionListener
-    {
-        friend class OrxonoxClass;
-
-        protected:
-            virtual ~DestructionListener() {}
-
-            inline void registerAsDestructionListener(OrxonoxClass* object)
-                { if (object) { object->registerDestructionListener(this); } }
-            inline void unregisterAsDestructionListener(OrxonoxClass* object)
-                { if (object) { object->unregisterDestructionListener(this); } }
-
-            virtual void objectDeleted() = 0;
-    };
-
-}
-
-#endif /* _OrxonoxClass_H__ */
Index: code/trunk/src/libraries/core/PathConfig.cc
===================================================================
--- code/trunk/src/libraries/core/PathConfig.cc	(revision 9576)
+++ code/trunk/src/libraries/core/PathConfig.cc	(revision 9667)
@@ -53,5 +53,5 @@
 #include "util/Output.h"
 #include "util/Exception.h"
-#include "CommandLineParser.h"
+#include "config/CommandLineParser.h"
 
 // Differentiate Boost Filesystem v2 and v3
Index: code/trunk/src/libraries/core/SmartPtr.h
===================================================================
--- code/trunk/src/libraries/core/SmartPtr.h	(revision 9576)
+++ 	(revision )
@@ -1,317 +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:
- *      ...
- *
- */
-
-// Inspired by boost::intrusive_ptr by Peter Dimov
-
-/**
-    @defgroup SmartPtr SmartPtr<T> and WeakPtr<T>
-    @ingroup Object
-*/
-
-/**
-    @file
-    @ingroup Object SmartPtr
-    @brief Definition of SmartPtr<T>, wraps a pointer to an object and keeps it alive.
-
-    @anchor SmartPtrExample
-
-    orxonox::SmartPtr is an implementation of a smart pointer - it wraps a pointer to an
-    object  and keeps this object alive until no SmartPtr points to this object anymore.
-    In contrast to orxonox::SharedPtr, SmartPtr works only with classes that are derived
-    from orxonox::OrxonoxClass, because it's an intrusive implementation, meaning the
-    reference counter is stored in the object itself.
-
-    It's possible to use normal pointers and smart pointers to an object simultaneously.
-    You don't have to use SmartPtr all the time, you can create a SmartPtr for an object
-    at any time and also convert it back to a normal pointer if you like. This is possible
-    because the reference counter is stored in the object itself and not in SmartPtr (in
-    contrast to SharedPtr).
-
-    @b Important: If you want to delete an object, you must not use @c delete @c object but
-    rather @c object->destroy(). This function will check if there are smart pointers
-    pointing to the object. If yes, the object will be kept alive until all smart pointes
-    are destroyed. If no, the object is deleted instantly.
-
-    If all smart pointers that point to an object are destroyed, but you never called
-    @c object->destroy() before, the object will not be deleted! All a SmartPtr will do
-    is to really just keep an object alive, but it will not delete it automatically
-    unless you tried to destroy it before.
-
-    Example:
-    @code
-    class MyClass                                           // class declaration
-    {
-        public:
-            void setObject(OtherClass* object)              // passes a normal pointer which will be stored in a SmartPtr
-                { this->object_ = object; }
-
-            OtherClass* getObject() const                   // converts the SmartPtr to a normal pointer and returns it
-                { return this->object_; }
-
-        private:
-            SmartPtr<OtherClass> object_;                   // a pointer to an instance of OtherClass is stored in a SmartPtr
-    };
-    @endcode
-    In this example we assume that OtherClass is a child of OrxonoxClass. We don't care
-    about the inheritance of MyClass though.
-
-    Now we create an instance of MyClass and assign a pointer to an instance of OtherClass:
-    @code
-    MyClass* myclass = new MyClass();                       // create an instance of MyClass
-    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
-    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
-
-    object->destroy();                                      // we try to destroy object, but there's still a SmartPtr pointing at it.
-
-    # object still exists at this point (because a SmartPtr points at it)
-
-    delete myclass;                                         // now we delete myclass, which also destroys the SmartPtr
-
-    # object doesn't exist anymore (because the SmartPtr is now destroyed)
-    @endcode
-
-    Now we look at the same example, but we first delete myclass, then destroy object:
-    @code
-    MyClass* myclass = new MyClass();                       // create an instance of MyClass
-    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
-    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
-
-    delete myclass;                                         // we delete myclass, which also destroys the SmartPtr
-
-    # object still exists at this point (because destroy() was not called yet)
-
-    object->destroy();                                      // now we try to destroy object, which works instantly
-
-    # object doesn't exist anymore (because we just destroyed it)
-    @endcode
-
-    Note that in any case @c object->destroy() has to be called to delete the object.
-    However if a SmartPtr points at it, the destruction is delayed until all SmartPtr
-    are destroyed.
-*/
-
-#ifndef _SmartPtr_H__
-#define _SmartPtr_H__
-
-#include "CorePrereqs.h"
-
-#include <cassert>
-
-#include "Identifier.h"
-#include "OrxonoxClass.h"
-#include "WeakPtr.h"
-
-namespace orxonox
-{
-    /**
-        @brief A smart pointer which wraps a pointer to an object and keeps this object alive as long as the smart pointer exists.
-
-        @see See @ref SmartPtrExample "this description" for more information and an example.
-    */
-    template <class T>
-    class SmartPtr
-    {
-        public:
-            /// Constructor: Initializes the smart pointer with a null pointer.
-            inline SmartPtr() : pointer_(0), base_(0)
-            {
-            }
-
-            /// Constructor: Used to explicitly initialize the smart pointer with a null pointer
-            inline SmartPtr(int) : pointer_(0), base_(0)
-            {
-            }
-
-            /// Constructor: Initializes the smart pointer with a pointer to an object. @param pointer The pointer @param bAddRef If true, the reference counter is increased. Don't set this to false unless you know exactly what you're doing! (for example to avoid circular references if the @c this pointer of the possessing object is stored)
-            inline SmartPtr(T* pointer, bool bAddRef = true) : pointer_(pointer), base_(pointer)
-            {
-                if (this->base_ && bAddRef)
-                    this->base_->incrementReferenceCount();
-            }
-
-            /// Copy-constructor
-            inline SmartPtr(const SmartPtr& other) : pointer_(other.pointer_), base_(other.base_)
-            {
-                if (this->base_)
-                    this->base_->incrementReferenceCount();
-            }
-
-            /// Copy-constructor for smart pointers to objects of another class.
-            template <class O>
-            inline SmartPtr(const SmartPtr<O>& other) : pointer_(other.get()), base_(other.base_)
-            {
-                if (this->base_)
-                    this->base_->incrementReferenceCount();
-            }
-
-            /// Constructor: Initializes the smart pointer with the pointer that is stored in a WeakPtr.
-            template <class O>
-            inline SmartPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase())
-            {
-                if (this->base_)
-                    this->base_->incrementReferenceCount();
-            }
-
-            /// Destructor: Decrements the reference counter.
-            inline ~SmartPtr()
-            {
-                if (this->base_)
-                    this->base_->decrementReferenceCount();
-            }
-
-            /// Used to assign a null pointer.
-            inline SmartPtr& operator=(int)
-            {
-                SmartPtr(0).swap(*this);
-                return *this;
-            }
-
-            /// Assigns a new pointer.
-            inline SmartPtr& operator=(T* pointer)
-            {
-                SmartPtr(pointer).swap(*this);
-                return *this;
-            }
-
-            /// Assigns the wrapped pointer of another SmartPtr.
-            inline SmartPtr& operator=(const SmartPtr& other)
-            {
-                SmartPtr(other).swap(*this);
-                return *this;
-            }
-
-            /// Assigns the wrapped pointer of a SmartPtr of another class
-            template <class O>
-            inline SmartPtr& operator=(const SmartPtr<O>& other)
-            {
-                SmartPtr(other).swap(*this);
-                return *this;
-            }
-
-            /// Assigns the wrapped pointer of a WeakPtr.
-            template <class O>
-            inline SmartPtr& operator=(const WeakPtr<O>& other)
-            {
-                SmartPtr(other).swap(*this);
-                return *this;
-            }
-
-            /// Returns the wrapped pointer as @c T*
-            inline T* get() const
-            {
-                return this->pointer_;
-            }
-
-            /// Returns the wrapped pointer as @c OrxonoxClass*
-            inline OrxonoxClass* getBase() const
-            {
-                return this->base_;
-            }
-
-            /// Implicitly converts the SmartPtr to a pointer of type @c T*
-            inline operator T*() const
-            {
-                return this->pointer_;
-            }
-
-            /// Overloaded operator, returns a pointer to the stored object.
-            inline T* operator->() const
-            {
-                assert(this->pointer_ != 0);
-                return this->pointer_;
-            }
-
-            /// Overloaded operator, returns a reference to the stored object.
-            inline T& operator*() const
-            {
-                assert(this->pointer_ != 0);
-                return *this->pointer_;
-            }
-
-            /// Returns true if the wrapped pointer is NULL.
-            inline bool operator!() const
-            {
-                return (this->pointer_ == 0);
-            }
-
-            /// Swaps the contents of two smart pointers.
-            inline void swap(SmartPtr& other)
-            {
-                {
-                    T* temp = this->pointer_;
-                    this->pointer_ = other.pointer_;
-                    other.pointer_ = temp;
-                }
-                {
-                    OrxonoxClass* temp = this->base_;
-                    this->base_ = other.base_;
-                    other.base_ = temp;
-                }
-            }
-
-            /// Resets the smart pointer (equivalent to assigning a NULL pointer).
-            inline void reset()
-            {
-                SmartPtr().swap(*this);
-            }
-
-        private:
-            T* pointer_;            ///< The wrapped pointer to an object of type @a T
-            OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)
-    };
-
-    /// Swaps the contents of two smart pointers.
-    template <class T>
-    void swap(SmartPtr<T>& a, SmartPtr<T>& b)
-    {
-        a.swap(b);
-    }
-
-    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
-    template <class T, class U>
-    SmartPtr<T> static_pointer_cast(const SmartPtr<U>& p)
-    {
-        return static_cast<T*>(p.get());
-    }
-
-    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
-    template <class T, class U>
-    SmartPtr<T> const_pointer_cast(const SmartPtr<U>& p)
-    {
-        return const_cast<T*>(p.get());
-    }
-
-    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
-    template <class T, class U>
-    SmartPtr<T> dynamic_pointer_cast(const SmartPtr<U>& p)
-    {
-        return orxonox_cast<T*>(p.get());
-    }
-}
-
-#endif /* _SmartPtr_H__ */
Index: code/trunk/src/libraries/core/SubclassIdentifier.h
===================================================================
--- code/trunk/src/libraries/core/SubclassIdentifier.h	(revision 9576)
+++ 	(revision )
@@ -1,204 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Class Identifier
-    @brief Definition of SubclassIdentifier.
-
-    @anchor SubclassIdentifierExample
-
-    SubclassIdentifier is a separated class, acting like an Identifier, but has a given class.
-    You can only assign Identifiers of exactly the given class or of a derivative to a SubclassIdentifier.
-
-    Example:
-
-    You can assign an Identifier either through the constructor or by using the assignment @c operator=:
-    @code
-    SubclassIdentifier<BaseClass> identifier = Class(SubClass);
-    @endcode
-
-    The @c operator-> is overloaded an returns the assigned Identifier. That way you can just call
-    functions of the assigned Identifier by using @c ->function():
-    @code
-    SubclassIdentifier<BaseClass> identifier = Class(SubClass);
-    identifier->getName();      // returns "SubClass"
-    @endcode
-
-    There are two possibilities to create an object out of a SubclassIdentifier: Either you just use
-    the @c fabricate() function of the assigned Identifier through the overloaded @c operator->, which
-    returns a @c BaseObject* pointer, or you use the function of SubclassIdentifier, this time by using
-    @c operator., which returns a @c BaseClass* pointer (@a BaseClass is the baseclass specified by the
-    template argument):
-    @code
-    identifier->fabricate();    // calls Identifier::fabricate(), creates a SubClass, returns a BaseObject* pointer
-
-    identifier.fabricate();     // calls SubclassIdentifier::fabricate(), creates a SubClass, returns a BaseClass* pointer
-    @endcode
-*/
-
-#ifndef _SubclassIdentifier_H__
-#define _SubclassIdentifier_H__
-
-#include "CorePrereqs.h"
-
-#include <cstdlib>
-#include "util/Output.h"
-#include "Identifier.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###   SubclassIdentifier    ###
-    // ###############################
-    /**
-        @brief The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
-
-        You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>.
-        If you assign something else, the program prints an error.
-
-        Because we know the base-type, a @c dynamic_cast is done, which makes it easier to create a new object.
-
-        @see See @ref SubclassIdentifierExample "SubclassIdentifier.h" for some examples.
-    */
-    template <class T>
-    class SubclassIdentifier
-    {
-        public:
-            /// Constructor: Automaticaly assigns the Identifier of the given class.
-            SubclassIdentifier()
-            {
-                this->identifier_ = ClassIdentifier<T>::getIdentifier();
-            }
-
-            /// Constructor: Assigns the given Identifier.
-            SubclassIdentifier(Identifier* identifier)
-            {
-                this->operator=(identifier);
-            }
-
-            /// Copyconstructor: Assigns the identifier of another SubclassIdentifier.
-            template <class O>
-            SubclassIdentifier(const SubclassIdentifier<O>& identifier)
-            {
-                this->operator=(identifier.getIdentifier());
-            }
-
-            /**
-                @brief Overloading of the = operator: assigns the identifier and checks its type.
-                @param identifier The Identifier to assign
-                @return The SubclassIdentifier itself
-            */
-            SubclassIdentifier<T>& operator=(Identifier* identifier)
-            {
-                if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
-                {
-                    orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
-                    if (identifier)
-                    {
-                        orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
-                        orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
-                    }
-                    else
-                    {
-                        orxout(internal_error) << "Can't assign NULL identifier" << endl;
-                    }
-                }
-                else
-                {
-                    this->identifier_ = identifier;
-                }
-                return *this;
-            }
-
-            /// Overloading of the = operator: assigns the identifier of another SubclassIdentifier.
-            template <class O>
-            SubclassIdentifier<T>& operator=(const SubclassIdentifier<O>& identifier)
-            {
-                return this->operator=(identifier.getIdentifier());
-            }
-
-            /// Overloading of the * operator: returns the assigned identifier.
-            inline Identifier* operator*() const
-            {
-                return this->identifier_;
-            }
-
-            /// Overloading of the -> operator: returns the assigned identifier.
-            inline Identifier* operator->() const
-            {
-                return this->identifier_;
-            }
-
-            /// Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.
-            inline operator Identifier*() const
-            {
-                return this->identifier_;
-            }
-
-            /// Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
-            T* fabricate(BaseObject* creator) const
-            {
-                BaseObject* newObject = this->identifier_->fabricate(creator);
-
-                // Check if the creation was successful
-                if (newObject)
-                {
-                    return orxonox_cast<T*>(newObject);
-                }
-                else
-                {
-                    // Something went terribly wrong
-                    if (this->identifier_)
-                    {
-                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
-                        orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
-                        orxout(user_error) << "Couldn't fabricate a new Object." << endl;
-                    }
-                    else
-                    {
-                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
-                        orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
-                    }
-
-                    orxout(user_error) << "Aborting..." << endl;
-                    abort();
-                    return 0;
-                }
-            }
-
-            /// Returns the assigned identifier.
-            inline Identifier* getIdentifier() const
-                { return this->identifier_; }
-
-        private:
-            Identifier* identifier_;            //!< The assigned identifier
-    };
-}
-
-#endif /* _SubclassIdentifier_H__ */
Index: code/trunk/src/libraries/core/Super.h
===================================================================
--- code/trunk/src/libraries/core/Super.h	(revision 9576)
+++ 	(revision )
@@ -1,634 +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:
- *      ...
- *
- */
-
-/**
-    @defgroup Super Super
-    @ingroup Class
-*/
-
-/**
-    @file
-    @ingroup Class Super
-    @brief Definition of all super-function related macros, used to call functions of the base class.
-
-    This file defines all macros needed to add a new "super-function". If you add
-    a super-function, you can call <tt>SUPER(myclass, functionname, arguments)</tt>
-    inside your code and the function of the parent-class gets called. This is comparable
-    to <tt>super.functionname(arguments)</tt> in Java or other languages.
-
-    This works only with virtual functions that return nothing (@c void) and belong to
-    classes that have an @ref orxonox::Identifier "Identifier". Arguments however are
-    supported, there's no limitation for their number and type, except that the type has
-    to be known in Super.h.
-
-    To add a new super-function, you have to process 4 steps:
-
-    -# Add a new @c SUPER macro <br />
-       This allows you to call the super-function in your code. <br />
-       Location: This file (Super.h), marked with "--> HERE <--" comments (1/3)
-    -# Call the @c SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2 macros. <br />
-       This defines some global classes and templates, needed to create and call the super-functions. <br />
-       Location: This file (Super.h), marked with "--> HERE <--" comments (2/3)
-    -# Call the @c SUPER_INTRUSIVE_DECLARATION macro. <br />
-       This will be included into the declaration of @c ClassIdentifier<T>. <br />
-       Location: This file (Super.h), marked with "--> HERE <--" comments (3/3)
-    -# Call the @c SUPER_FUNCTION macro. <br />
-       This defines a partially specialized template that will decide if a class is "super" to another class.
-       If the check returns true, a @c SuperFunctionCaller gets created, which will be used by the @c SUPER macro.
-       You have to add this into the header-file of the baseclass of the super-function (the class that first
-       implements the function), below the class declaration. You can't call it directly in this file, because
-       otherwise you had to include the headerfile right here, which would cause some ugly back-dependencies,
-       include loops and slower compilation. <br />
-       Dont forget to include Super.h in the header-file. <br />
-       Location: The header-file of the baseclass (Baseclass.h), below the class declaration
-*/
-
-#ifndef _Super_H__
-#define _Super_H__
-
-#include "CorePrereqs.h"
-#include "util/Output.h"
-
-///////////////////////
-// Macro definitions //
-///////////////////////
-
-//// Common macros ////
-
-    /**
-        @brief Declares a new super-function by creating a specialized template. Add this below the class declaration of the baseclass.
-        @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
-        @param baseclass The baseclass of the super-function (~the root)
-        @param functionname The name of the super-function
-        @param purevirtualbase "true" if the function is pure virtual in the baseclass, "false" if the function is implemented (without "")
-    */
-    #define SUPER_FUNCTION(functionnumber, baseclass, functionname, purevirtualbase) \
-        template <class T, int templatehack2> \
-        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \
-        { \
-            static void superCheck() \
-            { \
-                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \
-                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \
-            } \
-            \
-            static void apply(void*) {} \
-            \
-            static void apply(baseclass*) \
-            { \
-                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it) \
-                { \
-                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
-                    { \
-                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0; \
-                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
-                    } \
-                    \
-                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
-                    { \
-                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
-                    } \
-                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
-                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
-                } \
-            } \
-        }; \
-        \
-        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase(functionnumber, baseclass)
-
-    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND0(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
-    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND1(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass)
-    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
-    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) \
-        template <int templatehack2> \
-        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
-        { \
-            static void superCheck() \
-            { \
-                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
-            } \
-        };
-
-
-    /*
-    //// Comments about the macro ////
-
-        // Partially specialized template (templatehack is now specialized too).
-        //
-        // This ensures the compiler takes THIS template if the header-file of the super-function
-        // is included. In any other case, the compiler just uses the fallback template which is
-        // defined in this file.
-        template <class T, templatehack2>
-        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2>
-        {
-            static void superCheck()
-            {
-                // This call to the apply-function is the whole check. By calling the function with
-                // a T* pointer, the right function get's called.
-                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0));
-
-                // Go go the superCheck for of next super-function (functionnumber + 1)
-                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck();
-            }
-
-            // This function gets called if T is not a child of the baseclass.
-            // The function does nothing.
-            static void apply(void* temp) {}
-
-            // This function gets called if T is a child of the baseclass and can therefore be converted.
-            // The function adds a SuperFunctionCaller to the Identifier of all subclasses of T.
-            static void apply(baseclass* temp)
-            {
-                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
-
-                // Iterate through all children
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
-                {
-                    // Check if the caller is a fallback-caller
-                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
-                    {
-                        // Delete the fallback caller an prepare to get a real caller
-                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_;
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0;
-                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false;
-                    }
-
-                    // Check if there's not already a caller
-                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
-                    {
-                        // Add the SuperFunctionCaller
-                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
-                    }
-
-                    // If there is already a caller, but for another parent, print a warning
-                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
-                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
-                }
-            }
-        };
-        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase
-
-
-        // The following piece of code is only added if purevirtualbase = true
-
-        // Explicit specialization of the Condition template for the baseclass to avoid
-        // errors if the function is pure virtual in the baseclass.
-        template <int templatehack2> \
-        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
-        { \
-            // The superCheck function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
-            static void superCheck() \
-            { \
-                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
-            } \
-        };
-    */
-
-    /// SUPER-macro: Calls Parent::functionname(...) where Parent is the direct parent of @a classname
-    #ifdef ORXONOX_COMPILER_MSVC
-        #define SUPER(classname, functionname, ...) \
-            __super::functionname(__VA_ARGS__)
-    #else
-        #define SUPER(classname, functionname, ...) \
-            SUPER_##functionname(classname, functionname, __VA_ARGS__)
-    #endif
-
-    // helper macro: for functions without arguments
-    #define SUPER_NOARGS(classname, functionname) \
-        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this)
-
-    // helper macro: for functions with arguments
-    #define SUPER_ARGS(classname, functionname, ...) \
-        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this, __VA_ARGS__)
-
-
-//// Function-specific macros ////
-
-    /*
-        Add a macro for each super-function
-
-        Example (no arguments):
-        #define SUPER_myfunction(classname, functionname, ...) \
-            SUPER_NOARGS(classname, functionname)
-
-        Example (with arguments):
-        #define SUPER_myfunction(classname, functionname, ...) \
-            SUPER_ARGS(classname, functionname, __VA_ARGS__)
-    */
-
-    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-    #define SUPER_XMLPort(classname, functionname, ...) \
-        SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
-    #define SUPER_tick(classname, functionname, ...) \
-        SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
-    #define SUPER_changedActivity(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedVisibility(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_XMLEventPort(classname, functionname, ...) \
-        SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
-    #define SUPER_changedScale(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedOwner(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedOverlayGroup(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedName(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedGametype(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedUsed(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedCarrier(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    #define SUPER_changedPickedUp(classname, functionname, ...) \
-        SUPER_NOARGS(classname, functionname)
-
-    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-
-
-namespace orxonox
-{
-    /////////////////////////////////////////////////////////////////////////////////////////////////////
-    // This code gets included by Identifier.h and every other header file that needs a super-function //
-    /////////////////////////////////////////////////////////////////////////////////////////////////////
-
-    //// Common code ////
-
-        // Base templates
-        /**
-            @brief Creates the SuperFunctionCaller if T is a child of the super-functions baseclass.
-        */
-        template <int functionnumber, class T, int templatehack1, int templatehack2>
-        struct SuperFunctionCondition
-        {
-            static void superCheck() {}
-        };
-
-        /**
-            @brief Initializes the SuperFunctionCaller-pointer with zero.
-        */
-        template <int functionnumber, class T>
-        struct SuperFunctionInitialization
-        {
-            static void initialize(ClassIdentifier<T>*) {}
-        };
-
-        /**
-            @brief Deletes the SuperFunctionCaller.
-        */
-        template <int functionnumber, class T>
-        struct SuperFunctionDestruction
-        {
-            static void destroy(ClassIdentifier<T>*) {}
-        };
-
-
-    //// Function-specific code ////
-
-        /**
-            @brief Creates the needed objects and templates to call a super-function.
-            @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
-            @param functionname The name of the super-function
-            @param hasarguments "false" if the function doesn't take any arguments, "true" if it does (without "")
-            @param ... Variadic: If the function takes arguments, add them here with type and name. Example: int myvalue, float myothervalue
-        */
-        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments, ...) \
-            template <class T, int templatehack1, int templatehack2> \
-            struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \
-            { \
-                static void superCheck() \
-                { \
-                    SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck(); \
-                } \
-            }; \
-            \
-            class _CoreExport SuperFunctionCaller_##functionname \
-            { \
-                public: \
-                    virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0; \
-                    virtual ~SuperFunctionCaller_##functionname () {} \
-                    virtual Identifier* getParentIdentifier() const = 0; \
-            }; \
-            \
-            template <class T> \
-            class SuperFunctionClassCaller_purevirtualfallback_##functionname : public SuperFunctionCaller_##functionname \
-            { \
-                public: \
-                    inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
-                    { \
-                    } \
-                    \
-                    Identifier* getParentIdentifier() const \
-                    { \
-                        return ClassIdentifier<T>::getIdentifier(); \
-                    } \
-            }; \
-            \
-            template <class T> \
-            struct SuperFunctionInitialization<functionnumber, T> \
-            { \
-                static void initialize(ClassIdentifier<T>* identifier) \
-                { \
-                    identifier->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_purevirtualfallback_##functionname <T>; \
-                    identifier->bSuperFunctionCaller_##functionname##_isFallback_ = true; \
-                    SuperFunctionInitialization<functionnumber + 1, T>::initialize(identifier); \
-                } \
-            }; \
-            \
-            template <class T> \
-            struct SuperFunctionDestruction<functionnumber, T> \
-            { \
-                static void destroy(ClassIdentifier<T>* identifier) \
-                { \
-                    if (identifier->superFunctionCaller_##functionname##_) \
-                        delete identifier->superFunctionCaller_##functionname##_; \
-                    SuperFunctionDestruction<functionnumber + 1, T>::destroy(identifier); \
-                } \
-            }; \
-            \
-            template <class T> \
-            class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname \
-            { \
-                public: \
-                    inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
-                    { \
-                        (orxonox_cast<T*>(object))->T:: functionname
-
-        /*
-            JUST ADD THE FUNCTION ARGUMENTS BETWEEN BOTH MACROS, ENCLOSED BY BRACKETS
-            EXAMPLE:
-
-              SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, myfunction, true, int myvalue, float myothervalue) <-- !!! DONT ADD A SEMICOLON HERE !!!
-                (myvalue, myothervalue)
-              SUPER_FUNCTION_GLOBAL_DECLARATION_PART2
-        */
-
-        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART2 \
-                                                        ; \
-                    } \
-                    \
-                    Identifier* getParentIdentifier() const \
-                    { \
-                        return ClassIdentifier<T>::getIdentifier(); \
-                    } \
-            };
-
-        #define SUPER_CALL_ARGUMENTSfalse(...) OrxonoxClass* object
-        #define SUPER_CALL_ARGUMENTS0(...)     OrxonoxClass* object
-        #define SUPER_CALL_ARGUMENTStrue(...) OrxonoxClass* object, __VA_ARGS__
-        #define SUPER_CALL_ARGUMENTS1(...)    OrxonoxClass* object, __VA_ARGS__
-
-
-    /*
-    //// COMMENTS ABOUT THE MACRO ////
-
-        // Partially specialized template (templatehack not yet specialized, this
-        // will be done by the real condition in the header-file of the super-function)
-        // Only used as fallback
-        template <class T, int templatehack1, int templatehack2>
-        struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2>
-        {
-            // If this function gets called, the header-file of the super function is not
-            // included, so this fallback template (templatehack not specialized) is used
-            static void superCheck()
-            {
-                // Calls the condition-check of the next super-function (functionnumber + 1)
-                SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck();
-            }
-        };
-
-        // Baseclass of the super-function caller. The real call will be done by a
-        // templatized subclass through the virtual () operator.
-        class _CoreExport SuperFunctionCaller_##functionname
-        {
-            public:
-                virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0;
-                virtual ~SuperFunctionCaller_##functionname () {}
-                virtual Identifier* getParentIdentifier() const = 0;
-        };
-
-        // Fallback if the base is pure virtual
-        template <class T>
-        class SuperFunctionClassCaller_purevirtualfallback_##functionname : public SuperFunctionCaller_##functionname
-        {
-            public:
-                // Fallback does nothing
-                inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
-                {
-                }
-
-                Identifier* getParentIdentifier() const
-                {
-                    return ClassIdentifier<T>::getIdentifier();
-                }
-        };
-
-        // Initializes the SuperFunctionCaller-pointer with a fallback caller in case the base function is pure virtual
-        template <class T>
-        struct SuperFunctionInitialization<functionnumber, T>
-        {
-            static void initialize(ClassIdentifier<T>* identifier)
-            {
-                identifier->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_purevirtualfallback_##functionname <T>;
-                identifier->bSuperFunctionCaller_##functionname##_isFallback_ = true;
-
-                // Calls the initialization of the next super-function (functionnumber + 1)
-                SuperFunctionInitialization<functionnumber + 1, T>::initialize(identifier);
-            }
-        };
-
-        // Deletes the SuperFunctionCaller.
-        template <class T>
-        struct SuperFunctionDestruction<functionnumber, T>
-        {
-            static void destroy(ClassIdentifier<T>* identifier)
-            {
-                if (identifier->superFunctionCaller_##functionname##_)
-                    delete identifier->superFunctionCaller_##functionname##_;
-
-                // Calls the destruction of the next super-function (functionnumber + 1)
-                SuperFunctionDestruction<functionnumber + 1, T>::destroy(identifier);
-            }
-        };
-
-        // The real super-function caller: Calls T::functionname()
-        // T should be the parent, but this will be done by the spezialized condition template
-        template <class T>
-        class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname
-        {
-            public:
-                // @brief Calls the function.
-                // @param object The object to call the function on
-                // @param ... The arguments of the function
-                inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
-                {
-                    (orxonox_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
-                }
-
-                Identifier* getParentIdentifier() const
-                {
-                    return ClassIdentifier<T>::getIdentifier();
-                }
-        }
-    */
-
-
-    //// Execute the code for each super-function ////
-
-        // (2/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, XMLPort, true, Element& xmlelement, XMLPort::Mode mode)
-            (xmlelement, mode)
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(1, tick, true, float dt)
-            (dt)
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(2, changedActivity, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(3, changedVisibility, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(4, XMLEventPort, true, Element& xmlelement, XMLPort::Mode mode)
-            (xmlelement, mode)
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(5, changedScale, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(6, changedOwner, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(7, changedOverlayGroup, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(8, changedName, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedGametype, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedUsed, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        // (2/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-
-}
-
-#else /* _Super_H__ */
-  #ifdef SUPER_INTRUSIVE_DECLARATION_INCLUDE
-
-//////////////////////////////////////////////////////////////////////////
-// This code gets included within the declaration of ClassIdentifier<T> //
-//////////////////////////////////////////////////////////////////////////
-
-//// Common code ////
-
-    private:
-
-        template <int functionnumber, class TT, int templatehack1, int templatehack2>
-        friend struct SuperFunctionCondition;
-
-        // Creates the super-function-callers by calling the first SuperFunctionCondition check
-        // This get's called within the initialization of an Identifier
-        virtual void createSuperFunctionCaller() const
-        {
-            SuperFunctionCondition<0, T, 0, 0>::superCheck();
-        }
-
-
-//// Function-specific code ////
-
-    public:
-        /**
-            @brief Adds a pointer to the SuperFunctionCaller as a member of ClassIdentifier.
-            @param functionname The name of the super-function
-        */
-        #ifndef SUPER_INTRUSIVE_DECLARATION
-          #define SUPER_INTRUSIVE_DECLARATION(functionname) \
-            SuperFunctionCaller_##functionname * superFunctionCaller_##functionname##_; \
-            bool bSuperFunctionCaller_##functionname##_isFallback_
-        #endif
-
-
-//// Execute the code for each super-function ////
-
-    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-    SUPER_INTRUSIVE_DECLARATION(XMLPort);
-    SUPER_INTRUSIVE_DECLARATION(tick);
-    SUPER_INTRUSIVE_DECLARATION(changedActivity);
-    SUPER_INTRUSIVE_DECLARATION(changedVisibility);
-    SUPER_INTRUSIVE_DECLARATION(XMLEventPort);
-    SUPER_INTRUSIVE_DECLARATION(changedScale);
-    SUPER_INTRUSIVE_DECLARATION(changedOwner);
-    SUPER_INTRUSIVE_DECLARATION(changedOverlayGroup);
-    SUPER_INTRUSIVE_DECLARATION(changedName);
-    SUPER_INTRUSIVE_DECLARATION(changedGametype);
-    SUPER_INTRUSIVE_DECLARATION(changedUsed);
-    SUPER_INTRUSIVE_DECLARATION(changedCarrier);
-    SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
-    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
-
-
-    #undef SUPER_INTRUSIVE_DECLARATION_INCLUDE
-  #endif /* SUPER_INTRUSIVE_DECLARATION_INCLUDE */
-#endif /* _Super_H__ */
Index: code/trunk/src/libraries/core/Template.cc
===================================================================
--- code/trunk/src/libraries/core/Template.cc	(revision 9576)
+++ code/trunk/src/libraries/core/Template.cc	(revision 9667)
@@ -38,7 +38,7 @@
 namespace orxonox
 {
-    CreateFactory(Template);
+    RegisterClass(Template);
 
-    Template::Template(BaseObject* creator) : BaseObject(creator)
+    Template::Template(Context* context) : BaseObject(context)
     {
         this->xmlelement_ = new TiXmlElement("");
@@ -150,5 +150,5 @@
 
         // check if the template is applied on an object of the right type
-        Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());
+        Identifier* identifier = ClassByString(this->getXMLElement().Value());
         if (!object->getIdentifier()->isA(identifier))
             orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl;
Index: code/trunk/src/libraries/core/Template.h
===================================================================
--- code/trunk/src/libraries/core/Template.h	(revision 9576)
+++ code/trunk/src/libraries/core/Template.h	(revision 9667)
@@ -51,5 +51,5 @@
     {
         public:
-            Template(BaseObject* creator);
+            Template(Context* context);
             virtual ~Template();
 
Index: code/trunk/src/libraries/core/ViewportEventListener.cc
===================================================================
--- code/trunk/src/libraries/core/ViewportEventListener.cc	(revision 9576)
+++ code/trunk/src/libraries/core/ViewportEventListener.cc	(revision 9667)
@@ -32,7 +32,9 @@
 namespace orxonox
 {
+    RegisterAbstractClass(ViewportEventListener).inheritsFrom(Class(Listable));
+
     ViewportEventListener::ViewportEventListener()
     {
-        RegisterRootObject(ViewportEventListener);
+        RegisterObject(ViewportEventListener);
     }
 }
Index: code/trunk/src/libraries/core/ViewportEventListener.h
===================================================================
--- code/trunk/src/libraries/core/ViewportEventListener.h	(revision 9576)
+++ code/trunk/src/libraries/core/ViewportEventListener.h	(revision 9667)
@@ -33,9 +33,9 @@
 
 #include "util/OgreForwardRefs.h"
-#include "OrxonoxClass.h"
+#include "object/Listable.h"
 
 namespace orxonox
 {
-    class _CoreExport ViewportEventListener : virtual public OrxonoxClass
+    class _CoreExport ViewportEventListener : virtual public Listable
     {
         public:
Index: code/trunk/src/libraries/core/WeakPtr.h
===================================================================
--- code/trunk/src/libraries/core/WeakPtr.h	(revision 9576)
+++ 	(revision )
@@ -1,286 +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:
- *      ...
- *
- */
-
-// Inspired by boost::intrusive_ptr by Peter Dimov
-
-/**
-    @file
-    @ingroup Object SmartPtr
-    @brief Definition of WeakPtr<T>, wraps a pointer to an object.
-
-    @anchor WeakPtrExample
-
-    A WeakPtr wraps a pointer to an object. If the object gets deleted, the WeakPtr becomes
-    NULL. This can be used to store pointers to objects without knowing when they will be
-    destroyed.
-
-    WeakPtr works only with objects that are derived from orxonox::OrxonoxClass, because
-    WeakPtr is intrusive and registers itself in the stored object, to get a notification if
-    the object is being deleted.
-
-    Example:
-    @code
-    MyClass* object = new MyClass();                    // create an instance of MyClass
-
-    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
-
-    if (pointer)                                        // checks if pointer is not NULL (which is true)
-        pointer->someFunction();                        // calls MyClass::someFunction()
-
-    object->destroy();                                  // calls destroy() which deletes the object
-
-    if (pointer)                                        // checks if pointer is not NULL (which is now false)
-        pointer->someFunction();                        // this will not be executed
-    @endcode
-    In this example we assumed that MyClass is derived of OrxonoxClass (otherwise it couldn't
-    be used with a WeakPtr).
-
-    A callback can be registerd with the WeakPtr that will be called if the object gets deleted.
-    @code
-    void myCallback()                                   // definition of the callback function
-    {
-        orxout() << "Object destroyed" << endl;
-    }
-
-    MyClass* object = new MyClass();                    // create an instance of MyClass
-
-    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
-
-    pointer.setCallback(createFunctor(&myCallback));    // defines a callback
-
-    object->destroy();                                  // calls destroy() which deletes the object. prints "Object destroyed" to the console
-    @endcode
-*/
-
-#ifndef _WeakPtr_H__
-#define _WeakPtr_H__
-
-#include "CorePrereqs.h"
-
-#include <cassert>
-#include "Identifier.h"
-#include "OrxonoxClass.h"
-#include "command/Functor.h"
-
-namespace orxonox
-{
-    /**
-        @brief WeakPtr wraps a pointer to an object, which becomes NULL if the object is deleted.
-
-        @see See @ref WeakPtrExample "this description" for more information and an example.
-    */
-    template <class T>
-    class WeakPtr : public DestructionListener
-    {
-        public:
-            /// Constructor: Initializes the weak pointer with a null pointer.
-            inline WeakPtr() : pointer_(0), base_(0), callback_(0)
-            {
-            }
-
-            /// Constructor: Used to explicitly initialize the weak pointer with a null pointer
-            inline WeakPtr(int) : pointer_(0), base_(0), callback_(0)
-            {
-            }
-
-            /// Constructor: Initializes the weak pointer with a pointer to an object.
-            inline WeakPtr(T* pointer) : pointer_(pointer), base_(pointer), callback_(0)
-            {
-                this->registerAsDestructionListener(this->base_);
-            }
-
-            /// Copy-constructor
-            inline WeakPtr(const WeakPtr& other) : pointer_(other.pointer_), base_(other.base_), callback_(0)
-            {
-                this->registerAsDestructionListener(this->base_);
-            }
-
-            /// Copy-constructor for weak pointers to objects of another class.
-            template <class O>
-            inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.base_), callback_(0)
-            {
-                this->registerAsDestructionListener(this->base_);
-            }
-
-            /// Destructor
-            inline virtual ~WeakPtr()
-            {
-                this->unregisterAsDestructionListener(this->base_);
-            }
-
-            /// Used to assign a null pointer.
-            inline WeakPtr& operator=(int)
-            {
-                WeakPtr(0).swap(*this);
-                return *this;
-            }
-
-            /// Assigns a new pointer.
-            inline WeakPtr& operator=(T* pointer)
-            {
-                WeakPtr(pointer).swap(*this);
-                return *this;
-            }
-
-            /// Assigns the wrapped pointer of another WeakPtr.
-            inline WeakPtr& operator=(const WeakPtr& other)
-            {
-                WeakPtr(other).swap(*this);
-                return *this;
-            }
-
-            /// Assigns the wrapped pointer of a WeakPtr of another class
-            template <class O>
-            inline WeakPtr& operator=(const WeakPtr<O>& other)
-            {
-                WeakPtr(other).swap(*this);
-                return *this;
-            }
-
-            /// Returns the wrapped pointer as @c T*
-            inline T* get() const
-            {
-                return this->pointer_;
-            }
-
-            /// Returns the wrapped pointer as @c OrxonoxClass*
-            inline OrxonoxClass* getBase() const
-            {
-                return this->base_;
-            }
-
-            /// Implicitly converts the WeakPtr to a pointer of type @c T*
-            inline operator T*() const
-            {
-                return this->pointer_;
-            }
-
-            /// Overloaded operator, returns a pointer to the stored object.
-            inline T* operator->() const
-            {
-                assert(this->pointer_ != 0);
-                return this->pointer_;
-            }
-
-            /// Overloaded operator, returns a reference to the stored object.
-            inline T& operator*() const
-            {
-                assert(this->pointer_ != 0);
-                return *this->pointer_;
-            }
-
-            /// Returns true if the wrapped pointer is NULL.
-            inline bool operator!() const
-            {
-                return (this->pointer_ == 0);
-            }
-
-            /// Swaps the contents of two weak pointers.
-            inline void swap(WeakPtr& other)
-            {
-                this->unregisterAsDestructionListener(this->base_);
-                other.unregisterAsDestructionListener(other.base_);
-
-                {
-                    T* temp = this->pointer_;
-                    this->pointer_ = other.pointer_;
-                    other.pointer_ = temp;
-                }
-                {
-                    OrxonoxClass* temp = this->base_;
-                    this->base_ = other.base_;
-                    other.base_ = temp;
-                }
-
-                this->registerAsDestructionListener(this->base_);
-                other.registerAsDestructionListener(other.base_);
-            }
-
-            /// Resets the weak pointer (equivalent to assigning a NULL pointer).
-            inline void reset()
-            {
-                WeakPtr().swap(*this);
-            }
-
-            /// Registers a callback that will be executed if the stored object is destroyed.
-            inline void setCallback(const FunctorPtr& callback)
-            {
-                this->callback_ = callback;
-            }
-
-            /// Returns the registered callback.
-            inline const FunctorPtr& getCallback() const
-            {
-                return this->callback_;
-            }
-
-        private:
-            /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted. Resets the wrapped pointer and executes the callback.
-            inline void objectDeleted()
-            {
-                this->base_ = 0;
-                this->pointer_ = 0;
-                if (this->callback_)
-                    (*this->callback_)();
-            }
-
-            T* pointer_;            ///< The wrapped pointer to an object of type @a T
-            OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, WeakPtr couln't be used with forward declarations)
-            FunctorPtr callback_;   ///< This callback will be executed if the stored object is deleted
-    };
-
-    /// Swaps the contents of two weak pointers.
-    template <class T>
-    void swap(WeakPtr<T>& a, WeakPtr<T>& b)
-    {
-        a.swap(b);
-    }
-
-    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
-    template <class T, class U>
-    WeakPtr<T> static_pointer_cast(const WeakPtr<U>& p)
-    {
-        return static_cast<T*>(p.get());
-    }
-
-    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
-    template <class T, class U>
-    WeakPtr<T> const_pointer_cast(const WeakPtr<U>& p)
-    {
-        return const_cast<T*>(p.get());
-    }
-
-    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
-    template <class T, class U>
-    WeakPtr<T> dynamic_pointer_cast(const WeakPtr<U>& p)
-    {
-        return orxonox_cast<T*>(p.get());
-    }
-}
-
-#endif /* _WeakPtr_H__ */
Index: code/trunk/src/libraries/core/WindowEventListener.cc
===================================================================
--- code/trunk/src/libraries/core/WindowEventListener.cc	(revision 9576)
+++ code/trunk/src/libraries/core/WindowEventListener.cc	(revision 9667)
@@ -35,7 +35,9 @@
     unsigned int WindowEventListener::windowHeight_s = 0;
 
+    RegisterAbstractClass(WindowEventListener).inheritsFrom(Class(Listable));
+
     WindowEventListener::WindowEventListener()
     {
-        RegisterRootObject(WindowEventListener);
+        RegisterObject(WindowEventListener);
     }
 
Index: code/trunk/src/libraries/core/WindowEventListener.h
===================================================================
--- code/trunk/src/libraries/core/WindowEventListener.h	(revision 9576)
+++ code/trunk/src/libraries/core/WindowEventListener.h	(revision 9667)
@@ -36,10 +36,10 @@
 
 #include "CorePrereqs.h"
-#include "OrxonoxClass.h"
+#include "object/Listable.h"
 
 namespace orxonox
 {
     //! Interface for receiving window events like resize, moved and focusChanged
-    class _CoreExport WindowEventListener : virtual public OrxonoxClass
+    class _CoreExport WindowEventListener : virtual public Listable
     {
         friend class OgreWindowEventListener;
Index: code/trunk/src/libraries/core/XMLNameListener.cc
===================================================================
--- code/trunk/src/libraries/core/XMLNameListener.cc	(revision 9576)
+++ code/trunk/src/libraries/core/XMLNameListener.cc	(revision 9667)
@@ -32,7 +32,9 @@
 namespace orxonox
 {
+    RegisterAbstractClass(XMLNameListener).inheritsFrom(Class(Listable));
+
     XMLNameListener::XMLNameListener()
     {
-        RegisterRootObject(XMLNameListener);
+        RegisterObject(XMLNameListener);
     }
 }
Index: code/trunk/src/libraries/core/XMLNameListener.h
===================================================================
--- code/trunk/src/libraries/core/XMLNameListener.h	(revision 9576)
+++ code/trunk/src/libraries/core/XMLNameListener.h	(revision 9667)
@@ -36,9 +36,9 @@
 
 #include "CorePrereqs.h"
-#include "OrxonoxClass.h"
+#include "object/Listable.h"
 
 namespace orxonox
 {
-    class _CoreExport XMLNameListener : virtual public OrxonoxClass
+    class _CoreExport XMLNameListener : virtual public Listable
     {
         public:
Index: code/trunk/src/libraries/core/XMLPort.cc
===================================================================
--- code/trunk/src/libraries/core/XMLPort.cc	(revision 9576)
+++ code/trunk/src/libraries/core/XMLPort.cc	(revision 9667)
@@ -29,4 +29,5 @@
 #include "XMLPort.h"
 
+#include "CoreIncludes.h"
 #include "Loader.h"
 #include "Namespace.h"
@@ -59,5 +60,5 @@
                 for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
                 {
-                    Identifier* identifier = Identifier::getIdentifierByString(child->Value());
+                    Identifier* identifier = ClassByString(child->Value());
                     if (!identifier)
                     {
@@ -89,5 +90,5 @@
                         orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
 
-                        BaseObject* newObject = identifier->fabricate(object);
+                        BaseObject* newObject = orxonox_cast<BaseObject*>(identifier->fabricate(object->getContext()));
                         newObject->setLoaderIndentation(object->getLoaderIndentation() + "  ");
 
Index: code/trunk/src/libraries/core/XMLPort.h
===================================================================
--- code/trunk/src/libraries/core/XMLPort.h	(revision 9576)
+++ code/trunk/src/libraries/core/XMLPort.h	(revision 9667)
@@ -58,5 +58,5 @@
 #include "util/OrxAssert.h"
 #include "util/StringUtils.h"
-#include "Identifier.h"
+#include "class/Identifier.h"
 #include "BaseObject.h"
 #include "command/Executor.h"
Index: code/trunk/src/libraries/core/class/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/class/CMakeLists.txt	(revision 9667)
+++ code/trunk/src/libraries/core/class/CMakeLists.txt	(revision 9667)
@@ -0,0 +1,7 @@
+ADD_SOURCE_FILES(CORE_SRC_FILES
+  Identifiable.cc
+  Identifier.cc
+  IdentifierManager.cc
+  OrxonoxClass.cc
+  OrxonoxInterface.cc
+)
Index: code/trunk/src/libraries/core/class/Identifiable.cc
===================================================================
--- code/trunk/src/libraries/core/class/Identifiable.cc	(revision 9667)
+++ code/trunk/src/libraries/core/class/Identifiable.cc	(revision 9667)
@@ -0,0 +1,94 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of Identifiable.
+*/
+
+#include "Identifiable.h"
+
+#include <cassert>
+#include "core/CoreIncludes.h"
+#include "core/object/Context.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(Identifiable);
+
+    /**
+        @brief Constructor: Sets the default values.
+    */
+    Identifiable::Identifiable()
+    {
+        this->identifier_ = 0;
+        this->objectPointers_.reserve(6); // Optimisation
+
+        RegisterObject(Identifiable);
+    }
+
+    /// Returns true if the object's class is of the given type or a derivative.
+    bool Identifiable::isA(const Identifier* identifier)
+        { return this->getIdentifier()->isA(identifier); }
+    /// Returns true if the object's class is exactly of the given type.
+    bool Identifiable::isExactlyA(const Identifier* identifier)
+        { return this->getIdentifier()->isExactlyA(identifier); }
+    /// Returns true if the object's class is a child of the given type.
+    bool Identifiable::isChildOf(const Identifier* identifier)
+        { return this->getIdentifier()->isChildOf(identifier); }
+    /// Returns true if the object's class is a direct child of the given type.
+    bool Identifiable::isDirectChildOf(const Identifier* identifier)
+        { return this->getIdentifier()->isDirectChildOf(identifier); }
+    /// Returns true if the object's class is a parent of the given type.
+    bool Identifiable::isParentOf(const Identifier* identifier)
+        { return this->getIdentifier()->isParentOf(identifier); }
+    /// Returns true if the object's class is a direct parent of the given type.
+    bool Identifiable::isDirectParentOf(const Identifier* identifier)
+        { return this->getIdentifier()->isDirectParentOf(identifier); }
+
+
+    /// Returns true if the object's class is of the given type or a derivative.
+    bool Identifiable::isA(const Identifiable* object)
+        { return this->getIdentifier()->isA(object->getIdentifier()); }
+    /// Returns true if the object's class is exactly of the given type.
+    bool Identifiable::isExactlyA(const Identifiable* object)
+        { return this->getIdentifier()->isExactlyA(object->getIdentifier()); }
+    /// Returns true if the object's class is a child of the given type.
+    bool Identifiable::isChildOf(const Identifiable* object)
+        { return this->getIdentifier()->isChildOf(object->getIdentifier()); }
+    /// Returns true if the object's class is a direct child of the given type.
+    bool Identifiable::isDirectChildOf(const Identifiable* object)
+        { return this->getIdentifier()->isDirectChildOf(object->getIdentifier()); }
+    /// Returns true if the object's class is a parent of the given type.
+    bool Identifiable::isParentOf(const Identifiable* object)
+        { return this->getIdentifier()->isParentOf(object->getIdentifier()); }
+    /// Returns true if the object's class is a direct child of the given type.
+    bool Identifiable::isDirectParentOf(const Identifiable* object)
+        { return this->getIdentifier()->isDirectParentOf(object->getIdentifier()); }
+}
Index: code/trunk/src/libraries/core/class/Identifiable.h
===================================================================
--- code/trunk/src/libraries/core/class/Identifiable.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/Identifiable.h	(revision 9667)
@@ -0,0 +1,127 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Class Identifier
+    @brief Declaration of Identifiable, the base of all classes that should own an Identifier.
+
+    It stores the Identifier and has all needed functions to create and use the class-hierarchy.
+*/
+
+#ifndef _Identifiable_H__
+#define _Identifiable_H__
+
+#include "core/CorePrereqs.h"
+
+#include <set>
+#include <vector>
+
+namespace orxonox
+{
+    /**
+        @brief Identifiable is needed to create the class-hierarchy at startup and to store the Identifier.
+    */
+    class _CoreExport Identifiable
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        public:
+            Identifiable();
+            virtual ~Identifiable() {}
+
+            /// Returns the Identifier of the object.
+            inline Identifier* getIdentifier() const { return this->identifier_; }
+
+            bool isA(const Identifier* identifier);
+            bool isExactlyA(const Identifier* identifier);
+            bool isChildOf(const Identifier* identifier);
+            bool isDirectChildOf(const Identifier* identifier);
+            bool isParentOf(const Identifier* identifier);
+            bool isDirectParentOf(const Identifier* identifier);
+
+            /// Returns true if the object's class is of the given type or a derivative.
+            template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
+                { return this->isA(*identifier); }
+            /// Returns true if the object's class is exactly of the given type.
+            template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
+                { return this->isExactlyA(*identifier); }
+            /// Returns true if the object's class is a child of the given type.
+            template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
+                { return this->isChildOf(*identifier); }
+            /// Returns true if the object's class is a direct child of the given type.
+            template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
+                { return this->isDirectChildOf(*identifier); }
+            /// Returns true if the object's class is a parent of the given type.
+            template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
+                { return this->isParentOf(*identifier); }
+            /// Returns true if the object's class is a direct parent of the given type.
+            template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
+                { return this->isDirectParentOf(*identifier); }
+
+            bool isA(const Identifiable* object);
+            bool isExactlyA(const Identifiable* object);
+            bool isChildOf(const Identifiable* object);
+            bool isDirectChildOf(const Identifiable* object);
+            bool isParentOf(const Identifiable* object);
+            bool isDirectParentOf(const Identifiable* object);
+
+            /**
+            @brief
+                Returns a valid pointer of any derived type that is
+                registered in the class hierarchy.
+            @return
+                Returns NULL if the no pointer was found.
+            */
+            ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID)
+            {
+                for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
+                {
+                    if (this->objectPointers_[i].first == classID)
+                        return this->objectPointers_[i].second;
+                }
+                return NULL;
+            }
+
+            /// Version of getDerivedPointer with template
+            template <class T> ORX_FORCEINLINE T* getDerivedPointer(unsigned int classID)
+            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
+            /// Const version of getDerivedPointer with template
+            template <class T> ORX_FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
+            {   return const_cast<Identifiable*>(this)->getDerivedPointer<T>(classID);   }
+
+        private:
+            Identifier* identifier_;               //!< The Identifier of the object
+
+            /// 'Fast map' that holds this-pointers of all derived types
+            std::vector<std::pair<unsigned int, void*> > objectPointers_;
+    };
+}
+
+#endif /* _Identifiable_H__ */
Index: code/trunk/src/libraries/core/class/Identifier.cc
===================================================================
--- code/trunk/src/libraries/core/class/Identifier.cc	(revision 9667)
+++ code/trunk/src/libraries/core/class/Identifier.cc	(revision 9667)
@@ -0,0 +1,394 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the Identifier class.
+*/
+
+#include "Identifier.h"
+
+#include <ostream>
+
+#include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueContainer.h"
+#include "core/XMLPort.h"
+#include "core/object/ClassFactory.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    /**
+        @brief Constructor: No factory, no object created, new ObjectList and a unique networkID.
+    */
+    Identifier::Identifier()
+        : classID_(IdentifierManager::getInstance().getUniqueClassId())
+    {
+        this->factory_ = 0;
+        this->bInitialized_ = false;
+        this->bLoadable_ = false;
+
+        this->bHasConfigValues_ = false;
+
+        // Default network ID is the class ID
+        this->networkID_ = this->classID_;
+    }
+
+    /**
+        @brief Destructor: Deletes the list containing the children.
+    */
+    Identifier::~Identifier()
+    {
+        if (this->factory_)
+            delete this->factory_;
+
+        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
+            delete (it->second);
+        for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it)
+            delete (it->second);
+        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
+            delete (it->second);
+    }
+
+    /**
+        @brief Sets the name of the class.
+    */
+    void Identifier::setName(const std::string& name)
+    {
+        if (name != this->name_)
+        {
+            this->name_ = name;
+            IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
+        }
+    }
+
+    void Identifier::setFactory(Factory* factory)
+    {
+        if (this->factory_)
+            delete this->factory_;
+
+        this->factory_ = factory;
+    }
+
+
+    /**
+        @brief Creates an object of the type the Identifier belongs to.
+        @return The new object
+    */
+    Identifiable* Identifier::fabricate(Context* context)
+    {
+        if (this->factory_)
+        {
+            return this->factory_->fabricate(context);
+        }
+        else
+        {
+            orxout(user_error) << "An error occurred in Identifier.cc:" << endl;
+            orxout(user_error) << "Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << endl;
+            orxout(user_error) << "Aborting..." << endl;
+            abort();
+            return 0;
+        }
+    }
+
+    /**
+        @brief Sets the network ID to a new value and changes the entry in the ID-Identifier-map.
+    */
+    void Identifier::setNetworkID(uint32_t id)
+    {
+        this->networkID_ = id;
+        IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
+    }
+
+    /**
+     * @brief Used to define the direct parents of an Identifier of an abstract class.
+     */
+    Identifier& Identifier::inheritsFrom(Identifier* directParent)
+    {
+        if (this->parents_.empty())
+            this->directParents_.insert(directParent);
+        else
+            orxout(internal_error) << "Trying to add " << directParent->getName() << " as a direct parent of " << this->getName() << " after the latter was already initialized" << endl;
+
+        return *this;
+    }
+
+    /**
+     * @brief Initializes the parents of this Identifier while creating the class hierarchy.
+     * @param identifiers All identifiers that were used to create an instance of this class (including this identifier itself)
+     */
+    void Identifier::initializeParents(const std::set<const Identifier*>& identifiers)
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::initializeParents() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        for (std::set<const Identifier*>::const_iterator it = identifiers.begin(); it != identifiers.end(); ++it)
+            if (*it != this)
+                this->parents_.insert(*it);
+    }
+
+    /**
+     * @brief Initializes the direct parents of this Identifier while creating the class hierarchy. This is only intended for abstract classes.
+     */
+    void Identifier::initializeDirectParentsOfAbstractClass()
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::initializeDirectParentsOfAbstractClass() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        // only Identifiable is allowed to have no parents (even tough it's currently not abstract)
+        if (this->directParents_.empty() && !this->isExactlyA(Class(Identifiable)))
+        {
+            orxout(internal_error) << "Identifier " << this->getName() << " / " << this->getTypeidName() << " is marked as abstract but has no direct parents defined" << endl;
+            orxout(internal_error) << "  If this class is not abstract, use RegisterClass(ThisClass);" << endl;
+            orxout(internal_error) << "  If this class is abstract, use RegisterAbstractClass(ThisClass).inheritsFrom(Class(BaseClass));" << endl;
+        }
+    }
+
+    /**
+     * @brief Finishes the initialization of this Identifier after creating the class hierarchy by wiring the (direct) parent/child references correctly.
+     */
+    void Identifier::finishInitialization()
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::finishInitialization() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        if (this->isInitialized())
+            return;
+
+        // if no direct parents were defined, initialize them with the set of all parents
+        if (this->directParents_.empty())
+            this->directParents_ = this->parents_;
+
+        // initialize all parents before continuing to initialize this identifier
+        for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+        {
+            Identifier* directParent = const_cast<Identifier*>(*it);
+            directParent->finishInitialization(); // initialize parent
+            this->parents_.insert(directParent);  // direct parent is also a parent
+            this->parents_.insert(directParent->parents_.begin(), directParent->parents_.end()); // parents of direct parent are also parents
+        }
+
+        // parents of parents are no direct parents of this identifier
+        for (std::set<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
+            for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
+                this->directParents_.erase(*it_parent_parent);
+
+        // tell all parents that this identifier is a child
+        for (std::set<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
+            const_cast<Identifier*>(*it)->children_.insert(this);
+
+        // tell all direct parents that this identifier is a direct child
+        for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+        {
+            const_cast<Identifier*>(*it)->directChildren_.insert(this);
+
+            // Create the super-function dependencies
+            (*it)->createSuperFunctionCaller();
+        }
+
+        this->bInitialized_ = true;
+    }
+
+    /**
+        @brief Returns true, if the Identifier is at least of the given type.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isA(const Identifier* identifier) const
+    {
+        return (identifier == this || (this->parents_.find(identifier) != this->parents_.end()));
+    }
+
+    /**
+        @brief Returns true, if the Identifier is exactly of the given type.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isExactlyA(const Identifier* identifier) const
+    {
+        return (identifier == this);
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a child of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isChildOf(const Identifier* identifier) const
+    {
+        return (this->parents_.find(identifier) != this->parents_.end());
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a direct child of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isDirectChildOf(const Identifier* identifier) const
+    {
+        return (this->directParents_.find(identifier) != this->directParents_.end());
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a parent of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isParentOf(const Identifier* identifier) const
+    {
+        return (this->children_.find(identifier) != this->children_.end());
+    }
+
+    /**
+        @brief Returns true, if the assigned identifier is a direct parent of the given identifier.
+        @param identifier The identifier to compare with
+    */
+    bool Identifier::isDirectParentOf(const Identifier* identifier) const
+    {
+        return (this->directChildren_.find(identifier) != this->directChildren_.end());
+    }
+
+    /**
+        @brief Adds the ConfigValueContainer of a variable, given by the string of its name.
+        @param varname The name of the variablee
+        @param container The container
+    */
+    void Identifier::addConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = this->configValues_.find(varname);
+        if (it != this->configValues_.end())
+        {
+            orxout(internal_warning) << "Overwriting config-value with name " << varname << " in class " << this->getName() << '.' << endl;
+            delete (it->second);
+        }
+
+        this->bHasConfigValues_ = true;
+        this->configValues_[varname] = container;
+    }
+
+    /**
+        @brief Returns the ConfigValueContainer of a variable, given by the string of its name.
+        @param varname The name of the variable
+        @return The ConfigValueContainer
+    */
+    ConfigValueContainer* Identifier::getConfigValueContainer(const std::string& varname)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_.find(varname);
+        if (it != configValues_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @return The container
+    */
+    XMLPortParamContainer* Identifier::getXMLPortParamContainer(const std::string& paramname)
+    {
+        std::map<std::string, XMLPortParamContainer*>::const_iterator it = this->xmlportParamContainers_.find(paramname);
+        if (it != this->xmlportParamContainers_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @param container The container
+    */
+    void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
+    {
+        std::map<std::string, XMLPortParamContainer*>::const_iterator it = this->xmlportParamContainers_.find(paramname);
+        if (it != this->xmlportParamContainers_.end())
+        {
+            orxout(internal_warning) << "Overwriting XMLPortParamContainer in class " << this->getName() << '.' << endl;
+            delete (it->second);
+        }
+
+        this->xmlportParamContainers_[paramname] = container;
+    }
+
+    /**
+        @brief Returns a XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @return The container
+    */
+    XMLPortObjectContainer* Identifier::getXMLPortObjectContainer(const std::string& sectionname)
+    {
+        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = this->xmlportObjectContainers_.find(sectionname);
+        if (it != this->xmlportObjectContainers_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @param container The container
+    */
+    void Identifier::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
+    {
+        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = this->xmlportObjectContainers_.find(sectionname);
+        if (it != this->xmlportObjectContainers_.end())
+        {
+            orxout(internal_warning) << "Overwriting XMLPortObjectContainer in class " << this->getName() << '.' << endl;
+            delete (it->second);
+        }
+
+        this->xmlportObjectContainers_[sectionname] = container;
+    }
+
+    /**
+        @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
+        @param out The outstream
+        @param list The list (or set) of Identifiers
+        @return The outstream
+    */
+    std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list)
+    {
+        for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
+        {
+            if (it != list.begin())
+                out << ' ';
+            out << (*it)->getName();
+        }
+
+        return out;
+    }
+}
Index: code/trunk/src/libraries/core/class/Identifier.h
===================================================================
--- code/trunk/src/libraries/core/class/Identifier.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/Identifier.h	(revision 9667)
@@ -0,0 +1,480 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup Identifier Identifier
+    @ingroup Class
+*/
+
+/**
+    @file
+    @ingroup Class Identifier
+    @brief Declaration of Identifier, definition of ClassIdentifier<T>; used to identify the class of an object.
+
+    @anchor IdentifierExample
+
+    An Identifier "identifies" the class of an object. It contains different information about
+    the class: Its name and ID, a list of all instances of this class, a factory to create new
+    instances of this class, and more.
+
+    It also contains information about the inheritance of this class: It stores a list of the
+    Identifiers of all parent-classes as well as a list of all child-classes. These relationships
+    can be tested using functions like @c isA(), @c isChildOf(), @c isParentOf(), and more.
+
+    Every Identifier is in fact a ClassIdentifier<T> (where T is the class that is identified
+    by the Identifier), Identifier is just the common base-class.
+
+    Example:
+    @code
+    MyClass* object = new MyClass();                                            // create an instance of MyClass
+
+    object->getIdentifier()->getName();                                         // returns "MyClass"
+
+    Identifiable* other = object->getIdentifier()->fabricate(0);                // fabricates a new instance of MyClass
+
+
+    // test the class hierarchy
+    object->getIdentifier()->isA(Class(MyClass));                               // returns true
+    object->isA(Class(MyClass));                                                // returns true (short version)
+
+    object->isA(Class(BaseClass));                                              // returns true if MyClass is a child of BaseClass
+
+    Class(ChildClass)->isChildOf(object->getIdentifier());                      // returns true if ChildClass is a child of MyClass
+    @endcode
+*/
+
+#ifndef _Identifier_H__
+#define _Identifier_H__
+
+#include "core/CorePrereqs.h"
+
+#include <cassert>
+#include <map>
+#include <set>
+#include <string>
+#include <typeinfo>
+#include <loki/TypeTraits.h>
+
+#include "util/Output.h"
+#include "core/object/ObjectList.h"
+#include "core/object/Listable.h"
+#include "core/object/Context.h"
+#include "core/object/Destroyable.h"
+#include "core/object/WeakPtr.h"
+#include "IdentifierManager.h"
+#include "Super.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    /**
+        @brief The Identifier is used to identify the class of an object and to store information about the class.
+
+        Each Identifier stores information about one class. The Identifier can then be used to identify
+        this class. On the other hand it's also possible to get the corresponding Identifier of a class,
+        for example by using the macro Class().
+
+        @see See @ref IdentifierExample "Identifier.h" for more information and some examples.
+
+        @note You can't directly create an Identifier, it's just the base-class of ClassIdentifier<T>.
+    */
+    class _CoreExport Identifier : public Destroyable
+    {
+        public:
+            Identifier();
+            Identifier(const Identifier& identifier); // don't copy
+            virtual ~Identifier();
+
+            /// Returns the name of the class the Identifier belongs to.
+            inline const std::string& getName() const { return this->name_; }
+            void setName(const std::string& name);
+
+            /// Returns the name of the class as it is returned by typeid(T).name()
+            virtual const std::string& getTypeidName() = 0;
+
+            /// Returns the network ID to identify a class through the network.
+            inline uint32_t getNetworkID() const { return this->networkID_; }
+            void setNetworkID(uint32_t id);
+
+            /// Returns the unique ID of the class.
+            ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
+
+            /// Sets the Factory.
+            void setFactory(Factory* factory);
+            /// Returns true if the Identifier has a Factory.
+            inline bool hasFactory() const { return (this->factory_ != 0); }
+
+            Identifiable* fabricate(Context* context);
+
+            /// Returns true if the class can be loaded through XML.
+            inline bool isLoadable() const { return this->bLoadable_; }
+            /// Set the class to be loadable through XML or not.
+            inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; }
+
+            /// Returns true if the Identifier was completely initialized.
+            inline bool isInitialized() const { return this->bInitialized_; }
+
+
+            /////////////////////////////
+            ////// Class Hierarchy //////
+            /////////////////////////////
+            Identifier& inheritsFrom(Identifier* directParent);
+
+            void initializeParents(const std::set<const Identifier*>& identifiers);
+            void initializeDirectParentsOfAbstractClass();
+            void finishInitialization();
+
+            bool isA(const Identifier* identifier) const;
+            bool isExactlyA(const Identifier* identifier) const;
+            bool isChildOf(const Identifier* identifier) const;
+            bool isDirectChildOf(const Identifier* identifier) const;
+            bool isParentOf(const Identifier* identifier) const;
+            bool isDirectParentOf(const Identifier* identifier) const;
+
+            /// Returns the parents of the class the Identifier belongs to.
+            inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
+            /// Returns the begin-iterator of the parents-list.
+            inline std::set<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); }
+            /// Returns the end-iterator of the parents-list.
+            inline std::set<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); }
+
+            /// Returns the children of the class the Identifier belongs to.
+            inline const std::set<const Identifier*>& getChildren() const { return this->children_; }
+            /// Returns the begin-iterator of the children-list.
+            inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_.begin(); }
+            /// Returns the end-iterator of the children-list.
+            inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_.end(); }
+
+            /// Returns the direct parents of the class the Identifier belongs to.
+            inline const std::set<const Identifier*>& getDirectParents() const { return this->directParents_; }
+            /// Returns the begin-iterator of the direct-parents-list.
+            inline std::set<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); }
+            /// Returns the end-iterator of the direct-parents-list.
+            inline std::set<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); }
+
+            /// Returns the direct children the class the Identifier belongs to.
+            inline const std::set<const Identifier*>& getDirectChildren() const { return this->directChildren_; }
+            /// Returns the begin-iterator of the direct-children-list.
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_.begin(); }
+            /// Returns the end-iterator of the direct-children-list.
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_.end(); }
+
+
+            /////////////////////////
+            ///// Config Values /////
+            /////////////////////////
+            virtual void updateConfigValues(bool updateChildren = true) const = 0;
+
+            /// Returns true if this class has at least one config value.
+            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
+
+            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
+            ConfigValueContainer* getConfigValueContainer(const std::string& varname);
+
+
+            ///////////////////
+            ///// XMLPort /////
+            ///////////////////
+            /// Returns the map that stores all XMLPort params.
+            inline const std::map<std::string, XMLPortParamContainer*>& getXMLPortParamMap() const { return this->xmlportParamContainers_; }
+            /// Returns a const_iterator to the beginning of the map that stores all XMLPort params.
+            inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapBegin() const { return this->xmlportParamContainers_.begin(); }
+            /// Returns a const_iterator to the end of the map that stores all XMLPort params.
+            inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapEnd() const { return this->xmlportParamContainers_.end(); }
+
+            /// Returns the map that stores all XMLPort objects.
+            inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortObjectMap() const { return this->xmlportObjectContainers_; }
+            /// Returns a const_iterator to the beginning of the map that stores all XMLPort objects.
+            inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapBegin() const { return this->xmlportObjectContainers_.begin(); }
+            /// Returns a const_iterator to the end of the map that stores all XMLPort objects.
+            inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapEnd() const { return this->xmlportObjectContainers_.end(); }
+
+            void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
+            XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
+
+            void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
+            XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
+
+
+        protected:
+            virtual void createSuperFunctionCaller() const = 0;
+
+        private:
+            std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
+            std::set<const Identifier*> children_;                         //!< The children of the class the Identifier belongs to
+
+            std::set<const Identifier*> directParents_;                    //!< The direct parents of the class the Identifier belongs to
+            std::set<const Identifier*> directChildren_;                   //!< The direct children of the class the Identifier belongs to
+
+            bool bInitialized_;                                            //!< Is true if the Identifier was completely initialized
+            bool bLoadable_;                                               //!< False = it's not permitted to load the object through XML
+            std::string name_;                                             //!< The name of the class the Identifier belongs to
+            Factory* factory_;                                             //!< The Factory, able to create new objects of the given class (if available)
+            uint32_t networkID_;                                           //!< The network ID to identify a class through the network
+            const unsigned int classID_;                                   //!< Uniquely identifies a class (might not be the same as the networkID_)
+
+            bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
+            std::map<std::string, ConfigValueContainer*> configValues_;    //!< A map to link the string of configurable variables with their ConfigValueContainer
+
+            std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
+            std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_;   //!< All attachable objects
+    };
+
+    _CoreExport std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list);
+
+
+    // ###############################
+    // ###     ClassIdentifier     ###
+    // ###############################
+    /**
+        @brief The ClassIdentifier is derived from Identifier and holds all class-specific functions and variables the Identifier cannot have.
+
+        ClassIdentifier is a Singleton, which means that only one ClassIdentifier for a given type T exists.
+        This makes it possible to store information about a class, sharing them with all
+        objects of that class without defining static variables in every class.
+
+        To be really sure that not more than exactly one object exists (even with libraries),
+        ClassIdentifiers are stored in a static map in Identifier.
+    */
+    template <class T>
+    class ClassIdentifier : public Identifier
+    {
+        #ifndef DOXYGEN_SHOULD_SKIP_THIS
+          #define SUPER_INTRUSIVE_DECLARATION_INCLUDE
+          #include "Super.h"
+        #endif
+
+        public:
+            static ClassIdentifier<T>* getIdentifier();
+            static ClassIdentifier<T>* getIdentifier(const std::string& name);
+
+            bool initializeObject(T* object);
+
+            void setConfigValues(T* object, Configurable*) const;
+            void setConfigValues(T* object, Identifiable*) const;
+
+            void addObjectToList(T* object, Listable*);
+            void addObjectToList(T* object, Identifiable*);
+
+            virtual void updateConfigValues(bool updateChildren = true) const;
+
+            virtual const std::string& getTypeidName()
+                { return this->typeidName_; }
+
+        private:
+            static void initializeIdentifier();
+
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
+            ClassIdentifier()
+            {
+                this->typeidName_ = typeid(T).name();
+                SuperFunctionInitialization<0, T>::initialize(this);
+            }
+            ~ClassIdentifier()
+            {
+                SuperFunctionDestruction<0, T>::destroy(this);
+            }
+
+            void updateConfigValues(bool updateChildren, Listable*) const;
+            void updateConfigValues(bool updateChildren, Identifiable*) const;
+
+            std::string typeidName_;
+            static WeakPtr<ClassIdentifier<T> > classIdentifier_s;
+    };
+
+    template <class T>
+    WeakPtr<ClassIdentifier<T> > ClassIdentifier<T>::classIdentifier_s;
+
+    /**
+        @brief Returns the only instance of this class.
+        @return The unique Identifier
+    */
+    template <class T>
+    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    {
+        // check if the Identifier already exists
+        if (!ClassIdentifier<T>::classIdentifier_s)
+            ClassIdentifier<T>::initializeIdentifier();
+
+        return ClassIdentifier<T>::classIdentifier_s;
+    }
+
+    /**
+        @brief Does the same as getIdentifier() but sets the name if this wasn't done yet.
+        @param name The name of this Identifier
+        @return The Identifier
+    */
+    template <class T>
+    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
+    {
+        ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
+        identifier->setName(name);
+        return identifier;
+    }
+
+    /**
+        @brief Assigns the static field for the identifier singleton.
+    */
+    template <class T>
+    /*static */ void ClassIdentifier<T>::initializeIdentifier()
+    {
+        // create a new identifier anyway. Will be deleted if not used.
+        ClassIdentifier<T>* proposal = new ClassIdentifier<T>();
+
+        // Get the entry from the map
+        ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getInstance().getGloballyUniqueIdentifier(proposal);
+
+        if (ClassIdentifier<T>::classIdentifier_s == proposal)
+            orxout(verbose, context::identifier) << "Requested Identifier for " << proposal->getTypeidName() << " was not yet existing and got created." << endl;
+        else
+        {
+            orxout(verbose, context::identifier) << "Requested Identifier for " << proposal->getTypeidName() << " was already existing and got assigned." << endl;
+            delete proposal; // delete proposal (it is not used anymore)
+        }
+    }
+
+    /**
+        @brief Adds an object of the given type to the ObjectList.
+        @param object The object to add
+    */
+    template <class T>
+    bool ClassIdentifier<T>::initializeObject(T* object)
+    {
+        orxout(verbose, context::object_list) << "Register Object: " << this->getName() << endl;
+
+        object->identifier_ = this;
+        if (IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            IdentifierManager::getInstance().createdObject(object);
+
+            this->setConfigValues(object, object);
+            return true;
+        }
+        else
+        {
+            this->addObjectToList(object, object);
+
+            // Add pointer of type T to the map in the Identifiable instance that enables "dynamic_casts"
+            object->objectPointers_.push_back(std::make_pair(this->getClassID(), static_cast<void*>(object)));
+            return false;
+        }
+    }
+
+    /**
+     * @brief Only configures the object if is a @ref Configurable
+     */
+    template <class T>
+    void ClassIdentifier<T>::setConfigValues(T* object, Configurable*) const
+    {
+        object->setConfigValues();
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::setConfigValues(T*, Identifiable*) const
+    {
+        // no action
+    }
+
+    /**
+     * @brief Only adds the object to the object list if is a @ref Listable
+     */
+    template <class T>
+    void ClassIdentifier<T>::addObjectToList(T* object, Listable* listable)
+    {
+        if (listable->getContext())
+            listable->getContext()->addObject(object);
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::addObjectToList(T*, Identifiable*)
+    {
+        // no action
+    }
+
+    /**
+        @brief Updates the config-values of all existing objects of this class by calling their setConfigValues() function.
+    */
+    template <class T>
+    void ClassIdentifier<T>::updateConfigValues(bool updateChildren) const
+    {
+        this->updateConfigValues(updateChildren, static_cast<T*>(NULL));
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::updateConfigValues(bool updateChildren, Listable*) const
+    {
+        if (!this->hasConfigValues())
+            return;
+
+        for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
+            this->setConfigValues(*it, *it);
+
+        if (updateChildren)
+            for (std::set<const Identifier*>::const_iterator it = this->getChildrenBegin(); it != this->getChildrenEnd(); ++it)
+                (*it)->updateConfigValues(false);
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::updateConfigValues(bool updateChildren, Identifiable*) const
+    {
+        // no action
+    }
+
+
+    // ###############################
+    // ###      orxonox_cast       ###
+    // ###############################
+    /**
+    @brief
+        Casts on object of type Identifiable to any derived type that is
+        registered in the class hierarchy.
+    @return
+        Returns NULL if the cast is not possible
+    @note
+        In case of NULL return (and using MSVC), a dynamic_cast might still be possible if
+        a class forgot to register its objects.
+        Also note that the function is implemented differently for GCC/MSVC.
+    */
+    template <class T, class U>
+    ORX_FORCEINLINE T orxonox_cast(U* source)
+    {
+#ifdef ORXONOX_COMPILER_MSVC
+        typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType;
+        if (source != NULL)
+            return source->template getDerivedPointer<ClassType>(ClassIdentifier<ClassType>::getIdentifier()->getClassID());
+        else
+            return NULL;
+#else
+        return dynamic_cast<T>(source);
+#endif
+    }
+}
+
+#endif /* _Identifier_H__ */
Index: code/trunk/src/libraries/core/class/IdentifierManager.cc
===================================================================
--- code/trunk/src/libraries/core/class/IdentifierManager.cc	(revision 9667)
+++ code/trunk/src/libraries/core/class/IdentifierManager.cc	(revision 9667)
@@ -0,0 +1,226 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the Identifier class.
+*/
+
+#include "IdentifierManager.h"
+
+#include <ostream>
+
+#include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueContainer.h"
+#include "core/XMLPort.h"
+#include "core/object/ClassFactory.h"
+
+namespace orxonox
+{
+    /* static */ IdentifierManager& IdentifierManager::getInstance()
+    {
+        static IdentifierManager instance;
+        return instance;
+    }
+
+    IdentifierManager::IdentifierManager()
+    {
+        this->hierarchyCreatingCounter_s = 0;
+        this->classIDCounter_s = 0;
+    }
+
+    /**
+        @brief Returns an identifier by name and adds it if not available
+        @param proposal A pointer to a newly created identifier for the case of non existence in the map
+        @return The identifier (unique instance)
+    */
+    Identifier* IdentifierManager::getGloballyUniqueIdentifier(Identifier* proposal)
+    {
+        const std::string& typeidName = proposal->getTypeidName();
+        std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.find(typeidName);
+
+        if (it != this->identifierByTypeidName_.end())
+        {
+            // There is already an entry: return it
+            return it->second;
+        }
+        else
+        {
+            // There is no entry: put the proposal into the map and return it
+            this->identifierByTypeidName_[typeidName] = proposal;
+            return proposal;
+        }
+    }
+
+    /**
+     * Registers the identifier in all maps of the IdentifierManager.
+     */
+    void IdentifierManager::addIdentifierToLookupMaps(Identifier* identifier)
+    {
+        const std::string& typeidName = identifier->getTypeidName();
+        if (this->identifierByTypeidName_.find(typeidName) != this->identifierByTypeidName_.end())
+        {
+            this->identifierByString_[identifier->getName()] = identifier;
+            this->identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier;
+            this->identifierByNetworkId_[identifier->getNetworkID()] = identifier;
+        }
+        else
+            orxout(internal_warning) << "Trying to add an identifier to lookup maps which is not known to IdentifierManager" << endl;
+    }
+
+    /**
+        @brief Creates the class-hierarchy by creating and destroying one object of each type.
+    */
+    void IdentifierManager::createClassHierarchy()
+    {
+        orxout(internal_status) << "Create class-hierarchy" << endl;
+        this->startCreatingHierarchy();
+
+        std::set<Identifier*> initializedIdentifiers;
+
+        // ensure root context exists before starting to create objects. if the root context is dynamically created while creating the class hierarchy, we
+        // would mistakenly assume the class of the currently created object inherits from Context
+        Context::getRootContext();
+
+        // iterate over all identifiers, create one instance of each class and initialize the identifiers
+        {
+            Context temporaryContext(NULL);
+            for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it)
+            {
+                orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << it->second->getName() << ">-Singleton." << endl;
+                // To initialize the identifier, we create a new object and delete it afterwards.
+                if (it->second->hasFactory())
+                {
+                    this->identifiersOfNewObject_.clear();
+                    Identifiable* temp = it->second->fabricate(&temporaryContext);
+                    if (temp->getIdentifier() != it->second)
+                        orxout(internal_error) << "Newly created object of type " << it->second->getName() << " has unexpected identifier. Did you forget to use RegisterObject(classname)?" << endl;
+                    delete temp;
+
+                    it->second->initializeParents(this->identifiersOfNewObject_);
+                }
+                else
+                    it->second->initializeDirectParentsOfAbstractClass();
+
+                initializedIdentifiers.insert(it->second);
+            }
+
+            size_t numberOfObjects = temporaryContext.getObjectList<Listable>()->size();
+            if (numberOfObjects > 0)
+                orxout(internal_warning) << "There are still " << numberOfObjects << " listables left after creating the class hierarchy" << endl;
+        }
+
+        // finish the initialization of all identifiers
+        for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it)
+        {
+            if (initializedIdentifiers.find(it->second) != initializedIdentifiers.end())
+                it->second->finishInitialization();
+            else
+                orxout(internal_error) << "Identifier was registered late and is not initialized: " << it->second->getName() << " / " << it->second->getTypeidName() << endl;
+        }
+
+        this->stopCreatingHierarchy();
+        orxout(internal_status) << "Finished class-hierarchy creation" << endl;
+    }
+
+    /**
+        @brief Destroys all Identifiers. Called when exiting the program.
+    */
+    void IdentifierManager::destroyAllIdentifiers()
+    {
+        for (std::map<std::string, Identifier*>::iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it)
+            delete (it->second);
+
+        this->identifierByTypeidName_.clear();
+        this->identifierByString_.clear();
+        this->identifierByLowercaseString_.clear();
+        this->identifierByNetworkId_.clear();
+    }
+
+    /**
+     * @brief Notifies the IdentifierManager about a newly created object while creating the class hierarchy.
+     */
+    void IdentifierManager::createdObject(Identifiable* identifiable)
+    {
+        if (this->isCreatingHierarchy())
+            this->identifiersOfNewObject_.insert(identifiable->getIdentifier());
+        else
+            orxout(internal_warning) << "createdObject() called outside of class hierarchy creation" << endl;
+    }
+
+    /**
+        @brief Returns the Identifier with a given name.
+        @param name The name of the wanted Identifier
+        @return The Identifier
+    */
+    Identifier* IdentifierManager::getIdentifierByString(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = this->identifierByString_.find(name);
+        if (it != this->identifierByString_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the Identifier with a given name in lowercase.
+        @param name The name of the wanted Identifier
+        @return The Identifier
+    */
+    Identifier* IdentifierManager::getIdentifierByLowercaseString(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = this->identifierByLowercaseString_.find(name);
+        if (it != this->identifierByLowercaseString_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the Identifier with a given network ID.
+        @param id The network ID of the wanted Identifier
+        @return The Identifier
+    */
+    Identifier* IdentifierManager::getIdentifierByID(const uint32_t id)
+    {
+        std::map<uint32_t, Identifier*>::const_iterator it = this->identifierByNetworkId_.find(id);
+        if (it != this->identifierByNetworkId_.end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Cleans the NetworkID map (needed on clients for correct initialization)
+    */
+    void IdentifierManager::clearNetworkIDs()
+    {
+        this->identifierByNetworkId_.clear();
+    }
+}
Index: code/trunk/src/libraries/core/class/IdentifierManager.h
===================================================================
--- code/trunk/src/libraries/core/class/IdentifierManager.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/IdentifierManager.h	(revision 9667)
@@ -0,0 +1,113 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Class Identifier
+*/
+
+#ifndef _IdentifierManager_H__
+#define _IdentifierManager_H__
+
+#include "core/CorePrereqs.h"
+
+#include <map>
+#include <set>
+#include <string>
+
+namespace orxonox
+{
+    class _CoreExport IdentifierManager
+    {
+        public:
+            static IdentifierManager& getInstance();
+
+            Identifier* getGloballyUniqueIdentifier(Identifier* proposal);
+            void addIdentifierToLookupMaps(Identifier* identifier);
+
+            unsigned int getUniqueClassId()
+                { return this->classIDCounter_s++; }
+
+
+            /////////////////////////////
+            ////// Class Hierarchy //////
+            /////////////////////////////
+            void createClassHierarchy();
+            void destroyAllIdentifiers();
+
+            void createdObject(Identifiable* identifiable);
+
+            /// Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.
+            inline bool isCreatingHierarchy()
+                { return (hierarchyCreatingCounter_s > 0); }
+
+
+            //////////////////////////
+            ///// Identifier Map /////
+            //////////////////////////
+            Identifier* getIdentifierByString(const std::string& name);
+            Identifier* getIdentifierByLowercaseString(const std::string& name);
+            Identifier* getIdentifierByID(uint32_t id);
+
+            void clearNetworkIDs();
+
+            /// Returns the map that stores all Identifiers with their names.
+            inline const std::map<std::string, Identifier*>& getIdentifierByStringMap()
+                { return this->identifierByString_; }
+            /// Returns the map that stores all Identifiers with their names in lowercase.
+            inline const std::map<std::string, Identifier*>& getIdentifierByLowercaseStringMap()
+                { return this->identifierByLowercaseString_; }
+            /// Returns the map that stores all Identifiers with their IDs.
+            inline const std::map<uint32_t, Identifier*>& getIdentifierByNetworkIdMap()
+                { return this->identifierByNetworkId_; }
+
+        private:
+            IdentifierManager();
+            IdentifierManager(const IdentifierManager&);
+            ~IdentifierManager() {}
+
+            /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
+            inline void startCreatingHierarchy()
+                { hierarchyCreatingCounter_s++; }
+            /// Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.
+            inline void stopCreatingHierarchy()
+                { hierarchyCreatingCounter_s--; }
+
+            std::map<std::string, Identifier*> identifierByTypeidName_;      //!< Map with the names as received by typeid(). This is only used internally.
+
+            std::map<std::string, Identifier*> identifierByString_;          //!< Map that stores all Identifiers with their names.
+            std::map<std::string, Identifier*> identifierByLowercaseString_; //!< Map that stores all Identifiers with their names in lowercase.
+            std::map<uint32_t, Identifier*> identifierByNetworkId_;          //!< Returns the map that stores all Identifiers with their network IDs.
+
+            int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
+            std::set<const Identifier*> identifiersOfNewObject_;    //!< Used while creating the object hierarchy to keep track of the identifiers of a newly created object
+            unsigned int classIDCounter_s;                          //!< counter for the unique classIDs
+    };
+}
+
+#endif /* _IdentifierManager_H__ */
Index: code/trunk/src/libraries/core/class/OrxonoxClass.cc
===================================================================
--- code/trunk/src/libraries/core/class/OrxonoxClass.cc	(revision 9667)
+++ code/trunk/src/libraries/core/class/OrxonoxClass.cc	(revision 9667)
@@ -0,0 +1,40 @@
+/*
+ *   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 "OrxonoxClass.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(OrxonoxClass);
+
+    OrxonoxClass::OrxonoxClass()
+    {
+        RegisterObject(OrxonoxClass);
+    }
+}
Index: code/trunk/src/libraries/core/class/OrxonoxClass.h
===================================================================
--- code/trunk/src/libraries/core/class/OrxonoxClass.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/OrxonoxClass.h	(revision 9667)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup OrxonoxClass OrxonoxClass
+    @ingroup Class
+*/
+
+/**
+    @file
+    @ingroup Class OrxonoxClass
+    @brief Declaration of OrxonoxClass, the base class of all objects in Orxonox.
+*/
+
+#ifndef _OrxonoxClass_H__
+#define _OrxonoxClass_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/config/Configurable.h"
+#include "core/object/Destroyable.h"
+
+namespace orxonox
+{
+    /**
+        @brief This is the class from which all objects of the game-logic (not the engine) are derived from.
+    */
+    class _CoreExport OrxonoxClass : virtual public Configurable, virtual public Destroyable
+    {
+        public:
+            OrxonoxClass();
+    };
+}
+
+#endif /* _OrxonoxClass_H__ */
Index: code/trunk/src/libraries/core/class/OrxonoxInterface.cc
===================================================================
--- code/trunk/src/libraries/core/class/OrxonoxInterface.cc	(revision 9667)
+++ code/trunk/src/libraries/core/class/OrxonoxInterface.cc	(revision 9667)
@@ -0,0 +1,40 @@
+/*
+ *   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 "OrxonoxInterface.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(OrxonoxInterface);
+
+    OrxonoxInterface::OrxonoxInterface()
+    {
+        RegisterObject(OrxonoxInterface);
+    }
+}
Index: code/trunk/src/libraries/core/class/OrxonoxInterface.h
===================================================================
--- code/trunk/src/libraries/core/class/OrxonoxInterface.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/OrxonoxInterface.h	(revision 9667)
@@ -0,0 +1,57 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Class OrxonoxClass
+    @brief Declaration of OrxonoxInterface, the base class of all interfaces in Orxonox.
+*/
+
+#ifndef _OrxonoxInterface_H__
+#define _OrxonoxInterface_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/config/Configurable.h"
+#include "core/object/Destroyable.h"
+
+namespace orxonox
+{
+    /**
+        @brief This is the class from which all interfaces of the game-logic (not the engine) are derived from.
+
+        Interfaces are derived with @c virtual @c public @c OrxonoxInterface from OrxonoxInterface.
+    */
+    class _CoreExport OrxonoxInterface : virtual public Configurable, virtual public Destroyable
+    {
+        public:
+            OrxonoxInterface();
+    };
+}
+
+#endif /* _OrxonoxInterface_H__ */
Index: code/trunk/src/libraries/core/class/SubclassIdentifier.h
===================================================================
--- code/trunk/src/libraries/core/class/SubclassIdentifier.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/SubclassIdentifier.h	(revision 9667)
@@ -0,0 +1,204 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Class Identifier
+    @brief Definition of SubclassIdentifier.
+
+    @anchor SubclassIdentifierExample
+
+    SubclassIdentifier is a separated class, acting like an Identifier, but has a given class.
+    You can only assign Identifiers of exactly the given class or of a derivative to a SubclassIdentifier.
+
+    Example:
+
+    You can assign an Identifier either through the constructor or by using the assignment @c operator=:
+    @code
+    SubclassIdentifier<BaseClass> identifier = Class(SubClass);
+    @endcode
+
+    The @c operator-> is overloaded an returns the assigned Identifier. That way you can just call
+    functions of the assigned Identifier by using @c ->function():
+    @code
+    SubclassIdentifier<BaseClass> identifier = Class(SubClass);
+    identifier->getName();      // returns "SubClass"
+    @endcode
+
+    There are two possibilities to create an object out of a SubclassIdentifier: Either you just use
+    the @c fabricate() function of the assigned Identifier through the overloaded @c operator->, which
+    returns a @c OrxonoxClass* pointer, or you use the function of SubclassIdentifier, this time by using
+    @c operator., which returns a @c BaseClass* pointer (@a BaseClass is the baseclass specified by the
+    template argument):
+    @code
+    identifier->fabricate();    // calls Identifier::fabricate(), creates a SubClass, returns a OrxonoxClass* pointer
+
+    identifier.fabricate();     // calls SubclassIdentifier::fabricate(), creates a SubClass, returns a BaseClass* pointer
+    @endcode
+*/
+
+#ifndef _SubclassIdentifier_H__
+#define _SubclassIdentifier_H__
+
+#include "core/CorePrereqs.h"
+
+#include <cstdlib>
+#include "util/Output.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###   SubclassIdentifier    ###
+    // ###############################
+    /**
+        @brief The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
+
+        You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>.
+        If you assign something else, the program prints an error.
+
+        Because we know the base-type, a @c dynamic_cast is done, which makes it easier to create a new object.
+
+        @see See @ref SubclassIdentifierExample "SubclassIdentifier.h" for some examples.
+    */
+    template <class T>
+    class SubclassIdentifier
+    {
+        public:
+            /// Constructor: Automaticaly assigns the Identifier of the given class.
+            SubclassIdentifier()
+            {
+                this->identifier_ = ClassIdentifier<T>::getIdentifier();
+            }
+
+            /// Constructor: Assigns the given Identifier.
+            SubclassIdentifier(Identifier* identifier)
+            {
+                this->operator=(identifier);
+            }
+
+            /// Copyconstructor: Assigns the identifier of another SubclassIdentifier.
+            template <class O>
+            SubclassIdentifier(const SubclassIdentifier<O>& identifier)
+            {
+                this->operator=(identifier.getIdentifier());
+            }
+
+            /**
+                @brief Overloading of the = operator: assigns the identifier and checks its type.
+                @param identifier The Identifier to assign
+                @return The SubclassIdentifier itself
+            */
+            SubclassIdentifier<T>& operator=(Identifier* identifier)
+            {
+                if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
+                {
+                    orxout(internal_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+                    if (identifier)
+                    {
+                        orxout(internal_error) << "Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+                        orxout(internal_error) << "SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << endl;
+                    }
+                    else
+                    {
+                        orxout(internal_error) << "Can't assign NULL identifier" << endl;
+                    }
+                }
+                else
+                {
+                    this->identifier_ = identifier;
+                }
+                return *this;
+            }
+
+            /// Overloading of the = operator: assigns the identifier of another SubclassIdentifier.
+            template <class O>
+            SubclassIdentifier<T>& operator=(const SubclassIdentifier<O>& identifier)
+            {
+                return this->operator=(identifier.getIdentifier());
+            }
+
+            /// Overloading of the * operator: returns the assigned identifier.
+            inline Identifier* operator*() const
+            {
+                return this->identifier_;
+            }
+
+            /// Overloading of the -> operator: returns the assigned identifier.
+            inline Identifier* operator->() const
+            {
+                return this->identifier_;
+            }
+
+            /// Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.
+            inline operator Identifier*() const
+            {
+                return this->identifier_;
+            }
+
+            /// Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
+            T* fabricate(Context* context) const
+            {
+                Identifiable* newObject = this->identifier_->fabricate(context);
+
+                // Check if the creation was successful
+                if (newObject)
+                {
+                    return orxonox_cast<T*>(newObject);
+                }
+                else
+                {
+                    // Something went terribly wrong
+                    if (this->identifier_)
+                    {
+                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+                        orxout(user_error) << "Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << '!' << endl;
+                        orxout(user_error) << "Couldn't fabricate a new Object." << endl;
+                    }
+                    else
+                    {
+                        orxout(user_error) << "An error occurred in SubclassIdentifier (Identifier.h):" << endl;
+                        orxout(user_error) << "Couldn't fabricate a new Object - Identifier is undefined." << endl;
+                    }
+
+                    orxout(user_error) << "Aborting..." << endl;
+                    abort();
+                    return 0;
+                }
+            }
+
+            /// Returns the assigned identifier.
+            inline Identifier* getIdentifier() const
+                { return this->identifier_; }
+
+        private:
+            Identifier* identifier_;            //!< The assigned identifier
+    };
+}
+
+#endif /* _SubclassIdentifier_H__ */
Index: code/trunk/src/libraries/core/class/Super.h
===================================================================
--- code/trunk/src/libraries/core/class/Super.h	(revision 9667)
+++ code/trunk/src/libraries/core/class/Super.h	(revision 9667)
@@ -0,0 +1,634 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup Super Super
+    @ingroup Class
+*/
+
+/**
+    @file
+    @ingroup Class Super
+    @brief Definition of all super-function related macros, used to call functions of the base class.
+
+    This file defines all macros needed to add a new "super-function". If you add
+    a super-function, you can call <tt>SUPER(myclass, functionname, arguments)</tt>
+    inside your code and the function of the parent-class gets called. This is comparable
+    to <tt>super.functionname(arguments)</tt> in Java or other languages.
+
+    This works only with virtual functions that return nothing (@c void) and belong to
+    classes that have an @ref orxonox::Identifier "Identifier". Arguments however are
+    supported, there's no limitation for their number and type, except that the type has
+    to be known in Super.h.
+
+    To add a new super-function, you have to process 4 steps:
+
+    -# Add a new @c SUPER macro <br />
+       This allows you to call the super-function in your code. <br />
+       Location: This file (Super.h), marked with "--> HERE <--" comments (1/3)
+    -# Call the @c SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2 macros. <br />
+       This defines some global classes and templates, needed to create and call the super-functions. <br />
+       Location: This file (Super.h), marked with "--> HERE <--" comments (2/3)
+    -# Call the @c SUPER_INTRUSIVE_DECLARATION macro. <br />
+       This will be included into the declaration of @c ClassIdentifier<T>. <br />
+       Location: This file (Super.h), marked with "--> HERE <--" comments (3/3)
+    -# Call the @c SUPER_FUNCTION macro. <br />
+       This defines a partially specialized template that will decide if a class is "super" to another class.
+       If the check returns true, a @c SuperFunctionCaller gets created, which will be used by the @c SUPER macro.
+       You have to add this into the header-file of the baseclass of the super-function (the class that first
+       implements the function), below the class declaration. You can't call it directly in this file, because
+       otherwise you had to include the headerfile right here, which would cause some ugly back-dependencies,
+       include loops and slower compilation. <br />
+       Dont forget to include Super.h in the header-file. <br />
+       Location: The header-file of the baseclass (Baseclass.h), below the class declaration
+*/
+
+#ifndef _Super_H__
+#define _Super_H__
+
+#include "core/CorePrereqs.h"
+#include "util/Output.h"
+
+///////////////////////
+// Macro definitions //
+///////////////////////
+
+//// Common macros ////
+
+    /**
+        @brief Declares a new super-function by creating a specialized template. Add this below the class declaration of the baseclass.
+        @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
+        @param baseclass The baseclass of the super-function (~the root)
+        @param functionname The name of the super-function
+        @param purevirtualbase "true" if the function is pure virtual in the baseclass, "false" if the function is implemented (without "")
+    */
+    #define SUPER_FUNCTION(functionnumber, baseclass, functionname, purevirtualbase) \
+        template <class T, int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \
+        { \
+            static void superCheck() \
+            { \
+                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0)); \
+                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \
+            } \
+            \
+            static void apply(void*) {} \
+            \
+            static void apply(baseclass*) \
+            { \
+                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \
+                { \
+                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
+                    { \
+                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0; \
+                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
+                    } \
+                    \
+                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
+                    { \
+                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
+                    } \
+                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
+                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
+                } \
+            } \
+        }; \
+        \
+        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase(functionnumber, baseclass)
+
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND0(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND1(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass)
+    #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) \
+        template <int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
+        { \
+            static void superCheck() \
+            { \
+                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
+            } \
+        };
+
+
+    /*
+    //// Comments about the macro ////
+
+        // Partially specialized template (templatehack is now specialized too).
+        //
+        // This ensures the compiler takes THIS template if the header-file of the super-function
+        // is included. In any other case, the compiler just uses the fallback template which is
+        // defined in this file.
+        template <class T, templatehack2>
+        struct SuperFunctionCondition<functionnumber, T, 0, templatehack2>
+        {
+            static void superCheck()
+            {
+                // This call to the apply-function is the whole check. By calling the function with
+                // a T* pointer, the right function get's called.
+                SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(0));
+
+                // Go go the superCheck for of next super-function (functionnumber + 1)
+                SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck();
+            }
+
+            // This function gets called if T is not a child of the baseclass.
+            // The function does nothing.
+            static void apply(void* temp) {}
+
+            // This function gets called if T is a child of the baseclass and can therefore be converted.
+            // The function adds a SuperFunctionCaller to the Identifier of all subclasses of T.
+            static void apply(baseclass* temp)
+            {
+                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
+
+                // Iterate through all children
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it)
+                {
+                    // Check if the caller is a fallback-caller
+                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
+                    {
+                        // Delete the fallback caller an prepare to get a real caller
+                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_;
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0;
+                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false;
+                    }
+
+                    // Check if there's not already a caller
+                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
+                    {
+                        // Add the SuperFunctionCaller
+                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
+                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
+                    }
+
+                    // If there is already a caller, but for another parent, print a warning
+                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
+                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
+                }
+            }
+        };
+        SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase
+
+
+        // The following piece of code is only added if purevirtualbase = true
+
+        // Explicit specialization of the Condition template for the baseclass to avoid
+        // errors if the function is pure virtual in the baseclass.
+        template <int templatehack2> \
+        struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \
+        { \
+            // The superCheck function acts like the fallback - it advances to the check for the next super-function (functionnumber + 1)
+            static void superCheck() \
+            { \
+                SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \
+            } \
+        };
+    */
+
+    /// SUPER-macro: Calls Parent::functionname(...) where Parent is the direct parent of @a classname
+    #ifdef ORXONOX_COMPILER_MSVC
+        #define SUPER(classname, functionname, ...) \
+            __super::functionname(__VA_ARGS__)
+    #else
+        #define SUPER(classname, functionname, ...) \
+            SUPER_##functionname(classname, functionname, __VA_ARGS__)
+    #endif
+
+    // helper macro: for functions without arguments
+    #define SUPER_NOARGS(classname, functionname) \
+        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this)
+
+    // helper macro: for functions with arguments
+    #define SUPER_ARGS(classname, functionname, ...) \
+        (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this, __VA_ARGS__)
+
+
+//// Function-specific macros ////
+
+    /*
+        Add a macro for each super-function
+
+        Example (no arguments):
+        #define SUPER_myfunction(classname, functionname, ...) \
+            SUPER_NOARGS(classname, functionname)
+
+        Example (with arguments):
+        #define SUPER_myfunction(classname, functionname, ...) \
+            SUPER_ARGS(classname, functionname, __VA_ARGS__)
+    */
+
+    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    #define SUPER_XMLPort(classname, functionname, ...) \
+        SUPER_ARGS(classname, functionname, __VA_ARGS__)
+
+    #define SUPER_tick(classname, functionname, ...) \
+        SUPER_ARGS(classname, functionname, __VA_ARGS__)
+
+    #define SUPER_changedActivity(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedVisibility(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_XMLEventPort(classname, functionname, ...) \
+        SUPER_ARGS(classname, functionname, __VA_ARGS__)
+
+    #define SUPER_changedScale(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedOwner(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedOverlayGroup(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedName(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedGametype(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedUsed(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedCarrier(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    #define SUPER_changedPickedUp(classname, functionname, ...) \
+        SUPER_NOARGS(classname, functionname)
+
+    // (1/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+
+namespace orxonox
+{
+    /////////////////////////////////////////////////////////////////////////////////////////////////////
+    // This code gets included by Identifier.h and every other header file that needs a super-function //
+    /////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    //// Common code ////
+
+        // Base templates
+        /**
+            @brief Creates the SuperFunctionCaller if T is a child of the super-functions baseclass.
+        */
+        template <int functionnumber, class T, int templatehack1, int templatehack2>
+        struct SuperFunctionCondition
+        {
+            static void superCheck() {}
+        };
+
+        /**
+            @brief Initializes the SuperFunctionCaller-pointer with zero.
+        */
+        template <int functionnumber, class T>
+        struct SuperFunctionInitialization
+        {
+            static void initialize(ClassIdentifier<T>*) {}
+        };
+
+        /**
+            @brief Deletes the SuperFunctionCaller.
+        */
+        template <int functionnumber, class T>
+        struct SuperFunctionDestruction
+        {
+            static void destroy(ClassIdentifier<T>*) {}
+        };
+
+
+    //// Function-specific code ////
+
+        /**
+            @brief Creates the needed objects and templates to call a super-function.
+            @param functionnumber Each super-function needs a unique number, starting with zero, increasing by one
+            @param functionname The name of the super-function
+            @param hasarguments "false" if the function doesn't take any arguments, "true" if it does (without "")
+            @param ... Variadic: If the function takes arguments, add them here with type and name. Example: int myvalue, float myothervalue
+        */
+        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments, ...) \
+            template <class T, int templatehack1, int templatehack2> \
+            struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \
+            { \
+                static void superCheck() \
+                { \
+                    SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck(); \
+                } \
+            }; \
+            \
+            class _CoreExport SuperFunctionCaller_##functionname \
+            { \
+                public: \
+                    virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0; \
+                    virtual ~SuperFunctionCaller_##functionname () {} \
+                    virtual Identifier* getParentIdentifier() const = 0; \
+            }; \
+            \
+            template <class T> \
+            class SuperFunctionClassCaller_purevirtualfallback_##functionname : public SuperFunctionCaller_##functionname \
+            { \
+                public: \
+                    inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
+                    { \
+                    } \
+                    \
+                    Identifier* getParentIdentifier() const \
+                    { \
+                        return ClassIdentifier<T>::getIdentifier(); \
+                    } \
+            }; \
+            \
+            template <class T> \
+            struct SuperFunctionInitialization<functionnumber, T> \
+            { \
+                static void initialize(ClassIdentifier<T>* identifier) \
+                { \
+                    identifier->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_purevirtualfallback_##functionname <T>; \
+                    identifier->bSuperFunctionCaller_##functionname##_isFallback_ = true; \
+                    SuperFunctionInitialization<functionnumber + 1, T>::initialize(identifier); \
+                } \
+            }; \
+            \
+            template <class T> \
+            struct SuperFunctionDestruction<functionnumber, T> \
+            { \
+                static void destroy(ClassIdentifier<T>* identifier) \
+                { \
+                    if (identifier->superFunctionCaller_##functionname##_) \
+                        delete identifier->superFunctionCaller_##functionname##_; \
+                    SuperFunctionDestruction<functionnumber + 1, T>::destroy(identifier); \
+                } \
+            }; \
+            \
+            template <class T> \
+            class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname \
+            { \
+                public: \
+                    inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
+                    { \
+                        (orxonox_cast<T*>(object))->T:: functionname
+
+        /*
+            JUST ADD THE FUNCTION ARGUMENTS BETWEEN BOTH MACROS, ENCLOSED BY BRACKETS
+            EXAMPLE:
+
+              SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, myfunction, true, int myvalue, float myothervalue) <-- !!! DONT ADD A SEMICOLON HERE !!!
+                (myvalue, myothervalue)
+              SUPER_FUNCTION_GLOBAL_DECLARATION_PART2
+        */
+
+        #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART2 \
+                                                        ; \
+                    } \
+                    \
+                    Identifier* getParentIdentifier() const \
+                    { \
+                        return ClassIdentifier<T>::getIdentifier(); \
+                    } \
+            };
+
+        #define SUPER_CALL_ARGUMENTSfalse(...) Identifiable* object
+        #define SUPER_CALL_ARGUMENTS0(...)     Identifiable* object
+        #define SUPER_CALL_ARGUMENTStrue(...) Identifiable* object, __VA_ARGS__
+        #define SUPER_CALL_ARGUMENTS1(...)    Identifiable* object, __VA_ARGS__
+
+
+    /*
+    //// COMMENTS ABOUT THE MACRO ////
+
+        // Partially specialized template (templatehack not yet specialized, this
+        // will be done by the real condition in the header-file of the super-function)
+        // Only used as fallback
+        template <class T, int templatehack1, int templatehack2>
+        struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2>
+        {
+            // If this function gets called, the header-file of the super function is not
+            // included, so this fallback template (templatehack not specialized) is used
+            static void superCheck()
+            {
+                // Calls the condition-check of the next super-function (functionnumber + 1)
+                SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck();
+            }
+        };
+
+        // Baseclass of the super-function caller. The real call will be done by a
+        // templatized subclass through the virtual () operator.
+        class _CoreExport SuperFunctionCaller_##functionname
+        {
+            public:
+                virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0;
+                virtual ~SuperFunctionCaller_##functionname () {}
+                virtual Identifier* getParentIdentifier() const = 0;
+        };
+
+        // Fallback if the base is pure virtual
+        template <class T>
+        class SuperFunctionClassCaller_purevirtualfallback_##functionname : public SuperFunctionCaller_##functionname
+        {
+            public:
+                // Fallback does nothing
+                inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
+                {
+                }
+
+                Identifier* getParentIdentifier() const
+                {
+                    return ClassIdentifier<T>::getIdentifier();
+                }
+        };
+
+        // Initializes the SuperFunctionCaller-pointer with a fallback caller in case the base function is pure virtual
+        template <class T>
+        struct SuperFunctionInitialization<functionnumber, T>
+        {
+            static void initialize(ClassIdentifier<T>* identifier)
+            {
+                identifier->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_purevirtualfallback_##functionname <T>;
+                identifier->bSuperFunctionCaller_##functionname##_isFallback_ = true;
+
+                // Calls the initialization of the next super-function (functionnumber + 1)
+                SuperFunctionInitialization<functionnumber + 1, T>::initialize(identifier);
+            }
+        };
+
+        // Deletes the SuperFunctionCaller.
+        template <class T>
+        struct SuperFunctionDestruction<functionnumber, T>
+        {
+            static void destroy(ClassIdentifier<T>* identifier)
+            {
+                if (identifier->superFunctionCaller_##functionname##_)
+                    delete identifier->superFunctionCaller_##functionname##_;
+
+                // Calls the destruction of the next super-function (functionnumber + 1)
+                SuperFunctionDestruction<functionnumber + 1, T>::destroy(identifier);
+            }
+        };
+
+        // The real super-function caller: Calls T::functionname()
+        // T should be the parent, but this will be done by the spezialized condition template
+        template <class T>
+        class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname
+        {
+            public:
+                // @brief Calls the function.
+                // @param object The object to call the function on
+                // @param ... The arguments of the function
+                inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
+                {
+                    (orxonox_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
+                }
+
+                Identifier* getParentIdentifier() const
+                {
+                    return ClassIdentifier<T>::getIdentifier();
+                }
+        }
+    */
+
+
+    //// Execute the code for each super-function ////
+
+        // (2/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(0, XMLPort, true, Element& xmlelement, XMLPort::Mode mode)
+            (xmlelement, mode)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(1, tick, true, float dt)
+            (dt)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(2, changedActivity, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(3, changedVisibility, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(4, XMLEventPort, true, Element& xmlelement, XMLPort::Mode mode)
+            (xmlelement, mode)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(5, changedScale, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(6, changedOwner, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(7, changedOverlayGroup, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(8, changedName, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(9, changedGametype, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(10, changedUsed, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        // (2/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+}
+
+#else /* _Super_H__ */
+  #ifdef SUPER_INTRUSIVE_DECLARATION_INCLUDE
+
+//////////////////////////////////////////////////////////////////////////
+// This code gets included within the declaration of ClassIdentifier<T> //
+//////////////////////////////////////////////////////////////////////////
+
+//// Common code ////
+
+    private:
+
+        template <int functionnumber, class TT, int templatehack1, int templatehack2>
+        friend struct SuperFunctionCondition;
+
+        // Creates the super-function-callers by calling the first SuperFunctionCondition check
+        // This get's called within the initialization of an Identifier
+        virtual void createSuperFunctionCaller() const
+        {
+            SuperFunctionCondition<0, T, 0, 0>::superCheck();
+        }
+
+
+//// Function-specific code ////
+
+    public:
+        /**
+            @brief Adds a pointer to the SuperFunctionCaller as a member of ClassIdentifier.
+            @param functionname The name of the super-function
+        */
+        #ifndef SUPER_INTRUSIVE_DECLARATION
+          #define SUPER_INTRUSIVE_DECLARATION(functionname) \
+            SuperFunctionCaller_##functionname * superFunctionCaller_##functionname##_; \
+            bool bSuperFunctionCaller_##functionname##_isFallback_
+        #endif
+
+
+//// Execute the code for each super-function ////
+
+    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+    SUPER_INTRUSIVE_DECLARATION(XMLPort);
+    SUPER_INTRUSIVE_DECLARATION(tick);
+    SUPER_INTRUSIVE_DECLARATION(changedActivity);
+    SUPER_INTRUSIVE_DECLARATION(changedVisibility);
+    SUPER_INTRUSIVE_DECLARATION(XMLEventPort);
+    SUPER_INTRUSIVE_DECLARATION(changedScale);
+    SUPER_INTRUSIVE_DECLARATION(changedOwner);
+    SUPER_INTRUSIVE_DECLARATION(changedOverlayGroup);
+    SUPER_INTRUSIVE_DECLARATION(changedName);
+    SUPER_INTRUSIVE_DECLARATION(changedGametype);
+    SUPER_INTRUSIVE_DECLARATION(changedUsed);
+    SUPER_INTRUSIVE_DECLARATION(changedCarrier);
+    SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
+    // (3/3) --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <-- --> HERE <--
+
+
+    #undef SUPER_INTRUSIVE_DECLARATION_INCLUDE
+  #endif /* SUPER_INTRUSIVE_DECLARATION_INCLUDE */
+#endif /* _Super_H__ */
Index: code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 9576)
+++ code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc	(revision 9667)
@@ -39,7 +39,7 @@
 #include "util/Convert.h"
 #include "util/StringUtils.h"
-#include "core/Identifier.h"
-#include "core/ConfigFileManager.h"
-#include "core/ConfigValueContainer.h"
+#include "core/class/Identifier.h"
+#include "core/config/SettingsConfigFile.h"
+#include "core/config/ConfigValueContainer.h"
 #include "CommandExecutor.h"
 #include "ConsoleCommand.h"
Index: code/trunk/src/libraries/core/command/Functor.h
===================================================================
--- code/trunk/src/libraries/core/command/Functor.h	(revision 9576)
+++ code/trunk/src/libraries/core/command/Functor.h	(revision 9667)
@@ -120,5 +120,5 @@
 #include "util/Output.h"
 #include "util/MultiType.h"
-#include "core/OrxonoxClass.h"
+#include "core/object/Destroyable.h"
 #include "FunctorPtr.h"
 
@@ -303,10 +303,10 @@
             /// Casts the object and registers as destruction listener.
             inline void registerObject(O* object)
-                { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->registerAsDestructionListener(base); } }
+                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->registerAsDestructionListener(base); } }
             /// Casts the object and unregisters as destruction listener.
             inline void unregisterObject(O* object)
-                { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->unregisterAsDestructionListener(base); } }
-
-            /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted and the Functor is in safe mode.
+                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->unregisterAsDestructionListener(base); } }
+
+            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode.
             inline void objectDeleted()
                 { this->object_ = 0; }
Index: code/trunk/src/libraries/core/command/IOConsolePOSIX.cc
===================================================================
--- code/trunk/src/libraries/core/command/IOConsolePOSIX.cc	(revision 9576)
+++ code/trunk/src/libraries/core/command/IOConsolePOSIX.cc	(revision 9667)
@@ -99,5 +99,5 @@
 
         resetTerminalMode();
-        this->shell_->destroy();
+        delete this->shell_;
 
         // Restore this->cout_ redirection
Index: code/trunk/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/trunk/src/libraries/core/command/IOConsoleWindows.cc	(revision 9576)
+++ code/trunk/src/libraries/core/command/IOConsoleWindows.cc	(revision 9667)
@@ -113,5 +113,5 @@
 
         resetTerminalMode();
-        this->shell_->destroy();
+        delete this->shell_;
     }
 
Index: code/trunk/src/libraries/core/command/Shell.cc
===================================================================
--- code/trunk/src/libraries/core/command/Shell.cc	(revision 9576)
+++ code/trunk/src/libraries/core/command/Shell.cc	(revision 9667)
@@ -40,6 +40,6 @@
 #include "util/output/MemoryWriter.h"
 #include "core/CoreIncludes.h"
-#include "core/ConfigFileManager.h"
-#include "core/ConfigValueIncludes.h"
+#include "core/config/ConfigFileManager.h"
+#include "core/config/ConfigValueIncludes.h"
 #include "core/PathConfig.h"
 #include "core/input/InputBuffer.h"
@@ -55,4 +55,6 @@
         const OutputLevel User = level::user_info;
     }
+
+    RegisterClassNoArgs(Shell);
 
     /**
@@ -66,5 +68,5 @@
         , bScrollable_(bScrollable)
     {
-        RegisterRootObject(Shell);
+        RegisterObject(Shell);
 
         OutputManager::getInstance().registerListener(this);
@@ -96,5 +98,5 @@
     Shell::~Shell()
     {
-        this->inputBuffer_->destroy();
+        delete this->inputBuffer_;
 
         OutputManager::getInstance().unregisterListener(this);
Index: code/trunk/src/libraries/core/command/Shell.h
===================================================================
--- code/trunk/src/libraries/core/command/Shell.h	(revision 9576)
+++ code/trunk/src/libraries/core/command/Shell.h	(revision 9667)
@@ -50,5 +50,4 @@
 #include "util/output/BaseWriter.h"
 #include "core/Core.h"
-#include "core/OrxonoxClass.h"
 
 namespace orxonox
@@ -110,5 +109,5 @@
             };
 
-            Shell(const std::string& consoleName, bool bScrollable);
+            Shell(const std::string& consoleName = "", bool bScrollable = true);
             ~Shell();
 
@@ -200,5 +199,5 @@
             unsigned int              historyOffset_;       ///< The command history is a circular buffer, this variable defines the current write-offset
             std::vector<std::string>  commandHistory_;      ///< The history of commands that were entered by the user
-            static unsigned int       cacheSize_s;          ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass
+            static unsigned int       cacheSize_s;          ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is not configurable
     };
 }
Index: code/trunk/src/libraries/core/config/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/config/CMakeLists.txt	(revision 9667)
+++ code/trunk/src/libraries/core/config/CMakeLists.txt	(revision 9667)
@@ -0,0 +1,11 @@
+ADD_SOURCE_FILES(CORE_SRC_FILES
+  CommandLineParser.cc
+#  ConfigFile.cc is already included in FilesystemBuildUnit.cc
+  ConfigFileEntryValue.cc
+  ConfigFileEntryVectorValue.cc
+  ConfigFileManager.cc
+  ConfigFileSection.cc
+  Configurable.cc
+  ConfigValueContainer.cc
+  SettingsConfigFile.cc
+)
Index: code/trunk/src/libraries/core/config/CommandLineParser.cc
===================================================================
--- code/trunk/src/libraries/core/config/CommandLineParser.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/CommandLineParser.cc	(revision 9667)
@@ -0,0 +1,340 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CommandLineParser.h"
+
+#include <algorithm>
+#include <sstream>
+
+#include "util/Convert.h"
+#include "util/Output.h"
+#include "util/Exception.h"
+#include "util/StringUtils.h"
+#include "util/SubString.h"
+#include "core/PathConfig.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Parses a value string for a command line argument.
+        It simply uses convertValue(Output, Input) to do that.
+        Bools are treated specially. That is necessary
+        so that you can have simple command line switches.
+    */
+    void CommandLineArgument::parse(const std::string& value)
+    {
+        if (value_.isType<bool>())
+        {
+            // simulate command line switch
+            bool temp;
+            if (convertValue(&temp, value))
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = temp;
+            }
+            else if (value.empty())
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = true;
+            }
+            else
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+        }
+        else
+        {
+            if (!value_.set(value))
+            {
+                value_.set(defaultValue_);
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+            }
+            else
+                this->bHasDefaultValue_ = false;
+        }
+    }
+
+
+    /**
+    @brief
+        Destructor destroys all CommandLineArguments with it.
+    */
+    CommandLineParser::~CommandLineParser()
+    {
+        CommandLineParser::destroyAllArguments();
+    }
+
+    /**
+    @brief
+        Returns a unique instance (Meyers Singleton).
+    */
+    CommandLineParser& CommandLineParser::_getInstance()
+    {
+        static CommandLineParser instance;
+        return instance;
+    }
+
+    /**
+    @brief
+        Destroys all command line arguments. This should be called at the end
+        of main. Do not use before that.
+    */
+    void CommandLineParser::destroyAllArguments()
+    {
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
+            it != _getInstance().cmdLineArgs_.end(); ++it)
+            delete it->second;
+        _getInstance().cmdLineArgs_.clear();
+    }
+
+    /** Parses the command line string for arguments and stores these.
+    @note
+        The reason that you have to provide the string to be parsed as
+        space separated list is because of argc and argv. If you only have
+        a whole string, simply use getAllStrings() of SubString.
+    @param cmdLine
+        Command line string WITHOUT the execution path.
+    */
+    void CommandLineParser::_parse(const std::string& cmdLine)
+    {
+        std::vector<std::string> arguments;
+        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '\0', '\0', false);
+        for (unsigned i = 0; i < tokens.size(); ++i)
+            arguments.push_back(tokens[i]);
+
+        try
+        {
+            // why this? See bFirstTimeParse_ declaration.
+            if (bFirstTimeParse_)
+            {
+                // first shove all the shortcuts in a map
+                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
+                    it != cmdLineArgs_.end(); ++it)
+                {
+                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
+                        "Cannot have two command line shortcut with the same name.");
+                    if (!it->second->getShortcut().empty())
+                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
+                }
+                bFirstTimeParse_ = false;
+            }
+
+            std::string name;
+            std::string shortcut;
+            std::string value;
+            for (unsigned int i = 0; i < arguments.size(); ++i)
+            {
+                if (arguments[i].size() != 0)
+                {
+                    // sure not ""
+                    if (arguments[i][0] == '-')
+                    {
+                        // start with "-"
+                        if (arguments[i].size() == 1)
+                        {
+                            // argument[i] is "-", probably a minus sign
+                            value += "- ";
+                        }
+                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
+                        {
+                            // negative number as a value
+                            value += arguments[i] + ' ';
+                        }
+                        else
+                        {
+                            // can be shortcut or full name argument
+
+                            // save old data first
+                            value = removeTrailingWhitespaces(value);
+                            if (!name.empty())
+                            {
+                                checkFullArgument(name, value);
+                                name.clear();
+                                assert(shortcut.empty());
+                            }
+                            else if (!shortcut.empty())
+                            {
+                                checkShortcut(shortcut, value);
+                                shortcut.clear();
+                                assert(name.empty());
+                            }
+
+                            if (arguments[i][1] == '-')
+                            {
+                                // full name argument with "--name"
+                                name = arguments[i].substr(2);
+                            }
+                            else
+                            {
+                                // shortcut with "-s"
+                                shortcut = arguments[i].substr(1);
+                            }
+
+                            // reset value string
+                            value.clear();
+                        }
+                    }
+                    else
+                    {
+                        // value string
+
+                        if (name.empty() && shortcut.empty())
+                        {
+                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
+                        }
+
+                        // Concatenate strings as long as there's no new argument by "-" or "--"
+                        value += arguments[i] + ' ';
+                    }
+                }
+            }
+
+            // parse last argument
+            value = removeTrailingWhitespaces(value);
+            if (!name.empty())
+            {
+                checkFullArgument(name, value);
+                assert(shortcut.empty());
+            }
+            else if (!shortcut.empty())
+            {
+                checkShortcut(shortcut, value);
+                assert(name.empty());
+            }
+        }
+        catch (const ArgumentException& ex)
+        {
+            orxout(user_error) << "Could not parse command line: " << ex.what() << endl;
+            orxout(user_error) << CommandLineParser::getUsageInformation() << endl;
+            throw GeneralException("");
+        }
+    }
+
+    /**
+    @brief
+        Parses an argument based on its full name.
+    @param name
+        Full name of the argument
+    @param value
+        String containing the value
+    @param bParsingFile
+        Parsing a file or the command line itself
+    */
+    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
+        if (it == cmdLineArgs_.end())
+            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
+
+        it->second->parse(value);
+    }
+
+    /**
+    @brief
+        Parses an argument based on its shortcut.
+    @param shortcut
+        Shortcut to the argument
+    @param value
+        String containing the value
+    @param bParsingFile
+        Parsing a file or the command line itself
+    */
+    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
+        if (it == cmdLineArgsShortcut_.end())
+            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
+
+        it->second->parse(value);
+    }
+
+    std::string CommandLineParser::getUsageInformation()
+    {
+        CommandLineParser& inst = _getInstance();
+        std::ostringstream infoStr;
+
+        // determine maximum name size
+        size_t maxNameSize = 0;
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
+        }
+
+        infoStr << endl;
+        infoStr << "Usage: orxonox [options]" << endl;
+        infoStr << "Available options:" << endl;
+
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            if (!it->second->getShortcut().empty())
+                infoStr << " [-" << it->second->getShortcut() << "] ";
+            else
+                infoStr << "      ";
+            infoStr << "--" << it->second->getName() << ' ';
+            if (it->second->getValue().isType<bool>())
+                infoStr << "    ";
+            else
+                infoStr << "ARG ";
+            // fill with the necessary amount of blanks
+            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
+            infoStr << ": " << it->second->getInformation();
+            infoStr << endl;
+        }
+        return infoStr.str();
+    }
+
+    void CommandLineParser::generateDoc(std::ofstream& file)
+    {
+        file << "/** @page cmdargspage Command Line Arguments Reference" << endl;
+        file << "    @verbatim"; /*no endl*/
+        file << getUsageInformation(); /*no endl*/
+        file << "    @endverbatim" << endl;
+        file << "*/" << endl;
+    }
+
+    /**
+    @brief
+        Retrieves a CommandLineArgument.
+        The method throws an exception if 'name' was not found or the value could not be converted.
+    @note
+        You should of course not call this method before the command line has been parsed.
+    */
+    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+        if (it == _getInstance().cmdLineArgs_.end())
+        {
+            ThrowException(Argument, "Could find command line argument '" + name + "'.");
+        }
+        else
+        {
+            return it->second;
+        }
+    }
+}
Index: code/trunk/src/libraries/core/config/CommandLineParser.h
===================================================================
--- code/trunk/src/libraries/core/config/CommandLineParser.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/CommandLineParser.h	(revision 9667)
@@ -0,0 +1,227 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup CmdArgs Commandline arguments
+    @ingroup Config
+    @brief For a reference of all commandline arguments see @ref cmdargspage
+*/
+
+/**
+    @file
+    @ingroup Config CmdArgs
+    @brief Declaration of CommandLineParser and CommandLineArgument, definition of the SetCommandLineArgument() macros.
+*/
+
+#ifndef _CommandLine_H__
+#define _CommandLine_H__
+
+#include "core/CorePrereqs.h"
+
+#include <fstream>
+#include <map>
+#include "util/OrxAssert.h"
+#include "util/MultiType.h"
+
+#define SetCommandLineArgument(name, defaultValue) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, defaultValue)
+#define SetCommandLineSwitch(name) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, false)
+
+namespace orxonox
+{
+    /**
+    @brief
+        Container class for a command line argument of any type supported by MultiType.
+
+        Whenever you want to have an option specified by a command line switch,
+        you need to first define it with SetCommandLineArgument(name, defaultValue).
+        It is then added to a map and possibly changed when the command line is being parsed.
+        If the option was not given, you can detect this by asking hasDefaultValue().
+
+        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
+        Note the difference between "-" and "--"!
+        Also, there is no restriction to the number of strings you add after --name.
+        So "--startVector {2, 4, 5}" is perfectly legal.
+
+        Retrieving an argument is possible with the getCommandLineArgument function of the
+        CommandLineParser class. It is a Singleton, but the public interface is static.
+    */
+    class _CoreExport CommandLineArgument
+    {
+        friend class CommandLineParser;
+
+    public:
+        //! Tells whether the value has been changed by the command line.
+        bool hasDefaultValue() const { return bHasDefaultValue_; }
+        //! Returns the name of the argument.
+        const std::string& getName() const { return name_; }
+
+        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
+        //! Evaluates to "" if there is none.
+        const std::string& getShortcut() const { return shortcut_; }
+        //! Sets the shortcut for the argument
+        CommandLineArgument& shortcut(const std::string& shortcut)
+        { this->shortcut_ = shortcut; return *this; }
+
+        //! Returns the usage information
+        const std::string& getInformation() const { return this->usageInformation_; }
+        //! Sets the option information when displaying orxonox usage.
+        CommandLineArgument& information(const std::string& usage)
+        { this->usageInformation_ = usage; return *this; }
+
+        //! Returns the actual value of the argument. Can be equal to default value.
+        const MultiType& getValue() const { return value_; }
+        //! Returns the given default value as type T.
+        const MultiType& getDefaultValue() const { return defaultValue_; }
+
+    private:
+        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
+        CommandLineArgument(const std::string& name, const MultiType& defaultValue)
+            : bHasDefaultValue_(true)
+            , name_(name)
+            , value_(defaultValue)
+            , defaultValue_(defaultValue)
+        { }
+
+        //! Undefined copy constructor
+        CommandLineArgument(const CommandLineArgument& instance);
+        ~CommandLineArgument() { }
+
+        //! Parses the value string of a command line argument.
+        void parse(const std::string& value);
+
+        //! Tells whether the value has been changed by the command line.
+        bool bHasDefaultValue_;
+
+    private:
+        std::string name_;             //!< Name of the argument
+        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
+        std::string usageInformation_; //!< Tells about the usage of this parameter
+
+        MultiType   value_;            //!< The actual value
+        MultiType   defaultValue_;     //!< Default value. Should not be changed.
+    };
+
+
+    /**
+    @brief
+        Global interface to command line options.
+        Allows to add and retrieve command line arguments. Also does the parsing.
+    @note
+        Internally it is a Singleton, but the public interface is static.
+    @see
+        CommandLineArgument
+    */
+    class _CoreExport CommandLineParser
+    {
+    public:
+
+        //! Parse redirection to internal member method.
+        static void parse(const std::string& cmdLine)
+        { _getInstance()._parse(cmdLine); }
+
+        static std::string getUsageInformation();
+
+        static const CommandLineArgument* getArgument(const std::string& name);
+        //! Writes the argument value in the given parameter.
+        template <class T>
+        static void getValue(const std::string& name, T* value)
+        { *value = (T)(getArgument(name)->getValue()); }
+        static const MultiType& getValue(const std::string& name)
+        { return getArgument(name)->getValue(); }
+        template <class T>
+        static CommandLineArgument& addArgument(const std::string& name, T defaultValue);
+
+        static bool existsArgument(const std::string& name)
+        {
+            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+            return !(it == _getInstance().cmdLineArgs_.end());
+        }
+
+        static void destroyAllArguments();
+
+        static void generateDoc(std::ofstream& file);
+
+    private:
+        //! Constructor initialises bFirstTimeParse_ with true.
+        CommandLineParser() : bFirstTimeParse_(true) { }
+        //! Undefined copy constructor
+        CommandLineParser(const CommandLineParser& instance);
+        ~CommandLineParser();
+
+        static CommandLineParser& _getInstance();
+
+        void _parse(const std::string& cmdLine);
+        void checkFullArgument(const std::string& name, const std::string& value);
+        void checkShortcut(const std::string& shortcut, const std::string& value);
+
+        /**
+            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
+            So when we call parse() the first time, we need to create a map with all shortcuts since these
+            get added after addCommandLineArgument().
+        */
+        bool bFirstTimeParse_;
+
+        //! Holds all pointers to the arguments and serves as a search map by name.
+        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
+        //! Search map by shortcut for the arguments.
+        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
+    };
+
+    template <>
+    inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value)
+    {
+        *value = getArgument(name)->getValue().get<std::string>();
+    }
+
+    /**
+    @brief
+        Adds a new CommandLineArgument to the internal map.
+        Note that only such arguments are actually valid.
+    @param name
+        Name of the argument. Shortcut can be added later.
+    @param defaultValue
+        Default value that is used when argument was not given.
+    */
+    template <class T>
+    CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue)
+    {
+        OrxAssert(!_getInstance().existsArgument(name),
+            "Cannot add a command line argument with name '" + name + "' twice.");
+        OrxAssert(!MultiType(defaultValue).isType<bool>() || MultiType(defaultValue).get<bool>() != true,
+               "Boolean command line arguments with positive default values are not supported." << endl
+            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
+
+        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue));
+    }
+}
+
+#endif /* _CommandLine_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFile.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFile.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFile.cc	(revision 9667)
@@ -0,0 +1,318 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ConfigFile.
+*/
+
+#include "ConfigFile.h"
+
+#include <boost/filesystem.hpp>
+
+#include "util/Convert.h"
+#include "util/StringUtils.h"
+#include "core/PathConfig.h"
+#include "ConfigFileEntryComment.h"
+#include "ConfigFileEntryValue.h"
+
+namespace orxonox
+{
+    ////////////////
+    // ConfigFile //
+    ////////////////
+
+    const char* ConfigFile::DEFAULT_CONFIG_FOLDER = "defaultConfig";
+
+    /**
+        @brief Constructor: Initializes the config file.
+        @param filename The file-name of this config file
+        @param bCopyFallbackFile If true, the default config file is copied into the config-directory before loading the file
+    */
+    ConfigFile::ConfigFile(const std::string& filename, bool bCopyFallbackFile)
+        : filename_(filename)
+        , bCopyFallbackFile_(bCopyFallbackFile)
+        , bUpdated_(false)
+    {
+    }
+
+    /**
+        @brief Destructor: Deletes all sections and entries.
+    */
+    ConfigFile::~ConfigFile()
+    {
+        this->clear();
+    }
+
+    /**
+        @brief Loads the config file from the hard-disk and reads the sections and their values.
+    */
+    void ConfigFile::load()
+    {
+        // Be sure we start from new in the memory
+        this->clear();
+
+        boost::filesystem::path filepath(this->filename_);
+        if (!filepath.is_complete())
+        {
+            filepath = PathConfig::getConfigPath() / filepath;
+            if (this->bCopyFallbackFile_)
+            {
+                // Look for default file in the data folder
+                if (!boost::filesystem::exists(filepath))
+                {
+                    boost::filesystem::path defaultFilepath(PathConfig::getDataPath() / DEFAULT_CONFIG_FOLDER / this->filename_);
+                    if (boost::filesystem::exists(defaultFilepath))
+                    {
+                        // Try to copy default file from the data folder
+                        try
+                        {
+                            boost::filesystem::copy_file(defaultFilepath, filepath);
+                            orxout(internal_info, context::config) << "Copied " << this->filename_ << " from the default config folder." << endl;
+                        }
+                        catch (const boost::filesystem::filesystem_error& ex)
+                        { orxout(user_error, context::config) << "Error in ConfigFile: " << ex.what() << endl; }
+                    }
+                }
+            }
+        }
+
+        // Open the file
+        std::ifstream file;
+        file.open(filepath.string().c_str(), std::fstream::in);
+        if (file.is_open())
+        {
+            ConfigFileSection* newsection = 0;
+
+            while (file.good() && !file.eof())
+            {
+                std::string line;
+                std::getline(file, line);
+
+                const std::string& temp = getStripped(line);
+                if (!isEmpty(temp) && !isComment(temp))
+                {
+                    size_t   pos1 = temp.find('[');
+                    if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
+                    size_t   pos2 = line.find(']');
+
+                    if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
+                    {
+                        // New section
+                        const std::string& comment = line.substr(pos2 + 1);
+                        if (isComment(comment))
+                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
+                        else
+                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
+                        this->sections_.insert(this->sections_.end(), newsection);
+                        continue;
+                    }
+                }
+
+                if (newsection != 0)
+                {
+                    if (isComment(line))
+                    {
+                        // New comment
+                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
+                        continue;
+                    }
+                    else
+                    {
+                        size_t pos1 = line.find('=');
+
+                        if (pos1 != std::string::npos && pos1 > 0)
+                        {
+                            // New entry
+                            size_t pos2 = line.find('[');
+                            size_t pos3 = line.find(']');
+                            size_t commentposition = getNextCommentPosition(line, pos1 + 1);
+                            while (isBetweenQuotes(line, commentposition))
+                            {
+                                commentposition = getNextCommentPosition(line, commentposition + 1);
+                            }
+                            std::string value, comment;
+                            if (commentposition == std::string::npos)
+                            {
+                                value = line.substr(pos1 + 1);
+                            }
+                            else
+                            {
+                                value = line.substr(pos1 + 1, commentposition - pos1 - 1);
+                                comment = removeTrailingWhitespaces(line.substr(commentposition));
+                            }
+
+                            value = removeTrailingWhitespaces(value);
+                            value = removeSlashes(value);
+
+                            if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
+                            {
+                                // There might be an array index
+                                unsigned int index = 0;
+                                if (convertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
+                                {
+                                    // New array
+                                    std::list<ConfigFileEntry*>::iterator it = newsection->getOrCreateEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
+                                    (*it)->setValue(value);
+                                    (*it)->setComment(comment);
+                                    continue;
+                                }
+                            }
+
+                            // New value
+                            newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
+                            continue;
+                        }
+                    }
+                }
+            }
+
+            file.close();
+
+            orxout(internal_info, context::config) << "Loaded config file \"" << this->filename_ << "\"." << endl;
+
+            // DO NOT save the file --> we can open supposedly read only config files
+        } // end file.is_open()
+    }
+
+    /**
+        @brief Writes the sections and values to the hard-disk.
+    */
+    void ConfigFile::save() const
+    {
+        this->saveAs(this->filename_);
+    }
+
+    /**
+        @brief Writes the sections and values to a given file on the hard-disk.
+    */
+    void ConfigFile::saveAs(const std::string& filename) const
+    {
+        boost::filesystem::path filepath(filename);
+        if (!filepath.is_complete())
+            filepath = PathConfig::getConfigPath() / filename;
+        std::ofstream file;
+        file.open(filepath.string().c_str(), std::fstream::out);
+        file.setf(std::ios::fixed, std::ios::floatfield);
+        file.precision(6);
+
+        if (!file.is_open())
+        {
+            orxout(user_error, context::config) << "Couldn't open config-file \"" << filename << "\"." << endl;
+            return;
+        }
+
+        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+        {
+            file << (*it)->getFileEntry() << endl;
+
+            for (std::list<ConfigFileEntry*>::const_iterator it_entries = (*it)->getEntriesBegin(); it_entries != (*it)->getEntriesEnd(); ++it_entries)
+                file << (*it_entries)->getFileEntry() << endl;
+
+            file << endl;
+        }
+
+        file.close();
+
+        orxout(verbose, context::config) << "Saved config file \"" << filename << "\"." << endl;
+    }
+
+    /**
+        @brief Deletes all sections (which again delete all their values) and clears the list of sections.
+    */
+    void ConfigFile::clear()
+    {
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); )
+            delete (*(it++));
+        this->sections_.clear();
+    }
+
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param section      The name of the section
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
+    void ConfigFile::deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex)
+    {
+        if (ConfigFileSection* sectionPtr = this->getSection(section))
+        {
+            sectionPtr->deleteVectorEntries(name, startindex);
+            this->save();
+        }
+    }
+
+    /**
+        @brief Returns a pointer to the section with given name (or NULL if the section doesn't exist).
+    */
+    ConfigFileSection* ConfigFile::getSection(const std::string& section) const
+    {
+        for (std::list<ConfigFileSection*>::const_iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+            if ((*it)->getName() == section)
+                return (*it);
+        return NULL;
+    }
+
+    /**
+        @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
+    */
+    ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
+    {
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+            if ((*it)->getName() == section)
+                return (*it);
+
+        this->bUpdated_ = true;
+
+        return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section)));
+    }
+
+    /**
+        @brief Saves the config file if it was updated (or if any of its sections were updated).
+    */
+    void ConfigFile::saveIfUpdated()
+    {
+        bool sectionsUpdated = false;
+
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); ++it)
+        {
+            if ((*it)->bUpdated_)
+            {
+                sectionsUpdated = true;
+                (*it)->bUpdated_ = false;
+            }
+        }
+
+        if (this->bUpdated_ || sectionsUpdated)
+        {
+            this->bUpdated_ = false;
+            this->save();
+        }
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigFile.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFile.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFile.h	(revision 9667)
@@ -0,0 +1,178 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFile_H__
+#define _ConfigFile_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFileSection.h"
+
+namespace orxonox
+{
+    ////////////////
+    // ConfigFile //
+    ////////////////
+    /**
+        @brief This class represents a config file, which is stored on the hard-disk and contains config values in different sections.
+
+        It provides an interface to manipulate the sections and values.
+    */
+    class _CoreExport ConfigFile
+    {
+        public:
+            ConfigFile(const std::string& filename, bool bCopyFallbackFile = true);
+            virtual ~ConfigFile();
+
+            virtual void load();
+            virtual void save() const;
+            virtual void saveAs(const std::string& filename) const;
+            virtual void clear();
+
+            /// Returns the file-name of this config file
+            inline const std::string& getFilename()
+                { return this->filename_; }
+
+            /**
+                @brief Stores a value in the config file. If the entry or its section doesn't exist, it's created.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)
+            {
+                this->getOrCreateSection(section)->setValue(name, value, bString);
+                this->save();
+            }
+            /**
+                @brief Returns the value of a given entry in the config file. Returns a blank string if the value doesn't exist.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getValue(const std::string& section, const std::string& name, bool bString)
+            {
+                ConfigFileSection* sectionPtr = this->getSection(section);
+                return (sectionPtr ? sectionPtr->getValue(name, bString) : BLANKSTRING);
+            }
+            /**
+                @brief Returns the value of a given entry in the config file. If it doesn't exist, the entry is created using the fallback value.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
+            {
+                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, fallback, bString);
+                this->saveIfUpdated();
+                return output;
+            }
+
+            /**
+                @brief Stores the value of an element of a vector in the config file. If the entry or its section doesn't exist, it's created.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
+            {
+                this->getOrCreateSection(section)->setValue(name, index, value, bString);
+                this->save();
+            }
+            /**
+                @brief Returns the value of a given element of a vector in the config file. Returns a blank string if the value doesn't exist.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index, bool bString)
+            {
+                ConfigFileSection* sectionPtr = this->getSection(section);
+                return (sectionPtr ? sectionPtr->getValue(name, index, bString) : BLANKSTRING);
+            }
+            /**
+                @brief Returns the value of a given element of a vector in the config file. If it doesn't exist, the entry is created using the fallback value.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            const std::string& getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+            {
+                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, index, fallback, bString);
+                this->saveIfUpdated();
+                return output;
+            }
+
+            void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0);
+            /**
+                @brief Returns the size of a config vector.
+                @param section  The section of the vector
+                @param name     The name of the vector
+            */
+            inline unsigned int getVectorSize(const std::string& section, const std::string& name) const
+            {
+                ConfigFileSection* sectionPtr = this->getSection(section);
+                return (sectionPtr ? sectionPtr->getVectorSize(name) : 0);
+            }
+
+            static const char* DEFAULT_CONFIG_FOLDER;   ///< The folder where the default config files will be stored
+
+        protected:
+            ConfigFileSection* getSection(const std::string& section) const;
+            ConfigFileSection* getOrCreateSection(const std::string& section);
+
+            std::list<ConfigFileSection*> sections_;    ///< A list of sections in this config file
+
+        private:
+            void saveIfUpdated();
+
+            const std::string filename_;                ///< The filename of this config file
+            const bool bCopyFallbackFile_;              ///< If true, the default config file is copied into the config-directory before loading the file
+            bool bUpdated_;                             ///< Becomes true if a section is added
+    };
+}
+
+#endif /* _ConfigFile_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileEntry.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntry.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntry.h	(revision 9667)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFileEntry_H__
+#define _ConfigFileEntry_H__
+
+#include "core/CorePrereqs.h"
+
+namespace orxonox
+{
+    /////////////////////
+    // ConfigFileEntry //
+    /////////////////////
+    /**
+        @brief This class represents an entry in the config file.
+
+        This class is pure virtual. Use one of the derived classes to define the type of the entry.
+    */
+    class _CoreExport ConfigFileEntry
+    {
+        public:
+            /// Destructor
+            virtual ~ConfigFileEntry() {};
+
+            /// Changes the value of the entry.
+            virtual void setValue(const std::string& value) = 0;
+            /// Returns the value of the entry.
+            virtual const std::string& getValue() const = 0;
+
+            /// Returns the name of the entry
+            virtual const std::string& getName() const = 0;
+
+            /// Changes the comment of the entry (will be placed after the value)
+            virtual void setComment(const std::string& comment) = 0;
+
+            /// Returns the index of the entry in a vector (used only if it is a vector)
+            virtual unsigned int getIndex() const { return 0; }
+
+            /// Defines if this entry is treated as string which means some special treatment of special characters.
+            virtual void setString(bool bString) = 0;
+
+            /// Returns the line as it will be stored in the config file.
+            virtual const std::string& getFileEntry() const = 0;
+    };
+}
+
+#endif /* _ConfigFileEntry_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileEntryComment.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntryComment.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntryComment.h	(revision 9667)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFileEntryComment_H__
+#define _ConfigFileEntryComment_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFileEntry.h"
+
+namespace orxonox
+{
+    ////////////////////////////
+    // ConfigFileEntryComment //
+    ////////////////////////////
+    /**
+        @brief This class represents a line in the config file which contains only a comment.
+    */
+    class _CoreExport ConfigFileEntryComment : public ConfigFileEntry
+    {
+        public:
+            /// Constructor: Initializes the object.
+            inline ConfigFileEntryComment(const std::string& comment) : comment_(comment) {}
+
+            /// Destructor
+            inline virtual ~ConfigFileEntryComment() {}
+
+            inline virtual const std::string& getName() const
+                { return this->comment_; }
+
+            inline virtual void setComment(const std::string& comment)
+                { this->comment_ = comment; }
+
+            inline virtual void setValue(const std::string& value)
+                {}
+            inline virtual const std::string& getValue() const
+                { return BLANKSTRING; }
+
+            inline void setString(bool bString)
+                {}
+
+            inline virtual const std::string& getFileEntry() const
+                { return this->comment_; }
+
+        private:
+            std::string comment_;   ///< The comment
+    };
+}
+
+#endif /* _ConfigFileEntryComment_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileEntryValue.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntryValue.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntryValue.cc	(revision 9667)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ConfigFileEntryValue.
+*/
+
+#include "ConfigFileEntryValue.h"
+
+#include "util/StringUtils.h"
+
+namespace orxonox
+{
+    //////////////////////////
+    // ConfigFileEntryValue //
+    //////////////////////////
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, comment) has changed.
+    */
+    void ConfigFileEntryValue::update()
+    {
+        // Make sure we remove the quotes when bString changes
+        if (this->bString_)
+            this->value_ = stripEnclosingQuotes(this->value_);
+        // Assemble the entry line
+        this->fileEntry_ = this->getKeyString() + " = ";
+        if (this->bString_ && !this->value_.empty())
+            this->fileEntry_ += '"' + addSlashes(this->value_) + '"';
+        else
+            this->fileEntry_ += this->value_;
+        if (!this->additionalComment_.empty())
+            this->fileEntry_ += ' ' + this->additionalComment_;
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigFileEntryValue.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntryValue.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntryValue.h	(revision 9667)
@@ -0,0 +1,102 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFileEntryValue_H__
+#define _ConfigFileEntryValue_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFileEntry.h"
+
+namespace orxonox
+{
+    //////////////////////////
+    // ConfigFileEntryValue //
+    //////////////////////////
+    /**
+        @brief This class represents a normal value in the config file.
+    */
+    class _CoreExport ConfigFileEntryValue : public ConfigFileEntry
+    {
+        public:
+            /**
+                @brief Constructor: Initializes the entry.
+
+                @param name                 The name of the entry
+                @param value                The value of the entry
+                @param bString              If true, the value is treated as string which means some special treatment of special characters.
+                @param additionalComment    An optional comment that will be placed behind the value in the config file
+            */
+            inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
+                : name_(name)
+                , value_(value)
+                , additionalComment_(additionalComment)
+                , bString_(bString)
+                { this->update(); }
+
+            /// Destructor
+            inline virtual ~ConfigFileEntryValue() {}
+
+            inline virtual const std::string& getName() const
+                { return this->name_; }
+
+            inline virtual void setComment(const std::string& comment)
+                { this->additionalComment_ = comment; this->update(); }
+
+            inline virtual void setValue(const std::string& value)
+                { this->value_ = value; this->update(); }
+            inline virtual const std::string& getValue() const
+                { return this->value_; }
+
+            inline void virtual setString(bool bString)
+                { this->bString_ = bString; this->update(); }
+
+            inline virtual const std::string& getFileEntry() const
+                { return this->fileEntry_; }
+
+            /// Returns the "key" of the value (in this case it's just the name of the entry, but for vectors it's different)
+            inline virtual const std::string& getKeyString() const
+                { return this->name_; }
+
+        protected:
+            virtual void update();
+
+            const std::string name_;            ///< The name of the value
+            std::string value_;                 ///< The value
+            std::string additionalComment_;     ///< The additional comment
+            std::string fileEntry_;             ///< The string as it will be stored in the config file
+            bool bString_;                      ///< If true, the value is treated as string which means some special treatment of special characters.
+    };
+}
+
+#endif /* _ConfigFileEntryValue_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.cc	(revision 9667)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ConfigFileEntryVectorValue.
+*/
+
+#include "ConfigFileEntryVectorValue.h"
+
+#include "util/Convert.h"
+
+namespace orxonox
+{
+    ////////////////////////////////
+    // ConfigFileEntryVectorValue //
+    ////////////////////////////////
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, index, comment) has changed.
+    */
+    void ConfigFileEntryVectorValue::update()
+    {
+        this->keyString_ = this->name_ + '[' + multi_cast<std::string>(this->index_) + ']';
+        ConfigFileEntryValue::update();
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileEntryVectorValue.h	(revision 9667)
@@ -0,0 +1,84 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFileEntryVectorValue_H__
+#define _ConfigFileEntryVectorValue_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFileEntryValue.h"
+
+namespace orxonox
+{
+    ////////////////////////////////
+    // ConfigFileEntryVectorValue //
+    ////////////////////////////////
+    /**
+        @brief Subclass of ConfigFileEntryValue, represents an element of a vector.
+    */
+    class _CoreExport ConfigFileEntryVectorValue : public ConfigFileEntryValue
+    {
+        public:
+            /**
+                @brief Constructor: Initializes the entry.
+
+                @param name                 The name of the vector
+                @param index                The index of the element in the vector
+                @param value                The value of the element
+                @param bString              If true, the value is treated as string which means some special treatment of special characters.
+                @param additionalComment    An optional comment that will be placed behind the value in the config file
+            */
+            inline ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
+                : ConfigFileEntryValue(name, value, bString, additionalComment)
+                , index_(index)
+                { this->update(); /*No virtual calls in base class ctor*/ }
+
+            /// Destructor
+            inline ~ConfigFileEntryVectorValue() {}
+
+            inline unsigned int getIndex() const
+                { return this->index_; }
+
+            /// Returns the "key" of the value (the name of the vector plus the index of the element)
+            inline const std::string& getKeyString() const
+                { return this->keyString_; }
+
+        private:
+            void update();
+
+            unsigned int index_;        ///< The index of the element in the vector
+            std::string keyString_;     ///< The full name of the entry (the name of the vector plus the index of the element)
+    };
+}
+
+#endif /* _ConfigFileEntryVectorValue_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileManager.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileManager.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileManager.cc	(revision 9667)
@@ -0,0 +1,78 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ConfigFileManager.
+*/
+
+#include "ConfigFileManager.h"
+
+#include "SettingsConfigFile.h"
+
+namespace orxonox
+{
+    ///////////////////////
+    // ConfigFileManager //
+    ///////////////////////
+
+    ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;
+
+    /// Constructor: Initializes the array of config files with NULL.
+    ConfigFileManager::ConfigFileManager()
+    {
+        this->configFiles_.assign(NULL);
+    }
+
+    /// Destructor: Deletes the config files.
+    ConfigFileManager::~ConfigFileManager()
+    {
+        for (boost::array<ConfigFile*, 3>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+            if (*it)
+                delete (*it);
+    }
+
+    /// Defines the file-name for the config file of a given type (settings, calibration, etc.).
+    void ConfigFileManager::setFilename(ConfigFileType::Value type, const std::string& filename)
+    {
+        if (this->getConfigFile(type))
+            delete this->configFiles_[type];
+        // Create and load config file
+        switch (type)
+        {
+        case ConfigFileType::Settings:
+            this->configFiles_[type] = new SettingsConfigFile(filename);
+            break;
+        case ConfigFileType::JoyStickCalibration:
+        case ConfigFileType::CommandHistory:
+            this->configFiles_[type] = new ConfigFile(filename);
+            break;
+        }
+        this->configFiles_[type]->load();
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigFileManager.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileManager.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileManager.h	(revision 9667)
@@ -0,0 +1,76 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+    @brief Declaration of ConfigFileManager, used to load and save config files.
+*/
+
+#ifndef _ConfigFileManager_H__
+#define _ConfigFileManager_H__
+
+#include "core/CorePrereqs.h"
+
+#include <boost/array.hpp>
+
+#include "util/Singleton.h"
+
+namespace orxonox
+{
+    ///////////////////////
+    // ConfigFileManager //
+    ///////////////////////
+    /**
+        @brief Manages the different config files (settings, calibration, etc). Implemented as Singleton.
+    */
+    class _CoreExport ConfigFileManager : public Singleton<ConfigFileManager>
+    {
+        friend class Singleton<ConfigFileManager>;
+        public:
+            ConfigFileManager();
+            ~ConfigFileManager();
+
+            void setFilename(ConfigFileType::Value type, const std::string& filename);
+
+            /// Returns the config file of a given type (settings, calibration, etc.)
+            inline ConfigFile* getConfigFile(ConfigFileType::Value type)
+            {
+                // Check array bounds
+                return configFiles_.at(type);
+            }
+
+        private:
+            ConfigFileManager(const ConfigFileManager&);    ///< Copy-constructor: not implemented
+
+            boost::array<ConfigFile*, 3> configFiles_;      ///< Stores the config files for each type in an array (must have the same size like ConfigFileType::Value)
+            static ConfigFileManager* singletonPtr_s;       ///< Stores the singleton-pointer
+    };
+}
+
+#endif /* _ConfigFileManager_H__ */
Index: code/trunk/src/libraries/core/config/ConfigFileSection.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileSection.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileSection.cc	(revision 9667)
@@ -0,0 +1,180 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ConfigFileSection.
+*/
+
+#include "ConfigFileSection.h"
+
+#include "ConfigFileEntryValue.h"
+#include "ConfigFileEntryVectorValue.h"
+
+namespace orxonox
+{
+    ///////////////////////
+    // ConfigFileSection //
+    ///////////////////////
+    /**
+        @brief Destructor: Deletes all entries.
+    */
+    ConfigFileSection::~ConfigFileSection()
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
+            delete (*(it++));
+    }
+
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
+    void ConfigFileSection::deleteVectorEntries(const std::string& name, unsigned int startindex)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); )
+        {
+            if (((*it)->getName() == name) && ((*it)->getIndex() >= startindex))
+            {
+                delete (*it);
+                this->entries_.erase(it++);
+            }
+            else
+            {
+                ++it;
+            }
+        }
+    }
+
+    /**
+        @brief Returns the size of a config vector.
+        @param name     The name of the vector
+    */
+    unsigned int ConfigFileSection::getVectorSize(const std::string& name) const
+    {
+        unsigned int size = 0;
+        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+            if ((*it)->getName() == name)
+                if ((*it)->getIndex() >= size)
+                    size = (*it)->getIndex() + 1;
+        return size;
+    }
+
+    /**
+        @brief Returns the title and comment of the section as it will be stored in the file.
+    */
+    std::string ConfigFileSection::getFileEntry() const
+    {
+        if (this->additionalComment_.empty())
+            return ('[' + this->name_ + ']');
+        else
+            return ('[' + this->name_ + "] " + this->additionalComment_);
+    }
+
+    /**
+        @brief Returns the entry with given name (or NULL if it doesn't exist).
+
+        @param name     The name of the entry
+    */
+    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
+    {
+        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if ((*it)->getName() == name)
+                return *it;
+        }
+        return NULL;
+    }
+
+    /**
+        @brief Returns the entry of a vector element with given name and index (or NULL if it doesn't exist).
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+    */
+    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
+    {
+        for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if (((*it)->getName() == name) && ((*it)->getIndex() == index))
+                return *it;
+        }
+        return NULL;
+    }
+
+    /**
+        @brief Returns the iterator to the entry with given name. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the entry
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
+    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if ((*it)->getName() == name)
+            {
+                (*it)->setString(bString);
+                return it;
+            }
+        }
+
+        this->bUpdated_ = true;
+
+        return this->entries_.insert(this->entries_.end(), new ConfigFileEntryValue(name, fallback, bString));
+    }
+
+    /**
+        @brief Returns the iterator to the entry of a vector element with given name and index. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
+    std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+    {
+        for (std::list<ConfigFileEntry*>::iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
+        {
+            if (((*it)->getName() == name) && ((*it)->getIndex() == index))
+            {
+                (*it)->setString(bString);
+                return it;
+            }
+        }
+
+        this->bUpdated_ = true;
+
+        if (index == 0)
+            return this->entries_.insert(this->entries_.end(), new ConfigFileEntryVectorValue(name, index, fallback, bString));
+        else
+            return this->entries_.insert(++this->getOrCreateEntryIterator(name, index - 1, "", bString), new ConfigFileEntryVectorValue(name, index, fallback, bString));
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigFileSection.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigFileSection.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigFileSection.h	(revision 9667)
@@ -0,0 +1,200 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _ConfigFileSection_H__
+#define _ConfigFileSection_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFileEntry.h"
+
+namespace orxonox
+{
+    ///////////////////////
+    // ConfigFileSection //
+    ///////////////////////
+    /**
+        @brief Represents a section in a config file.
+
+        A section has a name and a list of config values.
+    */
+    class _CoreExport ConfigFileSection
+    {
+        friend class ConfigFile;
+        friend class SettingsConfigFile;
+
+        public:
+            /**
+                @brief Constructor: Initializes the section.
+
+                @param name The name of the section
+                @param additionalComment An additional comment placed after the title of the section in the config file
+            */
+            inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "")
+                : name_(name)
+                , additionalComment_(additionalComment)
+                , bUpdated_(false)
+                {}
+            ~ConfigFileSection();
+
+            /// Returns the name of the section.
+            inline const std::string& getName() const
+                { return this->name_; }
+
+            /// Changes the comment which is placed after the title of the section in the config file.
+            inline void setComment(const std::string& comment)
+                { this->additionalComment_ = comment; }
+
+            /**
+                @brief Stores a value in the section. If the entry doesn't exist, it's created.
+
+                @param name     The name of the entry
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline void setValue(const std::string& name, const std::string& value, bool bString)
+                { this->getOrCreateEntry(name, value, bString)->setValue(value); }
+            /**
+                @brief Returns the value of a given entry in the section. Returns a blank string if the value doesn't exist.
+
+                @param name     The name of the entry
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getValue(const std::string& name, bool bString)
+            {
+                ConfigFileEntry* entry = this->getEntry(name);
+                if (entry)
+                {
+                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
+                    return entry->getValue();
+                }
+                return BLANKSTRING;
+            }
+            /**
+                @brief Returns the value of a given entry in the section. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getOrCreateValue(const std::string& name, const std::string& fallback, bool bString)
+                { return this->getOrCreateEntry(name, fallback, bString)->getValue(); }
+
+            /**
+                @brief Stores the value of an element of a vector in the section. If the entry doesn't exist, it's created.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)
+                { this->getOrCreateEntry(name, index, value, bString)->setValue(value); }
+            /**
+                @brief Returns the value of a given element of a vector in the section. Returns a blank string if the value doesn't exist.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getValue(const std::string& name, unsigned int index, bool bString)
+            {
+                ConfigFileEntry* entry = this->getEntry(name, index);
+                if (entry)
+                {
+                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
+                    return entry->getValue();
+                }
+                return BLANKSTRING;
+            }
+            /**
+                @brief Returns the value of a given element of a vector in the section. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getOrCreateValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { return this->getOrCreateEntry(name, index, fallback, bString)->getValue(); }
+
+            void deleteVectorEntries(const std::string& name, unsigned int startindex = 0);
+            unsigned int getVectorSize(const std::string& name) const;
+
+            std::string getFileEntry() const;
+
+        private:
+            /// Returns the list of entries in this section.
+            std::list<ConfigFileEntry*>& getEntries()
+                { return this->entries_; }
+            /// Returns the begin-iterator of the list of entries in this section.
+            std::list<ConfigFileEntry*>::const_iterator getEntriesBegin() const
+                { return this->entries_.begin(); }
+            /// Returns the end-iterator of the list of entries in this section.
+            std::list<ConfigFileEntry*>::const_iterator getEntriesEnd() const
+                { return this->entries_.end(); }
+
+            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString);
+            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString);
+
+            ConfigFileEntry* getEntry(const std::string& name) const;
+            /**
+                @brief Returns the entry with given name. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline ConfigFileEntry* getOrCreateEntry(const std::string& name, const std::string& fallback, bool bString)
+                { return (*this->getOrCreateEntryIterator(name, fallback, bString)); }
+
+            ConfigFileEntry* getEntry(const std::string& name, unsigned int index) const;
+            /**
+                @brief Returns the entry that contains an element of a vector with given name. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline ConfigFileEntry* getOrCreateEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+                { return (*this->getOrCreateEntryIterator(name, index, fallback, bString)); }
+
+            std::string name_;                      ///< The name of the section
+            std::string additionalComment_;         ///< The additional comment which is placed after the title of the section in the config file
+            std::list<ConfigFileEntry*> entries_;   ///< The list of entries in this section
+            bool bUpdated_;                         ///< True if an entry is created
+    };
+}
+
+#endif /* _ConfigFileSection_H__ */
Index: code/trunk/src/libraries/core/config/ConfigValueContainer.cc
===================================================================
--- code/trunk/src/libraries/core/config/ConfigValueContainer.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigValueContainer.cc	(revision 9667)
@@ -0,0 +1,353 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the ConfigValueContainer class.
+*/
+
+#include "ConfigValueContainer.h"
+
+#include "util/Convert.h"
+#include "util/SubString.h"
+#include "core/Language.h"
+#include "ConfigFileManager.h"
+#include "SettingsConfigFile.h"
+
+namespace orxonox
+{
+    const unsigned int MAX_VECTOR_INDEX  = 255; // to avoid up to 4*10^9 vector entries in the config file after accidentally using a wrong argument
+
+    /**
+        @brief Initializes the ConfigValueContainer with default values.
+    */
+    void ConfigValueContainer::init(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname)
+    {
+        this->type_ = type;
+        this->identifier_ = identifier;
+        this->sectionname_ = sectionname;
+        this->varname_ = varname;
+        this->callback_ = 0;
+        this->bContainerIsNew_ = true;
+        this->bDoInitialCallback_ = false;
+        this->bAddedDescription_ = false;
+
+        // Register containers for general settings
+        if (this->type_ == ConfigFileType::Settings)
+            SettingsConfigFile::getInstance().addConfigValueContainer(this);
+    }
+
+    /**
+        @brief Does some special initialization for single config-values.
+    */
+    void ConfigValueContainer::initValue(const MultiType& defvalue)
+    {
+        this->value_ = defvalue;
+        this->bIsVector_ = false;
+
+        this->defvalueString_ = this->value_.get<std::string>();
+        this->update();
+    }
+
+    /**
+        @brief Does some special initialization for vector config-values.
+    */
+    void ConfigValueContainer::initVector()
+    {
+        this->bIsVector_ = true;
+
+        for (unsigned int i = 0; i < this->valueVector_.size(); i++)
+        {
+            ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType<std::string>());
+            this->defvalueStringVector_.push_back(this->valueVector_[i]);
+        }
+
+        this->update();
+    }
+
+    /**
+        @brief Destructor: Deletes the callback object if necessary.
+    */
+    ConfigValueContainer::~ConfigValueContainer()
+    {
+        if (this->callback_)
+            delete this->callback_;
+
+        // Unregister general settings containers
+        if (this->type_ == ConfigFileType::Settings && SettingsConfigFile::exists())
+            SettingsConfigFile::getInstance().removeConfigValueContainer(this);
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::set(const MultiType& input)
+    {
+        if (this->bIsVector_)
+        {
+            return this->callFunctionWithIndex(&ConfigValueContainer::set, input);
+        }
+        else
+        {
+            if (this->tset(input))
+            {
+                ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, input, this->value_.isType<std::string>());
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects and writes the change into the config-file.
+        @param index The index in the vector
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::set(unsigned int index, const MultiType& input)
+    {
+        if (this->bIsVector_)
+        {
+            if (this->tset(index, input))
+            {
+                ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, index, input, this->value_.isType<std::string>());
+                return true;
+            }
+        }
+        else
+        {
+            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
+        }
+        return false;
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
+        @param input The new value. If bIsVector_ then write "index value"
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::tset(const MultiType& input)
+    {
+        if (this->bIsVector_)
+        {
+            return this->callFunctionWithIndex(&ConfigValueContainer::tset, input);
+        }
+        else
+        {
+            this->value_ = input;
+
+            if (this->identifier_)
+                this->identifier_->updateConfigValues();
+
+            return true;
+        }
+    }
+
+    /**
+        @brief Assigns a new value to the config-value of all objects, but doesn't change the config-file (t stands for temporary).
+        @param index The index in the vector
+        @param input The new value
+        @return True if the new value was successfully assigned
+    */
+    bool ConfigValueContainer::tset(unsigned int index, const MultiType& input)
+    {
+        if (this->bIsVector_)
+        {
+            if (index > MAX_VECTOR_INDEX)
+            {
+                orxout(user_error, context::config) << "Index " << index << " is too large." << endl;
+                return false;
+            }
+
+            if (index >= this->valueVector_.size())
+            {
+                for (unsigned int i = this->valueVector_.size(); i <= index; i++)
+                {
+                    this->valueVector_.push_back(MultiType());
+                }
+            }
+
+            this->valueVector_[index] = input;
+
+            if (this->identifier_)
+                this->identifier_->updateConfigValues();
+
+            return true;
+        }
+        else
+        {
+            orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
+            return false;
+        }
+    }
+
+    /**
+        @brief Adds a new entry to the end of the vector.
+        @param input The new entry
+        @return True if the new entry was successfully added
+    */
+    bool ConfigValueContainer::add(const MultiType& input)
+    {
+        if (this->bIsVector_)
+            return this->set(this->valueVector_.size(), input);
+
+        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
+        return false;
+    }
+
+    /**
+        @brief Removes an existing entry from the vector.
+        @param index The index of the entry
+        @return True if the entry was removed
+    */
+    bool ConfigValueContainer::remove(unsigned int index)
+    {
+        if (this->bIsVector_)
+        {
+            if (index < this->valueVector_.size())
+            {
+                // Erase the entry from the vector, change (shift) all entries beginning with index in the config file, remove the last entry from the file
+                this->valueVector_.erase(this->valueVector_.begin() + index);
+                for (unsigned int i = index; i < this->valueVector_.size(); i++)
+                    ConfigFileManager::getInstance().getConfigFile(this->type_)->setValue(this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType<std::string>());
+                ConfigFileManager::getInstance().getConfigFile(this->type_)->deleteVectorEntries(this->sectionname_, this->varname_, this->valueVector_.size());
+
+                return true;
+            }
+            orxout(user_error, context::config) << "Invalid vector-index." << endl;
+        }
+
+        orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << endl;
+        return false;
+    }
+
+    /**
+        @brief Sets the value of the variable back to the default value and resets the config-file entry.
+    */
+    bool ConfigValueContainer::reset()
+    {
+        if (!this->bIsVector_)
+            return this->set(this->defvalueString_);
+        else
+        {
+            bool success = true;
+            for (unsigned int i = 0; i < this->defvalueStringVector_.size(); i++)
+                if (!this->set(i, this->defvalueStringVector_[i]))
+                    success = false;
+            ConfigFileManager::getInstance().getConfigFile(this->type_)->deleteVectorEntries(this->sectionname_, this->varname_, this->defvalueStringVector_.size());
+            return success;
+        }
+    }
+
+    /**
+        @brief Retrieves the configured value from the currently loaded config-file.
+    */
+    void ConfigValueContainer::update()
+    {
+        if (!this->bIsVector_)
+            this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType<std::string>());
+        else
+        {
+            this->valueVector_.clear();
+            unsigned int vectorSize = ConfigFileManager::getInstance().getConfigFile(this->type_)->getVectorSize(this->sectionname_, this->varname_);
+            for (unsigned int i = 0; i < vectorSize; i++)
+            {
+                if (i < this->defvalueStringVector_.size())
+                {
+                    this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType<std::string>());
+                }
+                else
+                {
+                    this->value_ = ConfigFileManager::getInstance().getConfigFile(this->type_)->getOrCreateValue(this->sectionname_, this->varname_, i, MultiType(), this->value_.isType<std::string>());
+                }
+
+                this->valueVector_.push_back(this->value_);
+            }
+        }
+    }
+
+    /**
+        @brief Calls the given function with parsed index and the parsed argument from the input string.
+        @param function The function to call
+        @param input The input string
+        @return The returnvalue of the functioncall
+    */
+    bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input)
+    {
+        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '\0', '\0', false, '\0');
+        int index = -1;
+        bool success = false;
+
+        if (token.size() > 0)
+            success = convertValue(&index, token[0]);
+
+        if (!success || index < 0 || index > (signed int)MAX_VECTOR_INDEX)
+        {
+            if (!success)
+            {
+                orxout(user_error, context::config) << "Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is a vector." << endl;
+            }
+            else
+            {
+                orxout(user_error, context::config) << "Invalid vector-index." << endl;
+            }
+            return false;
+        }
+
+        if (token.size() >= 2)
+            return (this->*function)(index, token.subSet(1).join());
+        else
+            return (this->*function)(index, "");
+    }
+
+    /**
+        @brief Adds a description to the config-value.
+        @param description The description
+    */
+    ConfigValueContainer& ConfigValueContainer::description(const std::string& description)
+    {
+        if (!this->bAddedDescription_)
+        {
+            this->description_ = std::string("ConfigValueDescription::" + this->sectionname_ + "::" + this->varname_);
+            AddLanguageEntry(this->description_, description);
+            this->bAddedDescription_ = true;
+        }
+        return (*this);
+    }
+
+    /**
+        @brief Returns the description of the config-value.
+        @return The description
+    */
+    const std::string& ConfigValueContainer::getDescription() const
+    {
+        return GetLocalisation(this->description_);
+    }
+}
Index: code/trunk/src/libraries/core/config/ConfigValueContainer.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigValueContainer.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigValueContainer.h	(revision 9667)
@@ -0,0 +1,305 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+    @brief Declaration of the ConfigValueContainer class, caches a config-value.
+
+    The ConfigValueContainer class contains all needed information about a configurable variable:
+     - the name of the variable
+     - the name of the class the variable belongs to
+     - the default value
+     - the user-specified value
+     - a pointer to the entry in the config-file
+
+    This is needed to assign the configured values to all newly created objects.
+*/
+
+#ifndef _ConfigValueContainer_H__
+#define _ConfigValueContainer_H__
+
+#include "core/CorePrereqs.h"
+
+#include <string>
+#include <vector>
+
+#include "util/MultiType.h"
+#include "core/class/Identifier.h"
+
+namespace orxonox
+{
+    class ConfigValueCallbackBase
+    {
+        public:
+            virtual void call(void* object) = 0;
+            inline virtual ~ConfigValueCallbackBase() {}
+    };
+
+    template <class T>
+    class ConfigValueCallback: public ConfigValueCallbackBase
+    {
+        public:
+            inline ConfigValueCallback(void (T::*function) (void)) : function_(function) {}
+            inline virtual ~ConfigValueCallback() {}
+            inline virtual void call(void* object)
+            {
+                if (!IdentifierManager::getInstance().isCreatingHierarchy())
+                    (static_cast<T*>(object)->*this->function_)();
+            }
+
+        private:
+            void (T::*function_) (void);
+    };
+
+
+    /**
+        @brief The ConfigValuecontainer contains all needed information about a configurable variable.
+
+        The ConfigValueContainer class contains all needed information about a configurable variable:
+         - the name of the variable
+         - the name of the class the variable belongs to
+         - the default value
+         - the user-specified value
+         - a pointer to the entry in the config-file
+
+        This is needed to assign the configured values to all newly created objects.
+
+        The container searches for the entry in the config file.
+        If there is an entry, it parses the specified value and assigns it to the variable of the right type.
+        If there is no entry, it adds the entry with the default-value to the section of the variables class.
+        If there is no section, the section and the entry are added to the end of the config-file.
+    */
+    class _CoreExport ConfigValueContainer
+    {
+        public:
+            /**
+                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
+                @param type The type of the corresponding config-file
+                @param identifier The identifier of the class the variable belongs to
+                @param sectionname Name of the section the configValue should be put in.
+                @param varname The name of the variable
+                @param defvalue The default-value
+                @param value Only needed do determine the right type.
+            */
+            template <class D, class V>
+            ConfigValueContainer(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname, const D& defvalue, const V&)
+            {
+                this->init(type, identifier, sectionname, varname);
+                this->initValue(static_cast<V>(defvalue));
+            }
+
+            /**
+                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
+                @param type The type of the corresponding config-file
+                @param identifier The identifier of the class the variable belongs to
+                @param sectionname Name of the section the configValue should be put in.
+                @param varname The name of the variable
+                @param defvalue The default-value
+                @param value Only needed do determine the right type.
+            */
+            template <class D, class V>
+            ConfigValueContainer(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname, const std::vector<D>& defvalue, const std::vector<V>&)
+            {
+                this->init(type, identifier, sectionname, varname);
+
+                this->value_ = V();
+                for (unsigned int i = 0; i < defvalue.size(); i++)
+                    this->valueVector_.push_back(MultiType(defvalue[i]));
+
+                this->initVector();
+            }
+
+            ~ConfigValueContainer();
+
+            /**
+                @brief Returns the configured value.
+                @param value A pointer to the variable to store the value.
+                @param object The object calling this function
+                @return The ConfigValueContainer
+            */
+            template <typename T, class C>
+            ConfigValueContainer& getValue(T* value, C* object)
+            {
+                if ((this->callback_ && object) || this->bContainerIsNew_)
+                {
+                    T temp = *value;
+                    this->value_.getValue(value);
+                    if (this->bContainerIsNew_ || (*value) != temp)
+                    {
+                        this->bContainerIsNew_ = false;
+                        if (this->callback_ && object)
+                            this->callback_->call(object);
+                        else
+                            this->bDoInitialCallback_ = true;
+                    }
+                }
+                else
+                {
+                    this->value_.getValue(value);
+                }
+                return *this;
+            }
+
+            /**
+                @brief Returns the configured vector.
+                @param value A pointer to the vector to store the values.
+                @param object The object calling this function
+                @return The ConfigValueContainer
+            */
+            template <typename T, class C>
+            ConfigValueContainer& getValue(std::vector<T>* value, C* object)
+            {
+                if ((this->callback_ && object) || this->bContainerIsNew_)
+                {
+                    if (this->bContainerIsNew_)
+                        this->bContainerIsNew_ = false;
+
+                    std::vector<T> temp = *value;
+                    value->clear();
+                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
+                        value->push_back(this->valueVector_[i]);
+
+                    if (value->size() != temp.size())
+                    {
+                        if (this->callback_ && object)
+                            this->callback_->call(object);
+                        else
+                            this->bDoInitialCallback_ = true;
+                    }
+                    else
+                    {
+                        for (unsigned int i = 0; i < value->size(); ++i)
+                        {
+                            if ((*value)[i] != temp[i])
+                            {
+                                if (this->callback_ && object)
+                                    this->callback_->call(object);
+                                else
+                                    this->bDoInitialCallback_ = true;
+                                break;
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    value->clear();
+                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
+                        value->push_back(this->valueVector_[i]);
+                }
+                return *this;
+            }
+
+            /// Returns the name of this container.
+            inline const std::string& getName() const
+                { return this->varname_; }
+            /// Returns the name of the section this config value is in.
+            inline const std::string& getSectionName() const
+                { return this->sectionname_; }
+            /// Returns the associated identifier (can be NULL).
+            inline Identifier* getIdentifier() const
+                { return this->identifier_; }
+            /// Returns true if this config-value is a vector.
+            inline bool isVector() const
+                { return this->bIsVector_; }
+            /// Returns the vectors size (or zero if it's not a vector).
+            inline unsigned int getVectorSize() const
+                { return this->valueVector_.size(); }
+
+            ConfigValueContainer& description(const std::string& description);
+            const std::string& getDescription() const;
+
+            /**
+                @brief Adds a callback function, that gets called after getValue() if the newly assigned value differs from the old value of the variable.
+                @param object The object to call the function
+                @param function The callback function
+            */
+            template <class T>
+            inline ConfigValueContainer& callback(T* object, void (T::*function) (void))
+            {
+                if (!this->callback_)
+                {
+                    this->callback_ = new ConfigValueCallback<T>(function);
+
+                    if (this->bDoInitialCallback_)
+                    {
+                        this->bDoInitialCallback_ = false;
+                        this->callback_->call(object);
+                    }
+                }
+
+                return (*this);
+            }
+
+            bool set(const MultiType& input);
+            bool tset(const MultiType& input);
+
+            bool set(unsigned int index, const MultiType& input);
+            bool tset(unsigned int index, const MultiType& input);
+            bool add(const MultiType& input);
+            bool remove(unsigned int index);
+
+            bool reset();
+            void update();
+
+            /// Converts the config-value to a string.
+            inline std::string toString() const
+                { return this->value_; }
+            /// Returns the typename of the assigned config-value.
+            inline std::string getTypename() const
+                { return this->value_.getTypename(); }
+
+        private:
+            void init(ConfigFileType::Value type, Identifier* identifier, const std::string& sectionname, const std::string& varname);
+            void initValue(const MultiType& defvalue);
+            void initVector();
+            bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input);
+
+            bool                       bIsVector_;                  //!< True if the container contains a std::vector
+
+            ConfigFileType::Value      type_;                       //!< The type of the corresponding config-file
+            Identifier*                identifier_;                 //!< The identifier of the class
+            std::string                sectionname_;                //!< The name of the class the variable belongs to
+            std::string                varname_;                    //!< The name of the variable
+            std::string                defvalueString_;             //!< The string of the default-value
+            std::vector<std::string>   defvalueStringVector_;       //!< A vector, containg the strings of the default-values in case we're storing a vector
+
+            MultiType                  value_;                      //!< The value
+            std::vector<MultiType>     valueVector_;                //!< A vector, containg the values in case we're storing a vector
+
+            bool                       bAddedDescription_;          //!< True if a description was added
+            LanguageEntryLabel         description_;                //!< The description
+            ConfigValueCallbackBase*   callback_;                   //!< A callback function to call after getValue if the value changed
+
+            bool                       bContainerIsNew_;            //!< True if it's the first time getValue() gets called
+            bool                       bDoInitialCallback_;         //!< True if the callback should be called as soon as it gets created
+    };
+}
+
+#endif /* _ConfigValueContainer_H__ */
Index: code/trunk/src/libraries/core/config/ConfigValueIncludes.h
===================================================================
--- code/trunk/src/libraries/core/config/ConfigValueIncludes.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/ConfigValueIncludes.h	(revision 9667)
@@ -0,0 +1,272 @@
+/*
+ *   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:
+ *      Reto Grieder (functions)
+ *
+ */
+
+/**
+    @defgroup ConfigFile Config file
+    @ingroup Config
+*/
+
+/**
+    @file
+    @ingroup Config ConfigFile
+    @brief Definition of macros and functions for config-values.
+
+    An example of how to use SetConfigValue():
+
+    Definition of a class in the header-file:
+    @code
+    class MyClass : public BaseObject
+    {
+        public:
+            MyClass();              // Constructor
+            void setConfigValues(); // Inherited function
+
+            const std::string& getName()
+                { return this->name_; }
+
+            float getVersion()
+                { return this->version_; }
+
+        private:
+            std::string name_;
+            float version_;
+    };
+    @endcode
+
+    Implementation of the class source-file:
+    @code
+    MyClass::MyClass()
+    {
+        // Macro-call to create an Identifier
+        RegisterObject(MyClass);
+
+        // Function-call to assign the config-values to the new object
+        this->setConfigValues();
+    }
+
+    void MyClass::setConfigValues()
+    {
+        SetConfigValue(name_, "Orxonox").description("The name of the game");
+        SetConfigValue(version_, "1.0").description("The version-number");
+    }
+    @endcode
+
+    Extract of orxonox.ini:
+    @code
+    [MyClass]
+    name_ = "Orxonox"
+    version_ = 1.1 // We have changed this value from 1.0 to 1.1
+    @endcode
+
+    Some other code:
+    @code
+    MyObject orxonoxobject;
+    orxout() << "Name:    " << orxonoxobject.getName() << endl;
+    orxout() << "Version: " << orxonoxobject.getVersion() << endl;
+    @endcode
+
+    Output:
+    @code
+    Name:    Orxonox
+    Version: 1.1
+    @endcode
+*/
+
+#ifndef _ConfigValueIncludes_H__
+#define _ConfigValueIncludes_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/class/Identifier.h"
+#include "ConfigValueContainer.h"
+
+namespace orxonox
+{
+    /** Sets a runtime configurable value.
+        If the container for the value doesn't yet exist, a new one is created.
+        Also, the @a variable argument will be modified and set to the new value (default or from ini file).
+    @param object
+        Class instance that the config value should belong to (usually just 'this')
+    @param variable
+        Pointer to the variable where the value should be written to
+    @param type
+        Type of the config file, usually ConfigFileType::Settings
+    @param sectionName
+        Name of the section in the ini file (e.g. [MySection])
+    @param entryName
+        Name of the entry in the ini file (e.g. [MySection] myValue)
+    @param defaultValue
+        Value to be used if it cannot be read from the ini file
+    */
+    template <class T, class D, class V>
+    inline ConfigValueContainer& setConfigValueGeneric(T* object, V* variable, ConfigFileType::Value type, const std::string& sectionName, const std::string& entryName, const D& defaultValue)
+    {
+        ConfigValueContainer* container = ClassIdentifier<T>::getIdentifier()->getConfigValueContainer(entryName);
+        if (!container)
+        {
+            container = new ConfigValueContainer(type, ClassIdentifier<T>::getIdentifier(), sectionName, entryName, defaultValue, *variable);
+            ClassIdentifier<T>::getIdentifier()->addConfigValueContainer(entryName, container);
+        }
+        return container->getValue(variable, object);
+    }
+}
+
+/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
+    If the container for the value doesn't yet exist, a new one is created.
+    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
+@param varname
+    Variable name as C++ identifier. It will be used as entry name and as variable pointer
+@param defaultValue
+    Value to be used if it cannot be read from the ini file
+*/
+#define SetConfigValue(varname, defaultValue) \
+    orxonox::setConfigValueGeneric(this, &varname, ConfigFileType::Settings, this->getIdentifier()->getName(), #varname, defaultValue)
+
+/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
+    If the container for the value doesn't yet exist, a new one is created.
+    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
+@param variable
+    Variable name as C++ identifier.
+@param entryName
+    Name of the entry in the ini file (e.g. [MySection] myValue)
+@param defaultValue
+    Value to be used if it cannot be read from the ini file
+*/
+#define SetConfigValueAlias(variable, entryName, defaultValue) \
+    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, this->getIdentifier()->getName(), entryName, defaultValue)
+
+/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
+    If the container for the value doesn't yet exist, a new one is created.
+    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
+@param variable
+    Variable name as C++ identifier.
+@param sectionName
+    Name of the section in the ini file (e.g. [MySection])
+@param entryName
+    Name of the entry in the ini file (e.g. [MySection] myValue)
+@param defaultValue
+    Value to be used if it cannot be read from the ini file
+*/
+#define SetConfigValueExternal(variable, sectionName, entryName, defaultValue) \
+    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, sectionName, entryName, defaultValue)
+
+
+namespace orxonox
+{
+    /** Resets a runtime configurable value to its default.
+        If the container for the value doesn't yet exist, a warning is displayed.
+        Also, the @a variable argument will be modified and set to the default value.
+    @param object
+        Class instance that the config value should belong to (usually just 'this')
+    @param variable
+        Pointer to the variable where the value should be written to
+    @param entryName
+        Name of the entry in the ini file (e.g. [MySection] myValue)
+    */
+    template <class T, class V>
+    inline void resetConfigValueGeneric(T* object, V* variable, const std::string& entryName)
+    {
+        ConfigValueContainer* container = ClassIdentifier<T>::getIdentifier()->getConfigValueContainer(entryName);
+        if (container)
+        {
+            container->reset();
+            container->getValue(variable, object);
+        }
+        else
+        {
+            orxout(user_warning, context::config) << "Couldn't reset config-value '" << entryName << "' in class '"
+                                                  << ClassIdentifier<T>::getIdentifier()->getName() << "', corresponding container doesn't exist." << endl;
+        }
+    }
+}
+
+/** Resets a runtime configurable value to its default (simplified macro version of modifyConfigValueGeneric)
+    If the container for the value doesn't yet exist, a warning is displayed.
+    Also, the @a varname argument will be modified and set to the default value.
+@param varname
+    Variable name as C++ identifier. It will be used as entry name and as variable pointer
+*/
+#define ResetConfigValue(varname) \
+    orxonox::resetConfigValueGeneric(this, &varname, #varname)
+
+
+/** Modifies a runtime configurable value by using a modifier and some arguments.
+    If the container for the value doesn't yet exist, a warning is displayed.
+    Also, the @a variable argument will be modified and set to the current value.
+@param object
+    Class instance that the config value should belong to (usually just 'this')
+@param variable
+    Pointer to the variable where the value should be written to
+@param entryName
+    Name of the entry in the ini file (e.g. [MySection] myValue)
+@param modifier
+    On of these functions: set, tset, add, remove, reset, update
+@param ...
+    Arguments for the modifier function
+*/
+#define ModifyConfigValueGeneric(object, variable, entryName, modifier, ...) \
+    if (orxonox::ConfigValueContainer* container = ClassByObjectType(object)->getConfigValueContainer(entryName)) \
+    { \
+        container->modifier(__VA_ARGS__); \
+        container->getValue(variable, object); \
+    } \
+    else \
+    { \
+        orxout(user_warning, context::config) << "Couldn't modify config-value '" << entryName << "' in class '" \
+                                              << ClassByObjectType(object)->getName() << "', corresponding container doesn't exist." << endl; \
+    }
+
+/** Modifies a runtime configurable value by using a modifier and some arguments.
+    If the container for the value doesn't yet exist, a warning is displayed.
+    Also, the @a varname argument will be modified and set to the current value.
+@param varname
+    Variable name as C++ identifier. It will be used as entry name and as variable pointer
+@param modifier
+    On of these functions: set, tset, add, remove, reset, update
+@param ...
+    Arguments for the modifier function
+*/
+#define ModifyConfigValue(varname, modifier, ...) \
+    ModifyConfigValueGeneric(this, &varname, #varname, modifier, __VA_ARGS__)
+
+/** Modifies a runtime configurable value by using a modifier and some arguments.
+    If the container for the value doesn't yet exist, a warning is displayed.
+    Also, the @a variable argument will be modified and set to the current value.
+@param variable
+    Pointer to the variable where the value should be written to
+@param entryName
+    Name of the entry in the ini file (e.g. [MySection] myValue)
+@param modifier
+    On of these functions: set, tset, add, remove, reset, update
+@param ...
+    Arguments for the modifier function
+*/
+#define ModifyConfigValueExternal(variable, entryName, modifier, ...) \
+    ModifyConfigValueGeneric(this, &variable, entryName, modifier, __VA_ARGS__)
+
+#endif /* _ConfigValueIncludes_H__ */
Index: code/trunk/src/libraries/core/config/Configurable.cc
===================================================================
--- code/trunk/src/libraries/core/config/Configurable.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/Configurable.cc	(revision 9667)
@@ -0,0 +1,40 @@
+/*
+ *   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 "Configurable.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(Configurable);
+
+    Configurable::Configurable()
+    {
+        RegisterObject(Configurable);
+    }
+}
Index: code/trunk/src/libraries/core/config/Configurable.h
===================================================================
--- code/trunk/src/libraries/core/config/Configurable.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/Configurable.h	(revision 9667)
@@ -0,0 +1,57 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+    @brief Declaration of Configurable, the base class of all objects which may contain config values.
+*/
+
+#ifndef _Configurable_H__
+#define _Configurable_H__
+
+#include "core/CorePrereqs.h"
+
+#include "core/object/Listable.h"
+
+namespace orxonox
+{
+    /**
+        @brief This is the base class of all objects which may contain config values
+    */
+    class _CoreExport Configurable : virtual public Listable
+    {
+        public:
+            Configurable();
+
+            /// Function to collect the SetConfigValue-macro calls.
+            void setConfigValues() {};
+    };
+}
+
+#endif /* _Configurable_H__ */
Index: code/trunk/src/libraries/core/config/SettingsConfigFile.cc
===================================================================
--- code/trunk/src/libraries/core/config/SettingsConfigFile.cc	(revision 9667)
+++ code/trunk/src/libraries/core/config/SettingsConfigFile.cc	(revision 9667)
@@ -0,0 +1,277 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of SettingsConfigFile.
+*/
+
+#include "SettingsConfigFile.h"
+
+#include "util/StringUtils.h"
+#include "core/command/ConsoleCommand.h"
+#include "ConfigFileManager.h"
+#include "ConfigValueContainer.h"
+
+namespace orxonox
+{
+    ////////////////////////
+    // SettingsConfigFile //
+    ////////////////////////
+
+    static const std::string __CC_load_name = "reloadSettings";
+    static const std::string __CC_setFilename_name = "setSettingsFile";
+    static const std::string __CC_config_name = "config";
+    static const std::string __CC_tconfig_name = "tconfig";
+    static const std::string __CC_getConfig_name = "getConfig";
+
+    SetConsoleCommand(__CC_load_name,            &ConfigFile::load);
+    SetConsoleCommand(__CC_setFilename_name,     &SettingsConfigFile::setFilename);
+    SetConsoleCommand(__CC_config_name,          &SettingsConfigFile::config).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
+    SetConsoleCommand(__CC_tconfig_name,         &SettingsConfigFile::tconfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
+    SetConsoleCommand(__CC_getConfig_name,       &SettingsConfigFile::getConfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries());
+
+    SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;
+
+    /**
+        @brief Constructor: Activates the console commands.
+    */
+    SettingsConfigFile::SettingsConfigFile(const std::string& filename)
+        : ConfigFile(filename)
+    {
+        ModifyConsoleCommand(__CC_load_name).setObject(this);
+        ModifyConsoleCommand(__CC_setFilename_name).setObject(this);
+        ModifyConsoleCommand(__CC_config_name).setObject(this);
+        ModifyConsoleCommand(__CC_tconfig_name).setObject(this);
+        ModifyConsoleCommand(__CC_getConfig_name).setObject(this);
+    }
+
+    /**
+        @brief Destructor: Deactivates the console commands.
+    */
+    SettingsConfigFile::~SettingsConfigFile()
+    {
+        ModifyConsoleCommand(__CC_load_name).setObject(0);
+        ModifyConsoleCommand(__CC_setFilename_name).setObject(0);
+        ModifyConsoleCommand(__CC_config_name).setObject(0);
+        ModifyConsoleCommand(__CC_tconfig_name).setObject(0);
+        ModifyConsoleCommand(__CC_getConfig_name).setObject(0);
+    }
+
+    /**
+        @brief Loads the config file and updates the @ref ConfigValueContainer "config value containers".
+    */
+    void SettingsConfigFile::load()
+    {
+        ConfigFile::load();
+        this->updateConfigValues();
+    }
+
+    /**
+        @brief Changes the file-name.
+    */
+    void SettingsConfigFile::setFilename(const std::string& filename)
+    {
+        ConfigFileManager::getInstance().setFilename(ConfigFileType::Settings, filename);
+    }
+
+    /**
+        @brief Registers a new @ref ConfigValueContainer "config value container".
+    */
+    void SettingsConfigFile::addConfigValueContainer(ConfigValueContainer* container)
+    {
+        if (container == NULL)
+            return;
+        std::pair<std::string, ConfigValueContainer*> second(getLowercase(container->getName()), container);
+        this->containers_.insert(std::make_pair(getLowercase(container->getSectionName()), second));
+        this->sectionNames_.insert(container->getSectionName());
+    }
+
+    /**
+        @brief Unregisters a @ref ConfigValueContainer "config value container".
+    */
+    void SettingsConfigFile::removeConfigValueContainer(ConfigValueContainer* container)
+    {
+        if (container == NULL)
+            return;
+        const std::string& sectionLC = getLowercase(container->getSectionName());
+        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
+        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
+        {
+            if (it->second.second == container)
+            {
+                // Remove entry from section name set this was the last container for that section
+                if (upper == this->containers_.lower_bound(sectionLC))
+                    this->sectionNames_.erase(container->getSectionName());
+                this->containers_.erase(it);
+                break;
+            }
+        }
+    }
+
+    /**
+        @brief Updates all @ref ConfigValueContainer "config value containers".
+    */
+    void SettingsConfigFile::updateConfigValues()
+    {
+        // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
+
+        for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
+        {
+            it->second.second->update();
+            it->second.second->getIdentifier()->updateConfigValues();
+        }
+    }
+
+    /**
+        @brief Removes entries and sections from the file that don't exist anymore (i.e. if there's no corresponding @ref ConfigValueContainer "config value container").
+        @param bCleanComments If true, comments are also removed from the file
+    */
+    void SettingsConfigFile::clean(bool bCleanComments)
+    {
+        for (std::list<ConfigFileSection*>::iterator itSection = this->sections_.begin(); itSection != this->sections_.end(); )
+        {
+            const std::string& sectionLC = getLowercase((*itSection)->getName());
+            ContainerMap::const_iterator lower = this->containers_.lower_bound(sectionLC);
+            ContainerMap::const_iterator upper = this->containers_.upper_bound(sectionLC);
+            if (lower != upper)
+            {
+                // The section exists, delete comment
+                if (bCleanComments)
+                    (*itSection)->setComment("");
+                for (std::list<ConfigFileEntry*>::iterator itEntry = (*itSection)->entries_.begin(); itEntry != (*itSection)->entries_.end(); )
+                {
+                    const std::string& entryLC = getLowercase((*itEntry)->getName());
+                    bool bFound = false;
+                    for (ContainerMap::const_iterator itContainer = lower; itContainer != upper; ++itContainer)
+                    {
+                        if (itContainer->second.first == entryLC)
+                        {
+                            // The config-value exists, delete comment
+                            if (bCleanComments)
+                                (*itEntry)->setComment("");
+                            ++itEntry;
+                            bFound = true;
+                            break;
+                        }
+                    }
+                    if (!bFound)
+                    {
+                        // The config-value doesn't exist
+                        delete (*itEntry);
+                        (*itSection)->entries_.erase(itEntry++);
+                    }
+                }
+                ++itSection;
+            }
+            else
+            {
+                // The section doesn't exist
+                delete (*itSection);
+                this->sections_.erase(itSection++);
+            }
+        }
+
+        // Save the file
+        this->save();
+    }
+
+    /**
+        @brief Console-command: Changes the value of an entry and stores it the file.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
+    void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
+    {
+        if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
+            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
+    }
+
+    /**
+        @brief Console-command: Changes the value of an entry, but doesn't store it in the file (it's only a temporary change).
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
+    void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
+    {
+        if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
+            orxout(user_error, context::config) << "Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << endl;
+    }
+
+    /**
+        @brief Changes the value of an entry, depending on @a function, either by using "set" or "tset"
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+        @param function The function ("set" or "tset") that will be used to change the value.
+    */
+    bool SettingsConfigFile::configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&))
+    {
+        const std::string& sectionLC = getLowercase(section);
+        const std::string& entryLC = getLowercase(entry);
+        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
+        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
+        {
+            // Note: Config value vectors cannot be supported
+            if (it->second.first == entryLC && !it->second.second->isVector())
+            {
+                return (it->second.second->*function)(value);
+            }
+        }
+        return false;
+    }
+
+    /**
+        @brief Console-command: Returns the value of a given entry.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+    */
+    std::string SettingsConfigFile::getConfig(const std::string& section, const std::string& entry)
+    {
+        const std::string& sectionLC = getLowercase(section);
+        const std::string& entryLC = getLowercase(entry);
+        ContainerMap::iterator upper = this->containers_.upper_bound(sectionLC);
+        for (ContainerMap::iterator it = this->containers_.lower_bound(sectionLC); it != upper; ++it)
+        {
+            // Note: Config value vectors cannot be supported
+            if (it->second.first == entryLC && ! it->second.second->isVector())
+            {
+                std::string value;
+                it->second.second->getValue<std::string, void>(&value, NULL);
+                return value;
+            }
+        }
+        return "";
+    }
+}
Index: code/trunk/src/libraries/core/config/SettingsConfigFile.h
===================================================================
--- code/trunk/src/libraries/core/config/SettingsConfigFile.h	(revision 9667)
+++ code/trunk/src/libraries/core/config/SettingsConfigFile.h	(revision 9667)
@@ -0,0 +1,101 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Config ConfigFile
+*/
+
+#ifndef _SettingsConfigFile_H__
+#define _SettingsConfigFile_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ConfigFile.h"
+#include "util/Singleton.h"
+
+namespace orxonox // tolua_export
+{ // tolua_export
+
+    ////////////////////////
+    // SettingsConfigFile //
+    ////////////////////////
+    /**
+        @brief Child class of ConfigFile, used to store the settings of the game.
+
+        In addition to ConfigFile, this class provides an interface to manipulate the settings
+        with console commands and to cache entries in instances of ConfigValueContainer.
+
+        SettingsConfigFile is a Singleton, meaning there's only one instance of this class
+        (and thus only one config file that stores settings).
+    */
+    class _CoreExport SettingsConfigFile // tolua_export
+        : public ConfigFile, public Singleton<SettingsConfigFile>
+    { // tolua_export
+        friend class Singleton<SettingsConfigFile>;
+
+        public:
+            typedef std::multimap<std::string, std::pair<std::string, ConfigValueContainer*> > ContainerMap;
+
+            SettingsConfigFile(const std::string& filename);
+            ~SettingsConfigFile();
+
+            void load(); // tolua_export
+            void setFilename(const std::string& filename); // tolua_export
+            void clean(bool bCleanComments = false); // tolua_export
+
+            void config(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
+            void tconfig(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
+            std::string getConfig(const std::string& section, const std::string& entry); // tolua_export
+
+            void addConfigValueContainer(ConfigValueContainer* container);
+            void removeConfigValueContainer(ConfigValueContainer* container);
+
+            /// Returns a set containing the names of all sections in this config file.
+            inline const std::set<std::string>& getSectionNames()
+                { return this->sectionNames_; }
+            /// Returns the lower-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
+            inline ContainerMap::const_iterator getContainerLowerBound(const std::string section)
+                { return this->containers_.lower_bound(section); }
+            /// Returns the upper-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
+            inline ContainerMap::const_iterator getContainerUpperBound(const std::string section)
+                { return this->containers_.upper_bound(section); }
+
+            static SettingsConfigFile& getInstance() { return Singleton<SettingsConfigFile>::getInstance(); } // tolua_export
+
+        private:
+            void updateConfigValues();
+            bool configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&));
+
+            ContainerMap containers_;                   ///< Stores all @ref ConfigValueContainer "config value containers"
+            std::set<std::string> sectionNames_;        ///< Stores all section names
+            static SettingsConfigFile* singletonPtr_s;  ///< The singleton pointer
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _SettingsConfigFile_H__ */
Index: code/trunk/src/libraries/core/input/Button.cc
===================================================================
--- code/trunk/src/libraries/core/input/Button.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/Button.cc	(revision 9667)
@@ -42,5 +42,5 @@
 #include "core/command/CommandEvaluation.h"
 #include "core/command/CommandExecutor.h"
-#include "core/ConfigFileManager.h"
+#include "core/config/ConfigFile.h"
 
 namespace orxonox
Index: code/trunk/src/libraries/core/input/InputBuffer.cc
===================================================================
--- code/trunk/src/libraries/core/input/InputBuffer.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/InputBuffer.cc	(revision 9667)
@@ -31,11 +31,13 @@
 #include "util/Clipboard.h"
 #include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
 
 namespace orxonox
 {
+    RegisterClassNoArgs(InputBuffer);
+
     InputBuffer::InputBuffer()
     {
-        RegisterRootObject(InputBuffer);
+        RegisterObject(InputBuffer);
 
         this->cursor_ = 0;
@@ -57,5 +59,5 @@
     InputBuffer::InputBuffer(const std::string& allowedChars)
     {
-        RegisterRootObject(InputBuffer);
+        RegisterObject(InputBuffer);
 
         this->maxLength_ = 1024;
Index: code/trunk/src/libraries/core/input/InputBuffer.h
===================================================================
--- code/trunk/src/libraries/core/input/InputBuffer.h	(revision 9576)
+++ code/trunk/src/libraries/core/input/InputBuffer.h	(revision 9667)
@@ -34,5 +34,5 @@
 #include <list>
 #include <string>
-#include "core/OrxonoxClass.h"
+#include "core/config/Configurable.h"
 #include "InputHandler.h"
 
@@ -74,5 +74,5 @@
     };
 
-    class _CoreExport InputBuffer : public InputHandler, public OrxonoxClass
+    class _CoreExport InputBuffer : public InputHandler, public Configurable
     {
         public:
Index: code/trunk/src/libraries/core/input/InputManager.cc
===================================================================
--- code/trunk/src/libraries/core/input/InputManager.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/InputManager.cc	(revision 9667)
@@ -46,7 +46,7 @@
 #include "util/Exception.h"
 #include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/CommandLineParser.h"
 #include "core/GraphicsManager.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/config/CommandLineParser.h"
 #include "core/command/ConsoleCommand.h"
 #include "core/command/Functor.h"
@@ -98,5 +98,5 @@
         , calibratorCallbackHandler_(0)
     {
-        RegisterRootObject(InputManager);
+        RegisterObject(InputManager);
 
         orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
@@ -280,5 +280,5 @@
         this->destroyState("calibrator");
         // Destroy KeyDetector and state
-        calibratorCallbackHandler_->destroy();
+        delete calibratorCallbackHandler_;
         // Destroy the empty InputState
         this->destroyStateInternal(this->emptyState_);
@@ -642,5 +642,5 @@
         assert(state && this->activeStates_.find(state->getPriority()) == this->activeStates_.end());
         statesByName_.erase(state->getName());
-        state->destroy();
+        delete state;
     }
 
Index: code/trunk/src/libraries/core/input/JoyStick.cc
===================================================================
--- code/trunk/src/libraries/core/input/JoyStick.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/JoyStick.cc	(revision 9667)
@@ -34,6 +34,7 @@
 
 #include "util/StringUtils.h"
-#include "core/ConfigFileManager.h"
-#include "core/ConfigValueIncludes.h"
+#include "core/config/ConfigFile.h"
+#include "core/config/ConfigFileManager.h"
+#include "core/config/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
 #include "util/Convert.h"
@@ -50,5 +51,5 @@
         : super(id, oisInputManager)
     {
-        RegisterRootObject(JoyStick);
+        RegisterObject(JoyStick);
         this->setConfigValues();
         // Initialise POV and Slider states
Index: code/trunk/src/libraries/core/input/JoyStick.h
===================================================================
--- code/trunk/src/libraries/core/input/JoyStick.h	(revision 9576)
+++ code/trunk/src/libraries/core/input/JoyStick.h	(revision 9667)
@@ -36,4 +36,5 @@
 #include <ois/OISJoyStick.h>
 #include "InputDevice.h"
+#include "core/config/Configurable.h"
 
 namespace orxonox
@@ -58,5 +59,5 @@
     */
     class _CoreExport JoyStick
-        : public OrxonoxClass
+        : public Configurable
         , public InputDeviceTemplated<JoyStickTraits>
         , public OIS::JoyStickListener
Index: code/trunk/src/libraries/core/input/JoyStickQuantityListener.cc
===================================================================
--- code/trunk/src/libraries/core/input/JoyStickQuantityListener.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/JoyStickQuantityListener.cc	(revision 9667)
@@ -30,5 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/ObjectList.h"
+#include "core/object/ObjectList.h"
 
 namespace orxonox
Index: code/trunk/src/libraries/core/input/JoyStickQuantityListener.h
===================================================================
--- code/trunk/src/libraries/core/input/JoyStickQuantityListener.h	(revision 9576)
+++ code/trunk/src/libraries/core/input/JoyStickQuantityListener.h	(revision 9667)
@@ -38,10 +38,10 @@
 
 #include <vector>
-#include "core/OrxonoxClass.h"
+#include "core/object/Listable.h"
 
 namespace orxonox
 {
     //! Derive from this class to get informed when joy sticks get added/removed
-    class _CoreExport JoyStickQuantityListener : virtual public OrxonoxClass
+    class _CoreExport JoyStickQuantityListener : virtual public Listable
     {
         friend class InputManager;
Index: code/trunk/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/KeyBinder.cc	(revision 9667)
@@ -34,7 +34,7 @@
 #include "util/Output.h"
 #include "util/Exception.h"
-#include "core/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
-#include "core/ConfigFileManager.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/config/ConfigFile.h"
 #include "core/PathConfig.h"
 #include "InputCommands.h"
@@ -58,5 +58,5 @@
         mousePosition_[1] = 0.0;
 
-        RegisterRootObject(KeyBinder);
+        RegisterObject(KeyBinder);
 
         // initialise all buttons and half axes to avoid creating everything with 'new'
Index: code/trunk/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinderManager.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/KeyBinderManager.cc	(revision 9667)
@@ -32,5 +32,5 @@
 #include "util/Exception.h"
 #include "util/ScopedSingletonManager.h"
-#include "core/ConfigValueIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
 #include "core/LuaState.h"
Index: code/trunk/src/libraries/core/input/KeyBinderManager.h
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinderManager.h	(revision 9576)
+++ code/trunk/src/libraries/core/input/KeyBinderManager.h	(revision 9667)
@@ -36,5 +36,5 @@
 
 #include "util/Singleton.h"
-#include "core/OrxonoxClass.h"
+#include "core/config/Configurable.h"
 
 namespace orxonox //tolua_export
@@ -53,5 +53,5 @@
     */
     class _CoreExport KeyBinderManager //tolua_export
-        : public Singleton<KeyBinderManager>, public OrxonoxClass
+        : public Singleton<KeyBinderManager>, public Configurable
     { //tolua_export
         friend class Singleton<KeyBinderManager>;
Index: code/trunk/src/libraries/core/input/Mouse.cc
===================================================================
--- code/trunk/src/libraries/core/input/Mouse.cc	(revision 9576)
+++ code/trunk/src/libraries/core/input/Mouse.cc	(revision 9667)
@@ -54,5 +54,5 @@
         : super(id, oisInputManager)
     {
-        RegisterRootObject(Mouse);
+        RegisterObject(Mouse);
         this->windowResized(this->getWindowWidth(), this->getWindowHeight());
 
Index: code/trunk/src/libraries/core/object/CMakeLists.txt
===================================================================
--- code/trunk/src/libraries/core/object/CMakeLists.txt	(revision 9667)
+++ code/trunk/src/libraries/core/object/CMakeLists.txt	(revision 9667)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(CORE_SRC_FILES
+  Context.cc
+  Destroyable.cc
+  Listable.cc
+  ObjectListBase.cc
+)
Index: code/trunk/src/libraries/core/object/ClassFactory.h
===================================================================
--- code/trunk/src/libraries/core/object/ClassFactory.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/ClassFactory.h	(revision 9667)
@@ -0,0 +1,105 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object Factory
+    @brief Definition and implementation of the ClassFactory class
+
+    The ClassFactory is able to create new objects of a specific class which creates objects.
+*/
+
+#ifndef _ClassFactory_H__
+#define _ClassFactory_H__
+
+#include "core/CorePrereqs.h"
+
+#include <string>
+
+#include "util/Output.h"
+
+namespace orxonox
+{
+    // ###########################
+    // ###       Factory       ###
+    // ###########################
+    /// Base-class of all factories.
+    class _CoreExport Factory
+    {
+        public:
+            virtual ~Factory() {}
+            virtual Identifiable* fabricate(Context* context) = 0;
+    };
+
+    // ###############################
+    // ###      ClassFactory       ###
+    // ###############################
+    /// The ClassFactory is the base-class of all class-spezific factories
+    template <class T>
+    class ClassFactory : public Factory
+    {
+    };
+
+    // ###############################
+    // ###   ClassFactoryNoArgs    ###
+    // ###############################
+    /// The ClassFactoryNoArgs is able to create new objects of a specific class that require no constructor arguments.
+    template <class T>
+    class ClassFactoryNoArgs : public ClassFactory<T>
+    {
+        public:
+            /**
+                @brief Creates and returns a new object of class T.
+                @return The new object
+            */
+            inline Identifiable* fabricate(Context* context)
+            {
+                return static_cast<Identifiable*>(new T());
+            }
+    };
+
+    // ###############################
+    // ### ClassFactoryWithContext ###
+    // ###############################
+    /// The ClassFactoryWithContext is able to create new objects of a specific class that require a context as constructor argument
+    template <class T>
+    class ClassFactoryWithContext : public ClassFactory<T>
+    {
+        public:
+            /**
+                @brief Creates and returns a new object of class T.
+                @return The new object
+            */
+            inline Identifiable* fabricate(Context* context)
+            {
+                return static_cast<Identifiable*>(new T(context));
+            }
+    };
+}
+
+#endif /* _ClassFactory_H__ */
Index: code/trunk/src/libraries/core/object/Context.cc
===================================================================
--- code/trunk/src/libraries/core/object/Context.cc	(revision 9667)
+++ code/trunk/src/libraries/core/object/Context.cc	(revision 9667)
@@ -0,0 +1,99 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of Context.
+*/
+
+#include "Context.h"
+#include "core/class/Identifier.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClass(Context);
+
+    Context* Context::rootContext_s = 0;
+
+    Context* getContextForInitializationOfOtherContexts()
+    {
+        static size_t count = 0;
+        // the first time this is called, ++count returns 1 and the context is created
+        // the second time this is called, ++count returns 2 and NULL is returned because we're in the constructor of the context itself
+        // for each future call the context (now completely created) is returned
+        if (++count == 2)
+            return NULL;
+        else
+        {
+            static Context context(NULL);
+            return &context;
+        }
+    }
+
+    // Initialize Listable(*) with a special context, only used to initialize other contexts. Later in the constructor we change the context
+    Context::Context(Context* context) : Listable(getContextForInitializationOfOtherContexts()), parentContext_(context)
+    {
+        RegisterObject(Context);
+
+        // the context is its own context
+        this->setContext(this);
+    }
+
+    Context::~Context()
+    {
+        // unregister context from object lists before object lists are destroyed
+        this->unregisterObject();
+        for (size_t i = 0; i < this->objectLists_.size(); ++i)
+            delete this->objectLists_[i];
+    }
+
+    /*static*/ void Context::setRootContext(Context* context)
+    {
+        if (Context::rootContext_s)
+            delete Context::rootContext_s;
+        Context::rootContext_s = context;
+    }
+
+    /*static*/ Context* Context::getRootContext()
+    {
+        if (!Context::rootContext_s)
+            Context::rootContext_s = new Context(NULL);
+        return Context::rootContext_s;
+    }
+
+    ObjectListBase* Context::getObjectList(const Identifier* identifier)
+    {
+        unsigned int classID = identifier->getClassID();
+        if (classID >= this->objectLists_.size())
+            this->objectLists_.resize(classID + 1);
+        if (!this->objectLists_[classID])
+            this->objectLists_[classID] = new ObjectListBase();
+        return this->objectLists_[classID];
+    }
+}
Index: code/trunk/src/libraries/core/object/Context.h
===================================================================
--- code/trunk/src/libraries/core/object/Context.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/Context.h	(revision 9667)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object
+*/
+
+#ifndef _Context_H__
+#define _Context_H__
+
+#include "core/CorePrereqs.h"
+
+#include <vector>
+
+#include "Listable.h"
+
+namespace orxonox
+{
+    class _CoreExport Context : virtual public Listable
+    {
+        public:
+            static void setRootContext(Context* context);
+            static Context* getRootContext();
+
+            Context(Context* context);
+            virtual ~Context();
+
+            inline Context* getParentContext() const
+                { return this->parentContext_; }
+
+            ObjectListBase* getObjectList(const Identifier* identifier);
+
+            template <class T>
+            inline ObjectListBase* getObjectList()
+                { return this->getObjectList(ClassIdentifier<T>::getIdentifier()); }
+
+            template <class T>
+            inline void addObject(T* object)
+            {
+                ObjectListBaseElement* element = Listable::createObjectListElement(object);
+                this->getObjectList<T>()->addElement(element);
+                object->elements_.push_back(element);
+                if (this->getParentContext())
+                    this->getParentContext()->addObject(object);
+            }
+
+        private:
+            Context* parentContext_;
+            std::vector<ObjectListBase*> objectLists_;
+
+            static Context* rootContext_s;
+    };
+}
+
+#endif /* _Context_H__ */
Index: code/trunk/src/libraries/core/object/Destroyable.cc
===================================================================
--- code/trunk/src/libraries/core/object/Destroyable.cc	(revision 9667)
+++ code/trunk/src/libraries/core/object/Destroyable.cc	(revision 9667)
@@ -0,0 +1,75 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of Destroyable.
+*/
+
+#include "Destroyable.h"
+
+#include <cassert>
+
+namespace orxonox
+{
+    /**
+        @brief Constructor: Sets the default values.
+    */
+    Destroyable::Destroyable()
+    {
+        this->referenceCount_ = 0;
+        this->requestedDestruction_ = false;
+    }
+
+    /**
+        @brief Destructor: Notifies all DestructionListener (for example @ref WeakPtr "weak pointers") that this object is being deleted.
+    */
+    Destroyable::~Destroyable()
+    {
+        assert(this->referenceCount_ <= 0);
+
+        // notify all destruction listeners
+        for (std::set<DestructionListener*>::iterator it = this->destructionListeners_.begin(); it != this->destructionListeners_.end(); )
+            (*(it++))->objectDeleted();
+    }
+
+    /**
+        @brief Deletes the object if no @ref orxonox::SmartPtr "smart pointers" point to this object. Otherwise schedules the object to be deleted as soon as possible.
+    */
+    void Destroyable::destroy()
+    {
+        assert(this); // Just in case someone tries to delete a NULL pointer
+        this->requestedDestruction_ = true;
+        if (this->referenceCount_ == 0)
+        {
+            this->preDestroy();
+            if (this->referenceCount_ == 0)
+                delete this;
+        }
+    }
+}
Index: code/trunk/src/libraries/core/object/Destroyable.h
===================================================================
--- code/trunk/src/libraries/core/object/Destroyable.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/Destroyable.h	(revision 9667)
@@ -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:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object
+    @brief Declaration of Destroyable, the base class of all objects which can be used with SmartPtr and WeakPtr.
+*/
+
+#ifndef _Destroyable_H__
+#define _Destroyable_H__
+
+#include "core/CorePrereqs.h"
+
+#include <set>
+
+namespace orxonox
+{
+    /**
+        @brief Classes must inherit from this class if they should be used with SmartPtr or WeakPtr.
+    */
+    class _CoreExport Destroyable
+    {
+        template <class T>
+        friend class SmartPtr;
+
+        friend class DestructionListener;
+
+        public:
+            Destroyable();
+            virtual ~Destroyable();
+
+            void destroy();
+
+            /// Returns the number of @ref orxonox::SmartPtr "smart pointers" that point to this object.
+            inline unsigned int getReferenceCount() const
+                { return this->referenceCount_; }
+
+        protected:
+            /// This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction.
+            virtual void preDestroy() {}
+
+        private:
+            /// Increments the reference counter (for smart pointers).
+            inline void incrementReferenceCount()
+                { ++this->referenceCount_; }
+            /// Decrements the reference counter (for smart pointers).
+            inline void decrementReferenceCount()
+            {
+                --this->referenceCount_;
+                if (this->referenceCount_ == 0 && this->requestedDestruction_)
+                    this->destroy();
+            }
+
+            /// Register a destruction listener (for example a weak pointer which points to this object).
+            inline void registerDestructionListener(DestructionListener* pointer)
+                { this->destructionListeners_.insert(pointer); }
+            /// Unegister a destruction listener (for example a weak pointer which pointed to this object before).
+            inline void unregisterDestructionListener(DestructionListener* pointer)
+                { this->destructionListeners_.erase(pointer); }
+
+            int referenceCount_;                                    //!< Counts the references from smart pointers to this object
+            bool requestedDestruction_;                             //!< Becomes true after someone called delete on this object
+            std::set<DestructionListener*> destructionListeners_;   //!< All destruction listeners (for example weak pointers which point to this object and like to get notified if it dies)
+    };
+
+    /**
+        @brief This listener is used to inform weak pointers if an object of type Destroyable gets destroyed.
+    */
+    class _CoreExport DestructionListener
+    {
+        friend class Destroyable;
+
+        protected:
+            virtual ~DestructionListener() {}
+
+            inline void registerAsDestructionListener(Destroyable* object)
+                { if (object) { object->registerDestructionListener(this); } }
+            inline void unregisterAsDestructionListener(Destroyable* object)
+                { if (object) { object->unregisterDestructionListener(this); } }
+
+            virtual void objectDeleted() = 0;
+    };
+
+}
+
+#endif /* _Destroyable_H__ */
Index: code/trunk/src/libraries/core/object/Iterator.h
===================================================================
--- code/trunk/src/libraries/core/object/Iterator.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/Iterator.h	(revision 9667)
@@ -0,0 +1,122 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Definition of the Iterator class, used to iterate through object-lists.
+
+    @anchor IteratorExample
+
+    @ref orxonox::Iterator "Iterator" allows to iterate through an @ref orxonox::ObjectListBase
+    "ObjectListBase". Objects in this list are cast to the template argument @a T of Iterator<T> using
+    @c dynamic_cast. In contrast to @ref orxonox::ObjectListIterator "ObjectListIterator<T>",
+    @ref orxonox::Iterator "Iterator<T>" can iterate through every object-list. In practice though it
+    is limited to objects of type @a T and its subclasses. Because of the @c dynamic_cast, this iterator
+    is much slower than ObjectListIterator.
+
+    Usage:
+    @code
+    for (Iterator<myClass> it = anyidentifier->getObjects()->begin(); it != anyidentifier->getObjects()->end(); ++it)
+    {
+        it->someFunction(...);
+        myClass* myObject = *it;
+    }
+    @endcode
+*/
+
+#ifndef _Iterator_H__
+#define _Iterator_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ObjectListBase.h"
+#include "IteratorBase.h"
+
+namespace orxonox
+{
+    /**
+        @brief The Iterator allows to iterate through a given ObjectList.
+
+        Independent of the object-list's type, the objects in the list are always casted
+        to @a T using @c dynamic_cast.
+
+        @see See @ref IteratorExample "Iterator.h" for more information an example.
+    */
+    template <class T>
+    class Iterator : public IteratorBase<T, Iterator<T> >
+    {
+        public:
+            /**
+                @brief Constructor: Sets the element, whereon the iterator points, to zero.
+            */
+            inline Iterator() : IteratorBase<T, Iterator<T> >(NULL) {}
+
+            /**
+                @brief Constructor: Sets this element to a given element
+                @param element The element
+            */
+            inline Iterator(ObjectListBaseElement* element) : IteratorBase<T, Iterator<T> >(element) {}
+
+            /**
+                @brief Constructor: Sets this element to the element of another Iterator.
+                @param other The other Iterator
+            */
+            inline Iterator(const Iterator<T>& other) : IteratorBase<T, Iterator<T> >(other) {}
+
+            /**
+                @brief Assigns a given element.
+                @param element The element
+            */
+            inline Iterator<T>& operator=(ObjectListBaseElement* element)
+            {
+                this->setElement(element);
+                return (*this);
+            }
+
+            /**
+                @brief Overloading of the *it operator: returns the pointer to the object.
+                @return The object the Iterator points at
+            */
+            inline T* operator*() const
+            {
+                return orxonox_cast<T*>(this->element_->objectBase_);
+            }
+
+            /**
+                @brief Overloading of the it-> operator: returns the pointer to the object.
+                @return The object the Iterator points at
+            */
+            inline T* operator->() const
+            {
+                return orxonox_cast<T*>(this->element_->objectBase_);
+            }
+    };
+}
+
+#endif /* _Iterator_H__ */
Index: code/trunk/src/libraries/core/object/IteratorBase.h
===================================================================
--- code/trunk/src/libraries/core/object/IteratorBase.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/IteratorBase.h	(revision 9667)
@@ -0,0 +1,216 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Definition of the IteratorBase class, used to iterate through object-lists.
+*/
+
+#ifndef _IteratorBase_H__
+#define _IteratorBase_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ObjectListBase.h"
+
+namespace orxonox
+{
+    /**
+        @brief The Iterator allows to iterate through object lists.
+        It serves as base class for @ref ObjectListIterator and @ref Iterator
+    */
+    template <class T, class I>
+    class IteratorBase : public ObjectListElementRemovalListener
+    {
+        public:
+            /**
+                @brief Constructor: Sets the element, whereon the iterator points, to zero.
+            */
+            inline IteratorBase(ObjectListBaseElement* element)
+            {
+                this->element_ = element;
+                this->registerIterator();
+            }
+
+            /**
+                @brief Constructor: Sets this element to the element of another Iterator.
+                @param other The other Iterator
+            */
+            inline IteratorBase(const IteratorBase& other)
+            {
+                this->element_ = other.element_;
+                this->registerIterator();
+            }
+
+            /**
+                @brief Unregisters the Iterator from the ObjectList.
+            */
+            inline ~IteratorBase()
+            {
+                this->unregisterIterator();
+            }
+
+            /**
+                @brief Assigns a given element.
+                @param element The element
+            */
+            inline IteratorBase<T, I>& operator=(ObjectListElement<T>* element)
+            {
+                this->setElement(element);
+                return (*this);
+            }
+
+            /**
+                @brief Assigns the element of another Iterator.
+                @param other The other Iterator
+            */
+            inline IteratorBase<T, I>& operator=(const IteratorBase<T, I>& other)
+            {
+                this->setElement(other.element_);
+                return (*this);
+            }
+
+            /**
+                @brief Overloading of the ++it operator: Iterator points to the next object in the list.
+                @return The Iterator itself
+            */
+            inline const IteratorBase<T, I>& operator++()
+            {
+                this->element_ = this->element_->next_;
+                return *this;
+            }
+
+            /**
+                @brief Overloading of the it++ operator: Iterator points to the next object in the list.
+                @return The Iterator itself
+            */
+            inline I operator++(int)
+            {
+                I copy = *this;
+                this->element_ = this->element_->next_;
+                return copy;
+            }
+
+            /**
+                @brief Overloading of the --it operator: Iterator points to the previous object in the list.
+                @return The Iterator itself
+            */
+            inline const IteratorBase<T, I>& operator--()
+            {
+                this->element_ = this->element_->prev_;
+                return *this;
+            }
+
+            /**
+                @brief Overloading of the it-- operator: Iterator points to the previous object in the list.
+                @return The Iterator itself
+            */
+            inline I operator--(int i)
+            {
+                I copy = *this;
+                this->element_ = this->element_->prev_;
+                return copy;
+            }
+
+            /**
+                @brief Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.
+                @return True if the Iterator points to an existing object.
+            */
+            inline operator bool() const
+            {
+                return (this->element_ != NULL);
+            }
+
+            /**
+                @brief Overloading of the == operator to compare with another Iterator.
+                @param compare The other Iterator
+                @return True if the iterators point to the same element
+            */
+            inline bool operator==(const IteratorBase<T, I>& compare) const
+            {
+                return (this->element_ == compare.element_);
+            }
+
+            /**
+                @brief Overloading of the != operator to compare with another Iterator.
+                @param compare The other Iterator
+                @return True if the iterators point to different elements
+            */
+            inline bool operator!=(const IteratorBase<T, I>& compare) const
+            {
+                return (this->element_ != compare.element_);
+            }
+
+            /**
+                @brief Increments the Iterator if it points at the given element.
+                @param object The object to compare with
+            */
+            virtual void removedElement(ObjectListBaseElement* element)
+            {
+                if (this->element_ == element)
+                    this->operator++();
+            }
+
+        protected:
+            inline void setElement(ObjectListBaseElement* element)
+            {
+                this->unregisterIterator();
+                this->element_ = element;
+                this->registerIterator();
+            }
+
+            /**
+             * @brief Registers the Iterator at the list to which it belongs
+             */
+            inline void registerIterator()
+            {
+                if (this->element_)
+                {
+                    this->list_ = this->element_->list_;
+                    this->list_->registerRemovalListener(this);
+                }
+                else
+                    this->list_ = NULL;
+            }
+
+            /**
+             * @brief Unregisters the Iterator from the list (if any)
+             */
+            inline void unregisterIterator()
+            {
+                if (this->list_)
+                    this->list_->unregisterRemovalListener(this);
+            }
+
+            ObjectListBaseElement* element_;    //!< The element the Iterator points at
+            ObjectListBase* list_;              //!< The list in which the Iterator registered itself
+    };
+}
+
+#endif /* _IteratorBase_H__ */
Index: code/trunk/src/libraries/core/object/Listable.cc
===================================================================
--- code/trunk/src/libraries/core/object/Listable.cc	(revision 9667)
+++ code/trunk/src/libraries/core/object/Listable.cc	(revision 9667)
@@ -0,0 +1,113 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of Listable.
+*/
+
+#include "Listable.h"
+#include "core/CoreIncludes.h"
+#include "ObjectListBase.h"
+#include "Context.h"
+
+namespace orxonox
+{
+    RegisterClass(Listable);
+
+    /**
+        @brief Constructor: Allocates space in the element list.
+    */
+    Listable::Listable()
+    {
+        this->context_ = Context::getRootContext();
+        this->elements_.reserve(6);
+
+        RegisterObject(Listable);
+    }
+
+    /**
+        @brief Constructor: Allocates space in the element list and assigns the context
+    */
+    Listable::Listable(Context* context)
+    {
+        this->context_ = context;
+        this->elements_.reserve(6);
+
+        RegisterObject(Listable);
+    }
+
+    /**
+        @brief Destructor: Removes the object from the object-lists
+    */
+    Listable::~Listable()
+    {
+        this->unregisterObject();
+    }
+
+    /**
+        @brief Removes this object from the object-lists.
+    */
+    void Listable::unregisterObject()
+    {
+        for (size_t i = 0; i < this->elements_.size(); ++i)
+            Listable::deleteObjectListElement(this->elements_[i]);
+        this->elements_.clear();
+    }
+
+    /**
+     * @brief Changes the context.
+     * The object is removed from the current context and added to the new one. This also applies to all object lists the object is registered in.
+     */
+    void Listable::setContext(Context* context)
+    {
+        assert(context);
+        std::vector<ObjectListBaseElement*> copy = this->elements_;
+        this->elements_.clear();
+
+        for (size_t i = 0; i < copy.size(); ++i)
+        {
+            copy[i]->changeContext(this->context_, context);
+            Listable::deleteObjectListElement(copy[i]);
+        }
+
+        this->context_ = context;
+    }
+
+    /* static */ SmallObjectAllocator& Listable::getObjectListElementAllocator()
+    {
+        static SmallObjectAllocator allocator(sizeof(ObjectListElement<Listable>), 1024);
+        return allocator;
+    }
+
+    /* static */ void Listable::deleteObjectListElement(ObjectListBaseElement* element)
+    {
+        element->~ObjectListBaseElement();
+        Listable::getObjectListElementAllocator().free(element);
+    }
+}
Index: code/trunk/src/libraries/core/object/Listable.h
===================================================================
--- code/trunk/src/libraries/core/object/Listable.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/Listable.h	(revision 9667)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Declaration of Listable, the base of all classes whose instances can be stored in object lists.
+*/
+
+#ifndef _Listable_H__
+#define _Listable_H__
+
+#include "core/CorePrereqs.h"
+
+#include <vector>
+
+#include "core/class/Identifiable.h"
+
+namespace orxonox
+{
+    /**
+        @brief Listable stores the entries of all object lists pointing to this instance.
+    */
+    class _CoreExport Listable : virtual public Identifiable
+    {
+        friend class Context;
+
+        public:
+            Listable();
+            Listable(Context* context);
+            virtual ~Listable();
+
+            void unregisterObject();
+
+            void setContext(Context* context);
+            inline Context* getContext() const
+                { return this->context_; }
+
+        private:
+            static SmallObjectAllocator& getObjectListElementAllocator();
+
+            template <class T>
+            static ObjectListElement<T>* createObjectListElement(T* object)
+            {
+                void* chunk = Listable::getObjectListElementAllocator().alloc();
+                return new (chunk) ObjectListElement<T>(object);
+            }
+
+            static void deleteObjectListElement(ObjectListBaseElement* element);
+
+            Context* context_;                             //!< The object will register itself in the object lists of this context
+            std::vector<ObjectListBaseElement*> elements_; //!< The corresponding ObjectListElements in all object lists the object is registered in
+    };
+}
+
+#endif /* _Listable_H__ */
Index: code/trunk/src/libraries/core/object/ObjectList.h
===================================================================
--- code/trunk/src/libraries/core/object/ObjectList.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/ObjectList.h	(revision 9667)
@@ -0,0 +1,107 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @defgroup ObjectList Object-lists and iterators
+    @ingroup Object
+*/
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Definition of the ObjectList class, a wrapper of ObjectListBase.
+
+    @ref orxonox::ObjectList "ObjectList<T>" is a wrapper of an @ref orxonox::ObjectListBase
+    "ObjectListBase" of class @a T. Use @ref orxonox::ObjectListIterator "ObjectListIterator<T>"
+    to iterate through the list.
+*/
+
+#ifndef _ObjectList_H__
+#define _ObjectList_H__
+
+#include "core/CorePrereqs.h"
+
+#include "ObjectListBase.h"
+#include "ObjectListIterator.h"
+#include "Context.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    /**
+        @brief The ObjectList contains all objects of the given class.
+
+        Wraps the ObjectListBase which contains all objects of type @a T. Use @ref ObjectListIterator
+        "ObjectListIterator<T>" or its typedef ObjectList<T>::iterator to iterate through all objects
+        in the list.
+    */
+    template <class T>
+    class ObjectList
+    {
+        public:
+            typedef ObjectListIterator<T> iterator;
+
+            /// Returns the size of the list
+            inline static size_t size()
+            {
+                return Context::getRootContext()->getObjectList<T>()->size();
+            }
+
+            /// Returns an Iterator to the first element in the list.
+            inline static ObjectListElement<T>* begin()
+            {
+                ObjectListBase* list = Context::getRootContext()->getObjectList<T>();
+                return static_cast<ObjectListElement<T>*>(list->begin());
+            }
+
+            /// Returns an Iterator to the element after the last element in the list.
+            inline static ObjectListElement<T>* end()
+            {
+                ObjectListBase* list = Context::getRootContext()->getObjectList<T>();
+                return static_cast<ObjectListElement<T>*>(list->end());
+            }
+
+            /// Returns an Iterator to the last element in the list.
+            inline static ObjectListElement<T>* rbegin()
+            {
+                ObjectListBase* list = Context::getRootContext()->getObjectList<T>();
+                return static_cast<ObjectListElement<T>*>(list->rbegin());
+            }
+
+            /// Returns an Iterator to the element before the first element in the list.
+            inline static ObjectListElement<T>* rend()
+            {
+                ObjectListBase* list = Context::getRootContext()->getObjectList<T>();
+                return static_cast<ObjectListElement<T>*>(list->rend());
+            }
+    };
+}
+
+#endif /* _ObjectList_H__ */
Index: code/trunk/src/libraries/core/object/ObjectListBase.cc
===================================================================
--- code/trunk/src/libraries/core/object/ObjectListBase.cc	(revision 9667)
+++ code/trunk/src/libraries/core/object/ObjectListBase.cc	(revision 9667)
@@ -0,0 +1,158 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the ObjectListBase class.
+*/
+
+#include "ObjectListBase.h"
+
+#include <set>
+#include "Iterator.h"
+#include "Listable.h"
+#include "ObjectListIterator.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###  ObjectListBaseElement  ###
+    // ###############################
+    void ObjectListBaseElement::removeFromList()
+    {
+        if (this->list_)
+            this->list_->removeElement(this);
+    }
+
+    // ###############################
+    // ###     ObjectListBase      ###
+    // ###############################
+    /**
+        @brief Constructor: Sets default values.
+    */
+    ObjectListBase::ObjectListBase()
+    {
+        this->first_ = 0;
+        this->last_ = 0;
+        this->size_ = 0;
+    }
+
+    /**
+        @brief Destructor: Deletes all list-elements, but NOT THE OBJECTS.
+    */
+    ObjectListBase::~ObjectListBase()
+    {
+        ObjectListBaseElement* current = this->first_;
+        while (current)
+        {
+            ObjectListBaseElement* next = current->next_;
+
+            current->list_ = 0;
+            current->next_ = 0;
+            current->prev_ = 0;
+
+            current = next;
+        }
+    }
+
+    /**
+        @brief Notifies all listeners that the given element is about to get removed.
+        @param element The element that gets removed
+        This is mainly used for iterators which point at the removed element
+    */
+    void ObjectListBase::notifyRemovalListeners(ObjectListBaseElement* element) const
+    {
+        for (std::vector<ObjectListElementRemovalListener*>::const_iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+            (*it)->removedElement(element);
+    }
+
+    /**
+        @brief Adds a new object to the end of the list.
+        @param element The element to add
+    */
+    void ObjectListBase::addElement(ObjectListBaseElement* element)
+    {
+        if (element->list_)
+        {
+            orxout(internal_error) << "Element is already registered in another list" << endl;
+            return;
+        }
+
+        if (element->objectBase_)
+            orxout(verbose, context::object_list) << "Added object to " << element->objectBase_->getIdentifier()->getName() << "-list." << endl;
+
+        if (!this->last_)
+        {
+            // If the list is empty
+            this->last_ = element;
+            this->first_ = element; // There's only one object in the list now
+        }
+        else
+        {
+            // If the list isn't empty
+            ObjectListBaseElement* temp = this->last_;
+            this->last_ = element;
+            element->prev_ = temp;
+            temp->next_ = element;
+        }
+
+        element->list_ = this;
+        ++this->size_;
+    }
+
+    /**
+     * @brief Removes the element from the list
+     */
+    void ObjectListBase::removeElement(ObjectListBaseElement* element)
+    {
+        if (element->list_ != this)
+        {
+            orxout(internal_error) << "Element is not registered in this list" << endl;
+            return;
+        }
+
+        if (element->objectBase_)
+            orxout(verbose, context::object_list) << "Removing Object from " << element->objectBase_->getIdentifier()->getName() << "-list." << endl;
+        this->notifyRemovalListeners(element);
+
+        if (element->next_)
+            element->next_->prev_ = element->prev_;
+        else
+            this->last_ = element->prev_; // If there is no next_, we deleted the last object and have to update the last_ pointer of the list
+
+        if (element->prev_)
+            element->prev_->next_ = element->next_;
+        else
+            this->first_ = element->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
+
+        element->list_ = 0;
+        element->next_ = 0;
+        element->prev_ = 0;
+        --this->size_;
+    }
+}
Index: code/trunk/src/libraries/core/object/ObjectListBase.h
===================================================================
--- code/trunk/src/libraries/core/object/ObjectListBase.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/ObjectListBase.h	(revision 9667)
@@ -0,0 +1,167 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Declaration of the ObjectListBase class which stores all objects of each class.
+
+    orxonox::ObjectListBase is a double-linked list, used by @ref orxonox::Identifier "Identifiers"
+    to store all objects of a given class. Newly created objects are added to the list through the
+    @c RegisterObject() macro in the constructor.
+*/
+
+#ifndef _ObjectListBase_H__
+#define _ObjectListBase_H__
+
+#include "core/CorePrereqs.h"
+#include <vector>
+#include "Context.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###  ObjectListBaseElement  ###
+    // ###############################
+    /// The list-element of the ObjectListBase
+    class _CoreExport ObjectListBaseElement
+    {
+        public:
+            /**
+                @brief Constructor: Creates the list-element with an object.
+                @param objectBase The object to store
+            */
+            ObjectListBaseElement(Listable* object) : next_(0), prev_(0), objectBase_(object), list_(0) {}
+            virtual ~ObjectListBaseElement() { this->removeFromList(); }
+
+            virtual void changeContext(Context* oldContext, Context* newContext) = 0;
+
+            ObjectListBaseElement* next_;       //!< The next element in the list
+            ObjectListBaseElement* prev_;       //!< The previous element in the list
+            Listable* objectBase_;              //!< The object
+            ObjectListBase* list_;              //!< The list
+
+        protected:
+            void removeFromList();
+    };
+
+
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    /// The list-element that actually contains the object
+    template <class T>
+    class ObjectListElement : public ObjectListBaseElement
+    {
+        public:
+            ObjectListElement(T* object) : ObjectListBaseElement(static_cast<Listable*>(object)), object_(object) {}
+
+            virtual void changeContext(Context* oldContext, Context* newContext)
+            {
+                // add object to new context, but only if this element belongs exactly to the old context (and not to a sub-context to avoid re-adding objects
+                // multiple times if they are in multiple contexts)
+                if (oldContext->getObjectList<T>() == this->list_)
+                    newContext->addObject(this->object_);
+
+                // remove from old list
+                this->removeFromList();
+            }
+
+            T* object_;              //!< The object
+    };
+
+
+    // ########################################
+    // ### ObjectListElementRemovalListener ###
+    // ########################################
+    /// Gets called by the object list if an element is removed
+    class _CoreExport ObjectListElementRemovalListener
+    {
+        public:
+            virtual ~ObjectListElementRemovalListener() {}
+            virtual void removedElement(ObjectListBaseElement* element) = 0;
+    };
+
+    // ###############################
+    // ###     ObjectListBase      ###
+    // ###############################
+    /**
+        @brief The ObjectListBase contains all objects of a given class.
+
+        The ObjectListBase is used by Identifiers to store all objects of their class.
+        You can use Identifier::getObjects() to get the object-list from an Identifier.
+        Use @ref Iterator "Iterator<T>" to iterate through them.
+
+        Alternatively you can also use the static helper class @ref orxonox::ObjectList "ObjectList<T>"
+        to get the list of all objects of type @a T. Use @ref ObjectListIterator "ObjectListIterator<T>"
+        or @ref Iterator "Iterator<T>" to iterate through them.
+    */
+    class _CoreExport ObjectListBase
+    {
+        public:
+            ObjectListBase();
+            ~ObjectListBase();
+
+            void addElement(ObjectListBaseElement* element);
+            void removeElement(ObjectListBaseElement* element);
+
+            size_t size() const { return this->size_; }
+
+            /// Returns a pointer to the first element in the list. Works only with Iterator.
+            inline ObjectListBaseElement* begin() const { return this->first_; }
+            /// Returns a pointer to the element after the last element in the list. Works only with Iterator.
+            inline ObjectListBaseElement* end() const { return 0; }
+            /// Returns a pointer to the last element in the list. Works only with Iterator.
+            inline ObjectListBaseElement* rbegin() const { return this->last_; }
+            /// Returns a pointer to the element in front of the first element in the list. Works only with Iterator.
+            inline ObjectListBaseElement* rend() const { return 0; }
+
+            inline void registerRemovalListener(ObjectListElementRemovalListener* listener) { this->listeners_.push_back(listener); }
+            inline void unregisterRemovalListener(ObjectListElementRemovalListener* listener)
+            {
+                for (unsigned int i = 0; i < this->listeners_.size(); ++i)
+                {
+                    if (listeners_[i] == listener)
+                    {
+                        listeners_.erase(listeners_.begin() + i);
+                        break;
+                    }
+                }
+            }
+
+        private:
+            void notifyRemovalListeners(ObjectListBaseElement* element) const;
+
+            ObjectListBaseElement* first_;                              //!< The first element in the list
+            ObjectListBaseElement* last_;                               //!< The last element in the list
+            size_t size_;                                               //!< The number of elements in the list
+            std::vector<ObjectListElementRemovalListener*> listeners_;  //!< A list of Iterators pointing on an element in this list
+    };
+}
+
+#endif /* _ObjectListBase_H__ */
Index: code/trunk/src/libraries/core/object/ObjectListIterator.h
===================================================================
--- code/trunk/src/libraries/core/object/ObjectListIterator.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/ObjectListIterator.h	(revision 9667)
@@ -0,0 +1,110 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @ingroup Object ObjectList
+    @brief Definition of the ObjectListIterator class, used to iterate through object-lists.
+
+    @anchor ObjectListIteratorExample
+
+    @ref orxonox::ObjectListIterator "ObjectListIterator<T>" allows to iterate through
+    @ref orxonox::ObjectList "ObjectList<T>", containing all objects of type @a T. In contrast to
+    @ref orxonox::Iterator "Iterator<T>", this iterator is limited to the object-list of type @a T.
+    It is, however, much faster as it doesn't need a @c dynamic_cast.
+
+    Usage:
+    @code
+    for (ObjectListIterator<myClass> it = ObjectList<myClass>::begin(); it != ObjectList<myClass>::end(); ++it)
+    {
+        it->someFunction(...);
+        myClass* myObject = *it;
+    }
+    @endcode
+
+    @note @ref orxonox::ObjectList::iterator "ObjectList<T>::iterator" is identical to
+          @ref orxonox::ObjectListIterator "ObjectListIterator<T>" (it's just a typedef).
+*/
+
+#ifndef _ObjectListIterator_H__
+#define _ObjectListIterator_H__
+
+#include "core/CorePrereqs.h"
+#include "core/class/Identifier.h"
+#include "ObjectList.h"
+#include "IteratorBase.h"
+
+namespace orxonox
+{
+    /**
+        @brief ObjectListIterator<T> allows to iterate through the ObjectList of class @a T.
+
+        @see See @ref ObjectListIteratorExample "ObjectListIterator.h" for more information an example.
+    */
+    template <class T>
+    class ObjectListIterator : public IteratorBase<T, ObjectListIterator<T> >
+    {
+        public:
+            /**
+                @brief Constructor: Sets the element, whereon the ObjectListIterator points, to zero.
+            */
+            inline ObjectListIterator() : IteratorBase<T, ObjectListIterator<T> >(NULL) {}
+
+            /**
+                @brief Constructor: Sets this element to a given element.
+                @param element The element to start with
+            */
+            inline ObjectListIterator(ObjectListElement<T>* element) : IteratorBase<T, ObjectListIterator<T> >(element) {}
+
+            /**
+                @brief Constructor: Sets this element to the element of another ObjectListIterator.
+                @param other The other ObjectListIterator
+            */
+            inline ObjectListIterator(const IteratorBase<T, ObjectListIterator<T> >& other) : IteratorBase<T, ObjectListIterator<T> >(other) {}
+
+            /**
+                @brief Overloading of the *it operator: returns the pointer to the object.
+                @return The object the ObjectListIterator points at
+            */
+            inline T* operator*() const
+            {
+                return static_cast<ObjectListElement<T>*>(this->element_)->object_;
+            }
+
+            /**
+                @brief Overloading of the it-> operator: returns the pointer to the object.
+                @return The object the ObjectListIterator points at
+            */
+            inline T* operator->() const
+            {
+                return static_cast<ObjectListElement<T>*>(this->element_)->object_;
+            }
+    };
+}
+
+#endif /* _ObjectListIterator_H__ */
Index: code/trunk/src/libraries/core/object/SmartPtr.h
===================================================================
--- code/trunk/src/libraries/core/object/SmartPtr.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/SmartPtr.h	(revision 9667)
@@ -0,0 +1,316 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+// Inspired by boost::intrusive_ptr by Peter Dimov
+
+/**
+    @defgroup SmartPtr SmartPtr<T> and WeakPtr<T>
+    @ingroup Object
+*/
+
+/**
+    @file
+    @ingroup Object SmartPtr
+    @brief Definition of SmartPtr<T>, wraps a pointer to an object and keeps it alive.
+
+    @anchor SmartPtrExample
+
+    orxonox::SmartPtr is an implementation of a smart pointer - it wraps a pointer to an
+    object  and keeps this object alive until no SmartPtr points to this object anymore.
+    In contrast to orxonox::SharedPtr, SmartPtr works only with classes that are derived
+    from orxonox::Destroyable, because it's an intrusive implementation, meaning the
+    reference counter is stored in the object itself.
+
+    It's possible to use normal pointers and smart pointers to an object simultaneously.
+    You don't have to use SmartPtr all the time, you can create a SmartPtr for an object
+    at any time and also convert it back to a normal pointer if you like. This is possible
+    because the reference counter is stored in the object itself and not in SmartPtr (in
+    contrast to SharedPtr).
+
+    @b Important: If you want to delete an object, you must not use @c delete @c object but
+    rather @c object->destroy(). This function will check if there are smart pointers
+    pointing to the object. If yes, the object will be kept alive until all smart pointes
+    are destroyed. If no, the object is deleted instantly.
+
+    If all smart pointers that point to an object are destroyed, but you never called
+    @c object->destroy() before, the object will not be deleted! All a SmartPtr will do
+    is to really just keep an object alive, but it will not delete it automatically
+    unless you tried to destroy it before.
+
+    Example:
+    @code
+    class MyClass                                           // class declaration
+    {
+        public:
+            void setObject(OtherClass* object)              // passes a normal pointer which will be stored in a SmartPtr
+                { this->object_ = object; }
+
+            OtherClass* getObject() const                   // converts the SmartPtr to a normal pointer and returns it
+                { return this->object_; }
+
+        private:
+            SmartPtr<OtherClass> object_;                   // a pointer to an instance of OtherClass is stored in a SmartPtr
+    };
+    @endcode
+    In this example we assume that OtherClass is a child of Destroyable. We don't care
+    about the inheritance of MyClass though.
+
+    Now we create an instance of MyClass and assign a pointer to an instance of OtherClass:
+    @code
+    MyClass* myclass = new MyClass();                       // create an instance of MyClass
+    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
+    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
+
+    object->destroy();                                      // we try to destroy object, but there's still a SmartPtr pointing at it.
+
+    # object still exists at this point (because a SmartPtr points at it)
+
+    delete myclass;                                         // now we delete myclass, which also destroys the SmartPtr
+
+    # object doesn't exist anymore (because the SmartPtr is now destroyed)
+    @endcode
+
+    Now we look at the same example, but we first delete myclass, then destroy object:
+    @code
+    MyClass* myclass = new MyClass();                       // create an instance of MyClass
+    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
+    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
+
+    delete myclass;                                         // we delete myclass, which also destroys the SmartPtr
+
+    # object still exists at this point (because destroy() was not called yet)
+
+    object->destroy();                                      // now we try to destroy object, which works instantly
+
+    # object doesn't exist anymore (because we just destroyed it)
+    @endcode
+
+    Note that in any case @c object->destroy() has to be called to delete the object.
+    However if a SmartPtr points at it, the destruction is delayed until all SmartPtr
+    are destroyed.
+*/
+
+#ifndef _SmartPtr_H__
+#define _SmartPtr_H__
+
+#include "core/CorePrereqs.h"
+
+#include <cassert>
+
+#include "core/object/Destroyable.h"
+#include "WeakPtr.h"
+
+namespace orxonox
+{
+    /**
+        @brief A smart pointer which wraps a pointer to an object and keeps this object alive as long as the smart pointer exists.
+
+        @see See @ref SmartPtrExample "this description" for more information and an example.
+    */
+    template <class T>
+    class SmartPtr
+    {
+        public:
+            /// Constructor: Initializes the smart pointer with a null pointer.
+            inline SmartPtr() : pointer_(0), base_(0)
+            {
+            }
+
+            /// Constructor: Used to explicitly initialize the smart pointer with a null pointer
+            inline SmartPtr(int) : pointer_(0), base_(0)
+            {
+            }
+
+            /// Constructor: Initializes the smart pointer with a pointer to an object. @param pointer The pointer @param bAddRef If true, the reference counter is increased. Don't set this to false unless you know exactly what you're doing! (for example to avoid circular references if the @c this pointer of the possessing object is stored)
+            inline SmartPtr(T* pointer, bool bAddRef = true) : pointer_(pointer), base_(pointer)
+            {
+                if (this->base_ && bAddRef)
+                    this->base_->incrementReferenceCount();
+            }
+
+            /// Copy-constructor
+            inline SmartPtr(const SmartPtr& other) : pointer_(other.pointer_), base_(other.base_)
+            {
+                if (this->base_)
+                    this->base_->incrementReferenceCount();
+            }
+
+            /// Copy-constructor for smart pointers to objects of another class.
+            template <class O>
+            inline SmartPtr(const SmartPtr<O>& other) : pointer_(other.get()), base_(other.base_)
+            {
+                if (this->base_)
+                    this->base_->incrementReferenceCount();
+            }
+
+            /// Constructor: Initializes the smart pointer with the pointer that is stored in a WeakPtr.
+            template <class O>
+            inline SmartPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase())
+            {
+                if (this->base_)
+                    this->base_->incrementReferenceCount();
+            }
+
+            /// Destructor: Decrements the reference counter.
+            inline ~SmartPtr()
+            {
+                if (this->base_)
+                    this->base_->decrementReferenceCount();
+            }
+
+            /// Used to assign a null pointer.
+            inline SmartPtr& operator=(int)
+            {
+                SmartPtr(0).swap(*this);
+                return *this;
+            }
+
+            /// Assigns a new pointer.
+            inline SmartPtr& operator=(T* pointer)
+            {
+                SmartPtr(pointer).swap(*this);
+                return *this;
+            }
+
+            /// Assigns the wrapped pointer of another SmartPtr.
+            inline SmartPtr& operator=(const SmartPtr& other)
+            {
+                SmartPtr(other).swap(*this);
+                return *this;
+            }
+
+            /// Assigns the wrapped pointer of a SmartPtr of another class
+            template <class O>
+            inline SmartPtr& operator=(const SmartPtr<O>& other)
+            {
+                SmartPtr(other).swap(*this);
+                return *this;
+            }
+
+            /// Assigns the wrapped pointer of a WeakPtr.
+            template <class O>
+            inline SmartPtr& operator=(const WeakPtr<O>& other)
+            {
+                SmartPtr(other).swap(*this);
+                return *this;
+            }
+
+            /// Returns the wrapped pointer as @c T*
+            inline T* get() const
+            {
+                return this->pointer_;
+            }
+
+            /// Returns the wrapped pointer as @c Destroyable*
+            inline Destroyable* getBase() const
+            {
+                return this->base_;
+            }
+
+            /// Implicitly converts the SmartPtr to a pointer of type @c T*
+            inline operator T*() const
+            {
+                return this->pointer_;
+            }
+
+            /// Overloaded operator, returns a pointer to the stored object.
+            inline T* operator->() const
+            {
+                assert(this->pointer_ != 0);
+                return this->pointer_;
+            }
+
+            /// Overloaded operator, returns a reference to the stored object.
+            inline T& operator*() const
+            {
+                assert(this->pointer_ != 0);
+                return *this->pointer_;
+            }
+
+            /// Returns true if the wrapped pointer is NULL.
+            inline bool operator!() const
+            {
+                return (this->pointer_ == 0);
+            }
+
+            /// Swaps the contents of two smart pointers.
+            inline void swap(SmartPtr& other)
+            {
+                {
+                    T* temp = this->pointer_;
+                    this->pointer_ = other.pointer_;
+                    other.pointer_ = temp;
+                }
+                {
+                    Destroyable* temp = this->base_;
+                    this->base_ = other.base_;
+                    other.base_ = temp;
+                }
+            }
+
+            /// Resets the smart pointer (equivalent to assigning a NULL pointer).
+            inline void reset()
+            {
+                SmartPtr().swap(*this);
+            }
+
+        private:
+            T* pointer_;            ///< The wrapped pointer to an object of type @a T
+            Destroyable* base_;    ///< The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)
+    };
+
+    /// Swaps the contents of two smart pointers.
+    template <class T>
+    void swap(SmartPtr<T>& a, SmartPtr<T>& b)
+    {
+        a.swap(b);
+    }
+
+    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
+    template <class T, class U>
+    SmartPtr<T> static_pointer_cast(const SmartPtr<U>& p)
+    {
+        return static_cast<T*>(p.get());
+    }
+
+    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
+    template <class T, class U>
+    SmartPtr<T> const_pointer_cast(const SmartPtr<U>& p)
+    {
+        return const_cast<T*>(p.get());
+    }
+
+    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
+    template <class T, class U>
+    SmartPtr<T> dynamic_pointer_cast(const SmartPtr<U>& p)
+    {
+        return orxonox_cast<T*>(p.get());
+    }
+}
+
+#endif /* _SmartPtr_H__ */
Index: code/trunk/src/libraries/core/object/WeakPtr.h
===================================================================
--- code/trunk/src/libraries/core/object/WeakPtr.h	(revision 9667)
+++ code/trunk/src/libraries/core/object/WeakPtr.h	(revision 9667)
@@ -0,0 +1,286 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+// Inspired by boost::intrusive_ptr by Peter Dimov
+
+/**
+    @file
+    @ingroup Object SmartPtr
+    @brief Definition of WeakPtr<T>, wraps a pointer to an object.
+
+    @anchor WeakPtrExample
+
+    A WeakPtr wraps a pointer to an object. If the object gets deleted, the WeakPtr becomes
+    NULL. This can be used to store pointers to objects without knowing when they will be
+    destroyed.
+
+    WeakPtr works only with objects that are derived from orxonox::Destroyable, because
+    WeakPtr is intrusive and registers itself in the stored object, to get a notification if
+    the object is being deleted.
+
+    Example:
+    @code
+    MyClass* object = new MyClass();                    // create an instance of MyClass
+
+    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
+
+    if (pointer)                                        // checks if pointer is not NULL (which is true)
+        pointer->someFunction();                        // calls MyClass::someFunction()
+
+    object->destroy();                                  // calls destroy() which deletes the object
+
+    if (pointer)                                        // checks if pointer is not NULL (which is now false)
+        pointer->someFunction();                        // this will not be executed
+    @endcode
+    In this example we assumed that MyClass is derived of Destroyable (otherwise it couldn't
+    be used with a WeakPtr).
+
+    A callback can be registerd with the WeakPtr that will be called if the object gets deleted.
+    @code
+    void myCallback()                                   // definition of the callback function
+    {
+        orxout() << "Object destroyed" << endl;
+    }
+
+    MyClass* object = new MyClass();                    // create an instance of MyClass
+
+    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
+
+    pointer.setCallback(createFunctor(&myCallback));    // defines a callback
+
+    object->destroy();                                  // calls destroy() which deletes the object. prints "Object destroyed" to the console
+    @endcode
+*/
+
+#ifndef _WeakPtr_H__
+#define _WeakPtr_H__
+
+#include "core/CorePrereqs.h"
+
+#include <cassert>
+
+#include "core/object/Destroyable.h"
+#include "core/command/Functor.h"
+
+namespace orxonox
+{
+    /**
+        @brief WeakPtr wraps a pointer to an object, which becomes NULL if the object is deleted.
+
+        @see See @ref WeakPtrExample "this description" for more information and an example.
+    */
+    template <class T>
+    class WeakPtr : public DestructionListener
+    {
+        public:
+            /// Constructor: Initializes the weak pointer with a null pointer.
+            inline WeakPtr() : pointer_(0), base_(0), callback_(0)
+            {
+            }
+
+            /// Constructor: Used to explicitly initialize the weak pointer with a null pointer
+            inline WeakPtr(int) : pointer_(0), base_(0), callback_(0)
+            {
+            }
+
+            /// Constructor: Initializes the weak pointer with a pointer to an object.
+            inline WeakPtr(T* pointer) : pointer_(pointer), base_(pointer), callback_(0)
+            {
+                this->registerAsDestructionListener(this->base_);
+            }
+
+            /// Copy-constructor
+            inline WeakPtr(const WeakPtr& other) : pointer_(other.pointer_), base_(other.base_), callback_(0)
+            {
+                this->registerAsDestructionListener(this->base_);
+            }
+
+            /// Copy-constructor for weak pointers to objects of another class.
+            template <class O>
+            inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.base_), callback_(0)
+            {
+                this->registerAsDestructionListener(this->base_);
+            }
+
+            /// Destructor
+            inline virtual ~WeakPtr()
+            {
+                this->unregisterAsDestructionListener(this->base_);
+            }
+
+            /// Used to assign a null pointer.
+            inline WeakPtr& operator=(int)
+            {
+                WeakPtr(0).swap(*this);
+                return *this;
+            }
+
+            /// Assigns a new pointer.
+            inline WeakPtr& operator=(T* pointer)
+            {
+                WeakPtr(pointer).swap(*this);
+                return *this;
+            }
+
+            /// Assigns the wrapped pointer of another WeakPtr.
+            inline WeakPtr& operator=(const WeakPtr& other)
+            {
+                WeakPtr(other).swap(*this);
+                return *this;
+            }
+
+            /// Assigns the wrapped pointer of a WeakPtr of another class
+            template <class O>
+            inline WeakPtr& operator=(const WeakPtr<O>& other)
+            {
+                WeakPtr(other).swap(*this);
+                return *this;
+            }
+
+            /// Returns the wrapped pointer as @c T*
+            inline T* get() const
+            {
+                return this->pointer_;
+            }
+
+            /// Returns the wrapped pointer as @c Destroyable*
+            inline Destroyable* getBase() const
+            {
+                return this->base_;
+            }
+
+            /// Implicitly converts the WeakPtr to a pointer of type @c T*
+            inline operator T*() const
+            {
+                return this->pointer_;
+            }
+
+            /// Overloaded operator, returns a pointer to the stored object.
+            inline T* operator->() const
+            {
+                assert(this->pointer_ != 0);
+                return this->pointer_;
+            }
+
+            /// Overloaded operator, returns a reference to the stored object.
+            inline T& operator*() const
+            {
+                assert(this->pointer_ != 0);
+                return *this->pointer_;
+            }
+
+            /// Returns true if the wrapped pointer is NULL.
+            inline bool operator!() const
+            {
+                return (this->pointer_ == 0);
+            }
+
+            /// Swaps the contents of two weak pointers.
+            inline void swap(WeakPtr& other)
+            {
+                this->unregisterAsDestructionListener(this->base_);
+                other.unregisterAsDestructionListener(other.base_);
+
+                {
+                    T* temp = this->pointer_;
+                    this->pointer_ = other.pointer_;
+                    other.pointer_ = temp;
+                }
+                {
+                    Destroyable* temp = this->base_;
+                    this->base_ = other.base_;
+                    other.base_ = temp;
+                }
+
+                this->registerAsDestructionListener(this->base_);
+                other.registerAsDestructionListener(other.base_);
+            }
+
+            /// Resets the weak pointer (equivalent to assigning a NULL pointer).
+            inline void reset()
+            {
+                WeakPtr().swap(*this);
+            }
+
+            /// Registers a callback that will be executed if the stored object is destroyed.
+            inline void setCallback(const FunctorPtr& callback)
+            {
+                this->callback_ = callback;
+            }
+
+            /// Returns the registered callback.
+            inline const FunctorPtr& getCallback() const
+            {
+                return this->callback_;
+            }
+
+        private:
+            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted. Resets the wrapped pointer and executes the callback.
+            inline void objectDeleted()
+            {
+                this->base_ = 0;
+                this->pointer_ = 0;
+                if (this->callback_)
+                    (*this->callback_)();
+            }
+
+            T* pointer_;            ///< The wrapped pointer to an object of type @a T
+            Destroyable* base_;    ///< The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, WeakPtr couln't be used with forward declarations)
+            FunctorPtr callback_;   ///< This callback will be executed if the stored object is deleted
+    };
+
+    /// Swaps the contents of two weak pointers.
+    template <class T>
+    void swap(WeakPtr<T>& a, WeakPtr<T>& b)
+    {
+        a.swap(b);
+    }
+
+    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
+    template <class T, class U>
+    WeakPtr<T> static_pointer_cast(const WeakPtr<U>& p)
+    {
+        return static_cast<T*>(p.get());
+    }
+
+    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
+    template <class T, class U>
+    WeakPtr<T> const_pointer_cast(const WeakPtr<U>& p)
+    {
+        return const_cast<T*>(p.get());
+    }
+
+    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
+    template <class T, class U>
+    WeakPtr<T> dynamic_pointer_cast(const WeakPtr<U>& p)
+    {
+        return orxonox_cast<T*>(p.get());
+    }
+}
+
+#endif /* _WeakPtr_H__ */
