Index: code/branches/core2/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/core2/src/orxonox/core/CMakeLists.txt	(revision 941)
+++ code/branches/core2/src/orxonox/core/CMakeLists.txt	(revision 947)
@@ -19,4 +19,5 @@
   Namespace.cc
   NamespaceNode.cc
+  CommandExecutor.cc
 )
 
Index: code/branches/core2/src/orxonox/core/CommandExecutor.cc
===================================================================
--- code/branches/core2/src/orxonox/core/CommandExecutor.cc	(revision 947)
+++ code/branches/core2/src/orxonox/core/CommandExecutor.cc	(revision 947)
@@ -0,0 +1,851 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   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 "CommandExecutor.h"
+#include "ConsoleCommand.h"
+#include "util/String.h"
+#include "util/SubString.h"
+#include "Identifier.h"
+#include "Language.h"
+#include "Debug.h"
+#include "Executor.h"
+#include "ConfigValueContainer.h"
+
+#define COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE "set"
+#define COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY "tset"
+#define COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND "bind"
+
+namespace orxonox
+{
+    ConsoleCommandShortcutGeneric(keyword1, createExecutor((FunctorStatic*)0, "set", AccessLevel::User));
+    ConsoleCommandShortcutGeneric(keyword2, createExecutor((FunctorStatic*)0, "tset", AccessLevel::User));
+    ConsoleCommandShortcutGeneric(keyword3, createExecutor((FunctorStatic*)0, "bind", AccessLevel::User));
+
+    SubString CommandExecutor::tokens_s;
+    std::string CommandExecutor::lastProcessedCommand_s;
+
+    std::list<const std::string*> CommandExecutor::listOfPossibleFunctionClasses_s;
+    std::list<const std::string*> CommandExecutor::listOfPossibleShortcuts_s;
+    std::list<const std::string*> CommandExecutor::listOfPossibleFunctions_s;
+    std::list<const std::string*> CommandExecutor::listOfPossibleConfigValueClasses_s;
+    std::list<const std::string*> CommandExecutor::listOfPossibleConfigValues_s;
+    std::list<const std::string*> CommandExecutor::listOfPossibleKeys_s;
+
+    Identifier* CommandExecutor::functionclass_s;
+    Identifier* CommandExecutor::configvalueclass_s;
+    ExecutorStatic* CommandExecutor::shortcut_s;
+    ExecutorStatic* CommandExecutor::function_s;
+    ConfigValueContainer* CommandExecutor::configvalue_s;
+    ConfigValueContainer* CommandExecutor::key_s;
+
+    std::string CommandExecutor::errorMessage_s;
+    CommandExecutor::CommandState CommandExecutor::state_s;
+
+    std::map<std::string, ExecutorStatic*> CommandExecutor::consoleCommandShortcuts_s;
+    std::map<std::string, ExecutorStatic*> CommandExecutor::consoleCommandShortcuts_LC_s;
+
+    bool CommandExecutor::addConsoleCommandShortcut(ExecutorStatic* executor)
+    {
+        CommandExecutor::consoleCommandShortcuts_s[executor->getName()] = executor;
+        CommandExecutor::consoleCommandShortcuts_LC_s[getLowercase(executor->getName())] = executor;
+        return true;
+    }
+
+    /**
+        @brief Returns the executor of a console command shortcut with given name.
+        @brief name The name of the requested console command shortcut
+        @return The executor of the requested console command shortcut
+    */
+    ExecutorStatic* CommandExecutor::getConsoleCommandShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::consoleCommandShortcuts_s.find(name);
+        if (it != CommandExecutor::consoleCommandShortcuts_s.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the executor of a console command shortcut with given name in lowercase.
+        @brief name The name of the requested console command shortcut in lowercase
+        @return The executor of the requested console command shortcut
+    */
+    ExecutorStatic* CommandExecutor::getLowercaseConsoleCommandShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::consoleCommandShortcuts_LC_s.find(name);
+        if (it != CommandExecutor::consoleCommandShortcuts_LC_s.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    bool CommandExecutor::execute(const std::string& command)
+    {
+        if (CommandExecutor::lastProcessedCommand_s != command)
+            CommandExecutor::parse(command);
+
+        switch (CommandExecutor::state_s)
+        {
+            case CS_Empty:
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                // not enough parameters
+                break;
+            case CS_Shortcut_Finished:
+                // call the shortcut
+                if (CommandExecutor::shortcut_s != 0)
+                    return CommandExecutor::shortcut_s->parse(CommandExecutor::tokens_s.subSet(1).join());
+                break;
+            case CS_Function:
+                break;
+            case CS_Function_Params:
+                // not enough parameters
+                break;
+            case CS_Function_Finished:
+                // call the shortcut
+                if (CommandExecutor::function_s != 0)
+                    return CommandExecutor::function_s->parse(CommandExecutor::tokens_s.subSet(2).join());
+                break;
+            case CS_ConfigValueClass:
+                break;
+            case CS_ConfigValue:
+                break;
+            case CS_ConfigValueType:
+                // not enough parameters
+                break;
+            case CS_ConfigValueFinished:
+                // set the config value
+                if (CommandExecutor::configvalue_s != 0)
+                    return CommandExecutor::configvalue_s->parseString(CommandExecutor::tokens_s.subSet(3).join());
+                break;
+            case CS_KeybindKey:
+                break;
+            case CS_KeybindCommand:
+                // not enough parameters
+                break;
+            case CS_KeybindFinished:
+                // set the keybind
+                // ...todo
+                break;
+            case CS_Error:
+                break;
+        }
+
+        return false;
+    }
+
+    std::string CommandExecutor::complete(const std::string& command)
+    {
+        if (CommandExecutor::lastProcessedCommand_s != command)
+            CommandExecutor::parse(command);
+
+        switch (CommandExecutor::state_s)
+        {
+            case CS_Empty:
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                break;
+            case CS_Shortcut_Finished:
+                break;
+            case CS_Function:
+                break;
+            case CS_Function_Params:
+                break;
+            case CS_Function_Finished:
+                break;
+            case CS_ConfigValueClass:
+                break;
+            case CS_ConfigValue:
+                break;
+            case CS_ConfigValueType:
+                break;
+            case CS_ConfigValueFinished:
+                break;
+            case CS_KeybindKey:
+                break;
+            case CS_KeybindCommand:
+                break;
+            case CS_KeybindFinished:
+                break;
+            case CS_Error:
+                break;
+        }
+
+        return CommandExecutor::lastProcessedCommand_s;
+    }
+
+    std::string CommandExecutor::hint(const std::string& command)
+    {
+        if (CommandExecutor::lastProcessedCommand_s != command)
+            CommandExecutor::parse(command);
+
+        switch (CommandExecutor::state_s)
+        {
+            case CS_Empty:
+                return (CommandExecutor::dump(CommandExecutor::listOfPossibleShortcuts_s) + "\n" + CommandExecutor::dump(CommandExecutor::listOfPossibleFunctionClasses_s));
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                break;
+            case CS_Shortcut_Params:
+                if (CommandExecutor::shortcut_s != 0)
+                    return CommandExecutor::dump(CommandExecutor::shortcut_s);
+                break;
+            case CS_Shortcut_Finished:
+                break;
+            case CS_Function:
+                return CommandExecutor::dump(CommandExecutor::listOfPossibleFunctions_s);
+                break;
+            case CS_Function_Params:
+                if (CommandExecutor::function_s != 0)
+                    return CommandExecutor::dump(CommandExecutor::function_s);
+                break;
+            case CS_Function_Finished:
+                break;
+            case CS_ConfigValueClass:
+                return CommandExecutor::dump(CommandExecutor::listOfPossibleConfigValueClasses_s);
+                break;
+            case CS_ConfigValue:
+                return CommandExecutor::dump(CommandExecutor::listOfPossibleConfigValues_s);
+                break;
+            case CS_ConfigValueType:
+                if (CommandExecutor::configvalue_s != 0)
+                    CommandExecutor::dump(CommandExecutor::configvalue_s);
+                break;
+            case CS_ConfigValueFinished:
+                break;
+            case CS_KeybindKey:
+                return CommandExecutor::dump(CommandExecutor::listOfPossibleKeys_s);
+                break;
+            case CS_KeybindCommand:
+                if (CommandExecutor::key_s != 0)
+                    CommandExecutor::dump(CommandExecutor::key_s);
+                break;
+            case CS_KeybindFinished:
+                break;
+            case CS_Error:
+                return "Error";
+                break;
+        }
+
+        return "";
+    }
+
+    void CommandExecutor::parse(const std::string& command, bool bInitialize)
+    {
+        CommandExecutor::tokens_s.split((command + CommandExecutor::cursor_s), " ", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+        CommandExecutor::lastProcessedCommand_s = command;
+
+        if (bInitialize)
+            CommandExecutor::initialize();
+
+        switch (CommandExecutor::state_s)
+        {
+            case CS_Empty:
+                if (CommandExecutor::argumentsGiven() == 0)
+                {
+                    // We want a hint for the first token
+                    // Check if there is already a perfect match
+                    CommandExecutor::functionclass_s = CommandExecutor::getIdentifierOfPossibleFunctionClass(CommandExecutor::getToken(0));
+                    CommandExecutor::shortcut_s = CommandExecutor::getExecutorOfPossibleShortcut(CommandExecutor::getToken(0));
+
+                    if ((CommandExecutor::functionclass_s != 0) || (CommandExecutor::shortcut_s != 0))
+                    {
+                        // Yes, there is a class or a shortcut with the searched name
+                        // Add a whitespace and continue parsing
+                        CommandExecutor::state_s = CS_FunctionClass_Or_Shortcut_Or_Keyword;
+                        CommandExecutor::parse(command + " ", false);
+                        return;
+                    }
+
+                    // No perfect match: Create the lists of all possible classes and shortcuts and return
+                    CommandExecutor::createListOfPossibleFunctionClasses(CommandExecutor::getToken(0));
+                    CommandExecutor::createListOfPossibleShortcuts(CommandExecutor::getToken(0));
+                    CommandExecutor::state_s = CS_Empty;
+                    return;
+                }
+                else
+                {
+                    // There is at least one argument: Check if it's a shortcut, a classname or a special keyword
+                    CommandExecutor::state_s = CS_FunctionClass_Or_Shortcut_Or_Keyword;
+                    CommandExecutor::parse(command, false);
+                    return;
+                }
+                break;
+            case CS_FunctionClass_Or_Shortcut_Or_Keyword:
+                if (CommandExecutor::argumentsGiven() >= 1)
+                {
+                    if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY))
+                    {
+                        // We want to set a config value
+                        CommandExecutor::state_s = CS_ConfigValueClass;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                    else if (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND)
+                    {
+                        // We want to set a keybinding
+                        CommandExecutor::state_s = CS_KeybindKey;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+
+                    if (CommandExecutor::functionclass_s == 0)
+                        CommandExecutor::functionclass_s = CommandExecutor::getIdentifierOfPossibleFunctionClass(CommandExecutor::getToken(0));
+                    if (CommandExecutor::shortcut_s == 0)
+                        CommandExecutor::shortcut_s = CommandExecutor::getExecutorOfPossibleShortcut(CommandExecutor::getToken(0));
+
+                    if ((CommandExecutor::functionclass_s == 0) && (CommandExecutor::shortcut_s == 0))
+                    {
+                        // Argument 1 seems to be wrong
+                        AddLanguageEntry("CommandExecutor::NoSuchCommandOrClassName", "No such command or classname");
+                        CommandExecutor::errorMessage_s = (CommandExecutor::getToken(0) + ": " + GetLocalisation("CommandExecutor::NoSuchCommandOrClassName"));
+                        CommandExecutor::state_s = CS_Error;
+                        return;
+                    }
+                    else if (CommandExecutor::shortcut_s != 0)
+                    {
+                        // Argument 1 is a shortcut: Return the needed parameter types
+                        CommandExecutor::state_s = CS_Shortcut_Params;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                    else
+                    {
+                        // Argument 1 is a classname: Return the possible functions
+                        CommandExecutor::state_s = CS_Function;
+                        CommandExecutor::parse(command, false);
+                        return;
+                    }
+                }
+                else
+                {
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Shortcut_Params:
+                if (CommandExecutor::shortcut_s != 0)
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::enoughParametersGiven(1, CommandExecutor::shortcut_s))
+                    {
+                        CommandExecutor::state_s = CS_Shortcut_Finished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Function:
+                if (CommandExecutor::functionclass_s != 0)
+                {
+                    // We have a valid classname
+                    // Check if there is a second argument
+                    if (CommandExecutor::argumentsGiven() >= 2)
+                    {
+                        // There is a second argument: Check if it's a valid functionname
+                        CommandExecutor::function_s = CommandExecutor::getExecutorOfPossibleFunction(CommandExecutor::getToken(1), CommandExecutor::functionclass_s);
+                        if (CommandExecutor::function_s == 0)
+                        {
+                            // Argument 2 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchFunctionnameIn", "No such functionname in");
+                            CommandExecutor::errorMessage_s = (CommandExecutor::getToken(1) + ": " + GetLocalisation("CommandExecutor::NoSuchFunctionnameIn") + " " + CommandExecutor::functionclass_s->getName());
+                            CommandExecutor::state_s = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 2 seems to be a valid functionname: Get the parameters
+                            CommandExecutor::state_s = CS_Function_Params;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There is no finished second argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::tokens_s.size() >= 2)
+                        {
+                            CommandExecutor::function_s = CommandExecutor::getExecutorOfPossibleFunction(CommandExecutor::getToken(1), CommandExecutor::functionclass_s);
+                            if (CommandExecutor::function_s != 0)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::state_s = CS_Function_Params;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible functions and return
+                        CommandExecutor::createListOfPossibleFunctions(CommandExecutor::getToken(1), CommandExecutor::functionclass_s);
+                        CommandExecutor::state_s = CS_Function;
+                        return;
+                    }
+                }
+                else
+                {
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Function_Params:
+                if ((CommandExecutor::functionclass_s != 0) && (CommandExecutor::function_s != 0))
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::enoughParametersGiven(2, CommandExecutor::function_s))
+                    {
+                        CommandExecutor::state_s = CS_Function_Finished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValueClass:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)))
+                {
+                    // We want to set a config value
+                    // Check if there is a second argument
+                    if (CommandExecutor::argumentsGiven() >= 2)
+                    {
+                        // There is a second argument: Check if it's a valid classname
+                        CommandExecutor::configvalueclass_s = CommandExecutor::getIdentifierOfPossibleConfigValueClass(CommandExecutor::getToken(1));
+                        if (CommandExecutor::configvalueclass_s == 0)
+                        {
+                            // Argument 2 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchClassWithConfigValues", "No such class with config values");
+                            CommandExecutor::errorMessage_s = (CommandExecutor::getToken(1) + ": " + GetLocalisation("CommandExecutor::NoSuchClassWithConfigValues"));
+                            CommandExecutor::state_s = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 2 seems to be a valid classname: Search for possible config values
+                            CommandExecutor::state_s = CS_ConfigValue;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There's no finished second argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::tokens_s.size() >= 2)
+                        {
+                            CommandExecutor::configvalueclass_s = CommandExecutor::getIdentifierOfPossibleConfigValueClass(CommandExecutor::getToken(1));
+                            if (CommandExecutor::configvalueclass_s != 0)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::state_s = CS_ConfigValue;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible classnames and return
+                        CommandExecutor::createListOfPossibleConfigValueClasses(CommandExecutor::getToken(1));
+                        CommandExecutor::state_s = CS_ConfigValueClass;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValue:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) && (CommandExecutor::configvalueclass_s != 0))
+                {
+                    // Check if there is a third argument
+                    if (CommandExecutor::argumentsGiven() >= 3)
+                    {
+                        // There is a third argument: Check if it's a valid config value
+                        CommandExecutor::configvalue_s = CommandExecutor::getContainerOfPossibleConfigValue(CommandExecutor::getToken(2), CommandExecutor::configvalueclass_s);
+                        if (CommandExecutor::configvalue_s == 0)
+                        {
+                            // Argument 3 seems to be wrong
+                            AddLanguageEntry("CommandExecutor::NoSuchConfigValueIn", "No such config value in");
+                            CommandExecutor::errorMessage_s = (CommandExecutor::getToken(2) + ": " + GetLocalisation("CommandExecutor::NoSuchConfigValueIn") + " " + CommandExecutor::configvalueclass_s->getName());
+                            CommandExecutor::state_s = CS_Error;
+                            return;
+                        }
+                        else
+                        {
+                            // Argument 3 seems to be a valid config value: Get the type
+                            CommandExecutor::state_s = CS_ConfigValueType;
+                            CommandExecutor::parse(command, false);
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // There is no finished third argument
+                        // Check if there's already a perfect match
+                        if (CommandExecutor::tokens_s.size() >= 3)
+                        {
+                            CommandExecutor::configvalue_s = CommandExecutor::getContainerOfPossibleConfigValue(CommandExecutor::getToken(2), CommandExecutor::configvalueclass_s);
+                            if (CommandExecutor::configvalueclass_s != 0)
+                            {
+                                // There is a perfect match: Add a whitespace and continue parsing
+                                CommandExecutor::state_s = CS_ConfigValueType;
+                                CommandExecutor::parse(command + " ", false);
+                                return;
+                            }
+                        }
+
+                        // No perfect match: Create the list of all possible config values
+                        CommandExecutor::createListOfPossibleConfigValues(CommandExecutor::getToken(2), CommandExecutor::configvalueclass_s);
+                        CommandExecutor::state_s = CS_ConfigValueType;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_ConfigValueType:
+                if (((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE) || (CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) && (CommandExecutor::configvalueclass_s != 0) && (CommandExecutor::configvalue_s != 0))
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::tokens_s.size() >= 4)
+                    {
+                        CommandExecutor::state_s = CS_ConfigValueFinished;
+                        return;
+                    }
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_KeybindKey:
+                if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND))
+                {
+                    // todo
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_KeybindCommand:
+                if ((CommandExecutor::getToken(0) == COMMAND_EXECUTOR_KEYWORD_SET_KEYBIND) && (false)) // todo
+                {
+                    // Valid command
+                    // Check if there are enough parameters
+                    if (CommandExecutor::tokens_s.size() >= 3)
+                    {
+                        CommandExecutor::state_s = CS_KeybindFinished;
+                        return;
+                    }
+
+                }
+                else
+                {
+                    // Something is wrong
+                    CommandExecutor::state_s = CS_Error;
+                    return;
+                }
+                break;
+            case CS_Shortcut_Finished:
+                // Nothing to do
+                break;
+            case CS_Function_Finished:
+                // Nothing to do
+                break;
+            case CS_ConfigValueFinished:
+                // Nothing to do
+                break;
+            case CS_KeybindFinished:
+                // Nothing to do
+                break;
+            case CS_Error:
+                // This is bad
+                break;
+        }
+    }
+
+    void CommandExecutor::initialize()
+    {
+        CommandExecutor::listOfPossibleFunctionClasses_s.clear();
+        CommandExecutor::listOfPossibleShortcuts_s.clear();
+        CommandExecutor::listOfPossibleFunctions_s.clear();
+        CommandExecutor::listOfPossibleConfigValueClasses_s.clear();
+        CommandExecutor::listOfPossibleConfigValues_s.clear();
+        CommandExecutor::listOfPossibleKeys_s.clear();
+
+        CommandExecutor::functionclass_s = 0;
+        CommandExecutor::configvalueclass_s = 0;
+        CommandExecutor::shortcut_s = 0;
+        CommandExecutor::function_s = 0;
+        CommandExecutor::configvalue_s = 0;
+        CommandExecutor::key_s = 0;
+
+        CommandExecutor::errorMessage_s = "";
+        CommandExecutor::state_s = CS_Empty;
+    }
+
+    bool CommandExecutor::argumentsGiven(unsigned int num)
+    {
+        // Because we added a cursor we have +1 arguments
+        // There are num arguments given if there are at least num arguments + one cursor
+        return (CommandExecutor::tokens_s.size() >= (num + 1));
+    }
+
+    unsigned int CommandExecutor::argumentsGiven()
+    {
+        // Because we added a cursor we have +1 arguments
+        if (CommandExecutor::tokens_s.size() >= 1)
+            return (CommandExecutor::tokens_s.size() - 1);
+        else
+            return 0;
+    }
+
+    std::string CommandExecutor::getToken(unsigned int index)
+    {
+        if ((index >= 0) && (index < (CommandExecutor::tokens_s.size() - 1)))
+            return CommandExecutor::tokens_s[index];
+        else if (index == (CommandExecutor::tokens_s.size() - 1))
+            return CommandExecutor::tokens_s[index].substr(0, CommandExecutor::tokens_s[index].size() - 1);
+        else
+            return "";
+    }
+
+    bool CommandExecutor::enoughParametersGiven(unsigned int head, Executor* executor)
+    {
+        unsigned int neededParams = head + executor->getParamCount();
+        for (unsigned int i = executor->getParamCount() - 1; i >= 0; i--)
+        {
+            if (executor->defaultValueSet(i))
+                neededParams--;
+            else
+                break;
+        }
+        return (CommandExecutor::tokens_s.size() >= neededParams);
+    }
+
+    void CommandExecutor::createListOfPossibleFunctionClasses(const std::string& fragment)
+    {
+        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMapBegin(); it != Identifier::getLowercaseIdentifierMapEnd(); ++it)
+        {
+            if ((*it).second->hasConsoleCommands())
+            {
+                if ((*it).first.find(getLowercase(fragment)) == 0)
+                {
+                    CommandExecutor::listOfPossibleFunctionClasses_s.push_back(&(*it).first);
+                }
+            }
+        }
+
+        CommandExecutor::listOfPossibleFunctionClasses_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleShortcuts(const std::string& fragment)
+    {
+        for (std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMapBegin(); it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0)
+            {
+                CommandExecutor::listOfPossibleShortcuts_s.push_back(&(*it).first);
+            }
+        }
+
+        CommandExecutor::listOfPossibleShortcuts_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier)
+    {
+        for (std::map<std::string, ExecutorStatic*>::const_iterator it = identifier->getLowercaseConsoleCommandMapBegin(); it != identifier->getLowercaseConsoleCommandMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0)
+            {
+                CommandExecutor::listOfPossibleFunctions_s.push_back(&(*it).first);
+            }
+        }
+
+        CommandExecutor::listOfPossibleFunctions_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleConfigValueClasses(const std::string& fragment)
+    {
+        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMapBegin(); it != Identifier::getLowercaseIdentifierMapEnd(); ++it)
+        {
+            if ((*it).second->hasConfigValues())
+            {
+                if ((*it).first.find(getLowercase(fragment)) == 0)
+                {
+                    CommandExecutor::listOfPossibleConfigValueClasses_s.push_back(&(*it).first);
+                }
+            }
+        }
+
+        CommandExecutor::listOfPossibleConfigValueClasses_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleConfigValues(const std::string& fragment, Identifier* identifier)
+    {
+        for (std::map<std::string, ConfigValueContainer*>::const_iterator it = identifier->getLowercaseConfigValueMapBegin(); it != identifier->getLowercaseConfigValueMapEnd(); ++it)
+        {
+            if ((*it).first.find(getLowercase(fragment)) == 0)
+            {
+                CommandExecutor::listOfPossibleConfigValues_s.push_back(&(*it).first);
+            }
+        }
+
+        CommandExecutor::listOfPossibleConfigValues_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    void CommandExecutor::createListOfPossibleKeys(const std::string& fragment)
+    {
+        // todo
+
+        CommandExecutor::listOfPossibleKeys_s.sort(CommandExecutor::compareStringsInList);
+    }
+
+    bool CommandExecutor::compareStringsInList(const std::string* first, const std::string* second)
+    {
+        return ((*first) < (*second));
+    }
+
+    Identifier* CommandExecutor::getIdentifierOfPossibleFunctionClass(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMap().find(getLowercase(name));
+        if ((it != Identifier::getLowercaseIdentifierMapEnd()) && (*it).second->hasConsoleCommands())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ExecutorStatic* CommandExecutor::getExecutorOfPossibleShortcut(const std::string& name)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMap().find(getLowercase(name));
+        if (it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ExecutorStatic* CommandExecutor::getExecutorOfPossibleFunction(const std::string& name, Identifier* identifier)
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = identifier->getLowercaseConsoleCommandMap().find(getLowercase(name));
+        if (it != identifier->getLowercaseConsoleCommandMapEnd())
+            return (*it).second;
+
+        return 0;
+    }
+
+    Identifier* CommandExecutor::getIdentifierOfPossibleConfigValueClass(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMap().find(getLowercase(name));
+        if ((it != Identifier::getLowercaseIdentifierMapEnd()) && (*it).second->hasConfigValues())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ConfigValueContainer* CommandExecutor::getContainerOfPossibleConfigValue(const std::string& name, Identifier* identifier)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = identifier->getLowercaseConfigValueMap().find(getLowercase(name));
+        if (it != identifier->getLowercaseConfigValueMapEnd())
+            return (*it).second;
+
+        return 0;
+    }
+
+    ConfigValueContainer* CommandExecutor::getContainerOfPossibleKey(const std::string& name)
+    {
+        // todo
+
+        return 0;
+    }
+
+    std::string CommandExecutor::dump(const std::list<const std::string*>& list)
+    {
+        std::string output = "";
+        for (std::list<const std::string*>::const_iterator it = list.begin(); it != list.end(); ++it)
+        {
+            if (it != list.begin())
+                output += " ";
+
+            output += (**it);
+        }
+        return output;
+    }
+
+    std::string CommandExecutor::dump(const ExecutorStatic* executor)
+    {
+        std::string output = "";
+        for (unsigned int i = 0; i < executor->getParamCount(); i++)
+        {
+            if (i != 0)
+                output += " ";
+
+            if (executor->defaultValueSet(i))
+                output += "[";
+            else
+                output += "{";
+
+            output += executor->getTypenameParam(i);
+
+            if (executor->defaultValueSet(i))
+                output += "]";
+            else
+                output += "}";
+        }
+        return output;
+    }
+
+    std::string CommandExecutor::dump(const ConfigValueContainer* container)
+    {
+        return container->getTypename();
+    }
+}
Index: code/branches/core2/src/orxonox/core/CommandExecutor.h
===================================================================
--- code/branches/core2/src/orxonox/core/CommandExecutor.h	(revision 947)
+++ code/branches/core2/src/orxonox/core/CommandExecutor.h	(revision 947)
@@ -0,0 +1,142 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _CommandExecutor_H__
+#define _CommandExecutor_H__
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "CorePrereqs.h"
+
+class SubString;
+
+namespace orxonox
+{
+    class _CoreExport CommandExecutor
+    {
+        enum CommandState
+        {
+            CS_Empty,
+            CS_FunctionClass_Or_Shortcut_Or_Keyword,
+            CS_Shortcut_Params,
+            CS_Shortcut_Finished,
+            CS_Function,
+            CS_Function_Params,
+            CS_Function_Finished,
+            CS_ConfigValueClass,
+            CS_ConfigValue,
+            CS_ConfigValueType,
+            CS_ConfigValueFinished,
+            CS_KeybindKey,
+            CS_KeybindCommand,
+            CS_KeybindFinished,
+            CS_Error
+        };
+
+        public:
+            static bool execute(const std::string& command);
+            static std::string complete(const std::string& command);
+            static std::string hint(const std::string& command);
+
+            static bool addConsoleCommandShortcut(ExecutorStatic* executor);
+            static ExecutorStatic* getConsoleCommandShortcut(const std::string& name);
+            static ExecutorStatic* getLowercaseConsoleCommandShortcut(const std::string& name);
+
+            /** @brief Returns the map that stores all console commands. @return The const_iterator */
+            static inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandShortcutMap() { return CommandExecutor::consoleCommandShortcuts_s; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapBegin() { return CommandExecutor::consoleCommandShortcuts_s.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapEnd() { return CommandExecutor::consoleCommandShortcuts_s.end(); }
+
+            /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandShortcutMap() { return CommandExecutor::consoleCommandShortcuts_LC_s; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapBegin() { return CommandExecutor::consoleCommandShortcuts_LC_s.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapEnd() { return CommandExecutor::consoleCommandShortcuts_LC_s.end(); }
+
+        private:
+            static void parse(const std::string& command, bool bInitialize = true);
+            static void initialize();
+
+            static bool argumentsGiven(unsigned int num);
+            static unsigned int argumentsGiven();
+
+            static std::string getToken(unsigned int index);
+
+            static bool enoughParametersGiven(unsigned int head, Executor* executor);
+
+            static void createListOfPossibleShortcuts(const std::string& fragment);
+            static void createListOfPossibleFunctionClasses(const std::string& fragment);
+            static void createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier);
+            static void createListOfPossibleConfigValueClasses(const std::string& fragment);
+            static void createListOfPossibleConfigValues(const std::string& fragment, Identifier* identifier);
+            static void createListOfPossibleKeys(const std::string& fragment);
+
+            static bool compareStringsInList(const std::string* first, const std::string* second);
+
+            static std::string dump(const std::list<const std::string*>& list);
+            static std::string dump(const ExecutorStatic* executor);
+            static std::string dump(const ConfigValueContainer* container);
+
+            static Identifier* getIdentifierOfPossibleFunctionClass(const std::string& name);
+            static ExecutorStatic* getExecutorOfPossibleShortcut(const std::string& name);
+            static ExecutorStatic* getExecutorOfPossibleFunction(const std::string& name, Identifier* identifier);
+            static Identifier* getIdentifierOfPossibleConfigValueClass(const std::string& name);
+            static ConfigValueContainer* getContainerOfPossibleConfigValue(const std::string& name, Identifier* identifier);
+            static ConfigValueContainer* getContainerOfPossibleKey(const std::string& name);
+
+            static const char cursor_s = '$';
+
+            static std::string lastProcessedCommand_s;
+            static SubString tokens_s;
+            static std::list<const std::string*> listOfPossibleFunctionClasses_s;
+            static std::list<const std::string*> listOfPossibleShortcuts_s;
+            static std::list<const std::string*> listOfPossibleFunctions_s;
+            static std::list<const std::string*> listOfPossibleConfigValueClasses_s;
+            static std::list<const std::string*> listOfPossibleConfigValues_s;
+            static std::list<const std::string*> listOfPossibleKeys_s;
+
+            static Identifier* functionclass_s;
+            static Identifier* configvalueclass_s;
+            static ExecutorStatic* shortcut_s;
+            static ExecutorStatic* function_s;
+            static ConfigValueContainer* configvalue_s;
+            static ConfigValueContainer* key_s;
+
+            static std::string errorMessage_s;
+            static CommandState state_s;
+
+            static std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_s;
+            static std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_LC_s;
+    };
+}
+
+#endif /* _CommandExecutor_H__ */
Index: code/branches/core2/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- code/branches/core2/src/orxonox/core/ConfigValueContainer.cc	(revision 941)
+++ code/branches/core2/src/orxonox/core/ConfigValueContainer.cc	(revision 947)
@@ -181,5 +181,5 @@
         @return True if the string was successfully parsed
     */
-    bool ConfigValueContainer::parseString(const std::string& input, MultiTypeMath& defvalue)
+    bool ConfigValueContainer::parseString(const std::string& input, const MultiTypeMath& defvalue)
     {
         if (defvalue.getType() == MT_int)
Index: code/branches/core2/src/orxonox/core/ConfigValueContainer.h
===================================================================
--- code/branches/core2/src/orxonox/core/ConfigValueContainer.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/ConfigValueContainer.h	(revision 947)
@@ -102,5 +102,5 @@
             const std::string& getDescription() const;
 
-            bool parseString(const std::string& input, MultiTypeMath& defvalue);
+            bool parseString(const std::string& input, const MultiTypeMath& defvalue = MT_null);
             bool valueToString(std::string* output, MultiTypeMath& input);
             void resetConfigFileEntry();
@@ -110,4 +110,7 @@
             static bool isEmpty(const std::string& line);
             static bool isComment(const std::string& line);
+
+            inline std::string getTypename() const
+                { return this->value_.getTypename(); }
 
         private:
Index: code/branches/core2/src/orxonox/core/ConsoleCommand.h
===================================================================
--- code/branches/core2/src/orxonox/core/ConsoleCommand.h	(revision 947)
+++ code/branches/core2/src/orxonox/core/ConsoleCommand.h	(revision 947)
@@ -0,0 +1,52 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ConsoleCommand_H__
+#define _ConsoleCommand_H__
+
+#include "Executor.h"
+#include "ClassManager.h"
+#include "Identifier.h"
+#include "CommandExecutor.h"
+
+
+
+#define ConsoleCommand(classname, function, accesslevel, bCreateShortcut) \
+    ConsoleCommandGeneric(classname##function##consolecommand__, classname, orxonox::createExecutor(orxonox::createFunctor(&classname::function), #function, accesslevel), bCreateShortcut)
+
+#define ConsoleCommandGeneric(fakevariable, classname, executor, bCreateShortcut) \
+//    Executor& fakevariable = ClassManager<classname>::getIdentifier()->addConsoleCommand((ExecutorStatic*)executor, bCreateShortcut)
+
+
+#define ConsoleCommandShortcut(function, accesslevel) \
+    ConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createExecutor(orxonox::createFunctor(&classname::function), #function, accesslevel))
+
+#define ConsoleCommandShortcutGeneric(fakevariable, executor) \
+//    bool fakevariable = CommandExecutor::addConsoleCommandShortcut((ExecutorStatic*)executor)
+
+
+#endif /* _ConsoleCommand_H__ */
Index: code/branches/core2/src/orxonox/core/CorePrereqs.h
===================================================================
--- code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 947)
@@ -91,9 +91,17 @@
   class ClassTreeMaskIterator;
   class ClassTreeMaskNode;
+  class CommandExecutor;
   class ConfigValueContainer;
   class DebugLevel;
   class Error;
   class Executor;
+  template <class T>
+  class ExecutorMember;
+  class ExecutorStatic;
   class Factory;
+  class Functor;
+  template <class T>
+  class FunctorMember;
+  class FunctorStatic;
   class Identifier;
   class IdentifierDistributor;
Index: code/branches/core2/src/orxonox/core/DebugLevel.cc
===================================================================
--- code/branches/core2/src/orxonox/core/DebugLevel.cc	(revision 941)
+++ code/branches/core2/src/orxonox/core/DebugLevel.cc	(revision 947)
@@ -95,5 +95,5 @@
 
         // Return a constant value while we're creating the object
-        return 4;
+        return 5;
     }
 }
Index: code/branches/core2/src/orxonox/core/Executor.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Executor.cc	(revision 941)
+++ code/branches/core2/src/orxonox/core/Executor.cc	(revision 947)
@@ -32,8 +32,10 @@
 namespace orxonox
 {
-    Executor::Executor(Functor* functor, const std::string& name)
+    Executor::Executor(Functor* functor, const std::string& name, AccessLevel::Level level)
     {
         this->functor_ = functor;
         this->name_ = name;
+        this->accessLevel_ = level;
+
         this->bAddedDescription_ = false;
         this->bAddedDescriptionReturnvalue_ = false;
@@ -60,14 +62,4 @@
     {
         EXECUTOR_PARSE(normal);
-    }
-
-    void Executor::setName(const std::string name)
-    {
-        this->name_ = name;
-    }
-
-    const std::string& Executor::getName() const
-    {
-        return this->name_;
     }
 
Index: code/branches/core2/src/orxonox/core/Executor.h
===================================================================
--- code/branches/core2/src/orxonox/core/Executor.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/Executor.h	(revision 947)
@@ -129,4 +129,16 @@
     return true
 
+namespace AccessLevel
+{
+    enum Level
+    {
+        None,
+        User,
+        Admin,
+        Offline,
+        Debug,
+        Disabled
+    };
+}
 
 namespace orxonox
@@ -135,5 +147,5 @@
     {
         public:
-            Executor(Functor* functor, const std::string& name = "");
+            Executor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None);
             virtual ~Executor();
 
@@ -153,7 +165,4 @@
             bool parse(const std::string& params, const std::string& delimiter = " ") const;
 
-            void setName(const std::string name);
-            const std::string& getName() const;
-
             void setDescription(const std::string& description);
             const std::string& getDescription() const;
@@ -165,5 +174,5 @@
             const std::string& getDescriptionReturnvalue(int param) const;
 
-            inline int getParamCount() const
+            inline unsigned int getParamCount() const
                 { return this->functor_->getParamCount(); }
             inline bool hasReturnvalue() const
@@ -173,8 +182,18 @@
             inline MultiTypeMath getReturnvalue() const
                 { return this->functor_->getReturnvalue(); }
-            inline std::string getTypenameParam(int param) const
+            inline std::string getTypenameParam(unsigned int param) const
                 { return this->functor_->getTypenameParam(param); }
             inline std::string getTypenameReturnvalue() const
                 { return this->functor_->getTypenameReturnvalue(); }
+
+            inline void setName(const std::string name)
+                { this->name_ = name; }
+            inline const std::string& getName() const
+                { return this->name_; }
+
+            inline void setAccessLevel(AccessLevel::Level level)
+                { this->accessLevel_ = level; }
+            inline AccessLevel::Level getAccessLevel() const
+                { return this->accessLevel_; }
 
             void setDefaultValues(const MultiTypeMath& param1);
@@ -186,4 +205,11 @@
 
             bool allDefaultValuesSet() const;
+            inline bool defaultValueSet(unsigned int index) const
+            {
+                if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
+                    return this->bAddedDefaultValue_[index];
+
+                return false;
+            }
 
         protected:
@@ -201,4 +227,6 @@
             bool bAddedDescriptionReturnvalue_;
             bool bAddedDescriptionParam_[MAX_FUNCTOR_ARGUMENTS];
+
+            AccessLevel::Level accessLevel_;
     };
 
@@ -206,5 +234,5 @@
     {
         public:
-            ExecutorStatic(FunctorStatic* functor, const std::string& name = "") : Executor(functor, name) {}
+            ExecutorStatic(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
             virtual ~ExecutorStatic() {}
     };
@@ -214,5 +242,5 @@
     {
         public:
-            ExecutorMember(FunctorMember<T>* functor, const std::string& name = "") : Executor(functor, name) {}
+            ExecutorMember(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
             virtual ~ExecutorMember() {}
 
@@ -260,18 +288,18 @@
     };
 
-    inline Executor* createExecutor(Functor* functor, const std::string& name = "")
-    {
-        return new Executor(functor, name);
+    inline Executor* createExecutor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new Executor(functor, name, level);
     }
 
     template <class T>
-    inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "")
-    {
-        return new ExecutorMember<T>(functor, name);
+    inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new ExecutorMember<T>(functor, name, level);
     }
 
-    inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "")
-    {
-        return new ExecutorStatic(functor, name);
+    inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
+    {
+        return new ExecutorStatic(functor, name, level);
     }
 }
Index: code/branches/core2/src/orxonox/core/Functor.h
===================================================================
--- code/branches/core2/src/orxonox/core/Functor.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/Functor.h	(revision 947)
@@ -37,14 +37,16 @@
 #define MAX_FUNCTOR_ARGUMENTS 5
 
-enum FunctionType
+namespace orxonox
 {
-    FT_MEMBER,
-    FT_CONSTMEMBER,
-    FT_STATIC
-};
-
-
-template <class T>
-inline std::string typeToString();
+    enum FunctionType
+    {
+        FT_MEMBER,
+        FT_CONSTMEMBER,
+        FT_STATIC
+    };
+
+
+    template <class T>
+    inline std::string typeToString() { return "unknown"; }
 
 #define CreateTypeToStringTemplate(type) \
@@ -52,114 +54,114 @@
     inline std::string typeToString<type>() { return #type; }
 
-CreateTypeToStringTemplate(int);
-CreateTypeToStringTemplate(unsigned int);
-CreateTypeToStringTemplate(char);
-CreateTypeToStringTemplate(unsigned char);
-CreateTypeToStringTemplate(short);
-CreateTypeToStringTemplate(unsigned short);
-CreateTypeToStringTemplate(long);
-CreateTypeToStringTemplate(unsigned long);
-CreateTypeToStringTemplate(float);
-CreateTypeToStringTemplate(double);
-CreateTypeToStringTemplate(long double);
-CreateTypeToStringTemplate(bool);
-CreateTypeToStringTemplate(std::string);
-CreateTypeToStringTemplate(orxonox::Vector2);
-CreateTypeToStringTemplate(orxonox::Vector3);
-CreateTypeToStringTemplate(orxonox::Quaternion);
-CreateTypeToStringTemplate(orxonox::ColourValue);
-CreateTypeToStringTemplate(orxonox::Radian);
-CreateTypeToStringTemplate(orxonox::Degree);
-
-
-class _CoreExport Functor
-{
-    public:
-        Functor() {}
-        virtual ~Functor() {}
-
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-
-        inline unsigned int getParamCount() const { return this->numParams_; }
-        inline bool hasReturnvalue() const { return this->hasReturnValue_; }
-        inline FunctionType getType() const { return this->type_; }
-        inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
-
-        std::string getTypenameParam(int param) const { return (param > 0 && param <= 5) ? this->typeParam_[param-1] : ""; }
-        std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
-
-    protected:
-        unsigned int numParams_;
-        bool hasReturnValue_;
-        FunctionType type_;
-        MultiTypeMath returnedValue_;
-
-        std::string typeReturnvalue_;
-        std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];
-};
-
-class _CoreExport FunctorStatic : public Functor
-{
-    public:
-        virtual ~FunctorStatic() {}
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-};
-
-template <class T>
-class FunctorMember : public Functor
-{
-    public:
-        FunctorMember()
-        {
-            constObject_ = 0;
-            object_ = 0;
-            bConstObject_ = false;
-        }
-        virtual ~FunctorMember() {}
-
-        virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-        virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
-
-        virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
-        {
-            if (this->bConstObject_)
+    CreateTypeToStringTemplate(int);
+    CreateTypeToStringTemplate(unsigned int);
+    CreateTypeToStringTemplate(char);
+    CreateTypeToStringTemplate(unsigned char);
+    CreateTypeToStringTemplate(short);
+    CreateTypeToStringTemplate(unsigned short);
+    CreateTypeToStringTemplate(long);
+    CreateTypeToStringTemplate(unsigned long);
+    CreateTypeToStringTemplate(float);
+    CreateTypeToStringTemplate(double);
+    CreateTypeToStringTemplate(long double);
+    CreateTypeToStringTemplate(bool);
+    CreateTypeToStringTemplate(std::string);
+    CreateTypeToStringTemplate(orxonox::Vector2);
+    CreateTypeToStringTemplate(orxonox::Vector3);
+    CreateTypeToStringTemplate(orxonox::Quaternion);
+    CreateTypeToStringTemplate(orxonox::ColourValue);
+    CreateTypeToStringTemplate(orxonox::Radian);
+    CreateTypeToStringTemplate(orxonox::Degree);
+
+
+    class _CoreExport Functor
+    {
+        public:
+            Functor() {}
+            virtual ~Functor() {}
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            inline unsigned int getParamCount() const { return this->numParams_; }
+            inline bool hasReturnvalue() const { return this->hasReturnValue_; }
+            inline FunctionType getType() const { return this->type_; }
+            inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
+
+            std::string getTypenameParam(unsigned int param) const { return (param > 0 && param <= 5) ? this->typeParam_[param-1] : ""; }
+            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
+
+        protected:
+            unsigned int numParams_;
+            bool hasReturnValue_;
+            FunctionType type_;
+            MultiTypeMath returnedValue_;
+
+            std::string typeReturnvalue_;
+            std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];
+    };
+
+    class _CoreExport FunctorStatic : public Functor
+    {
+        public:
+            virtual ~FunctorStatic() {}
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+    };
+
+    template <class T>
+    class FunctorMember : public Functor
+    {
+        public:
+            FunctorMember()
             {
-                if (this->constObject_)
-                    (*this)(this->constObject_, param1, param2, param3, param4, param5);
+                constObject_ = 0;
+                object_ = 0;
+                bConstObject_ = false;
+            }
+            virtual ~FunctorMember() {}
+
+            virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+            virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
+
+            virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
+            {
+                if (this->bConstObject_)
+                {
+                    if (this->constObject_)
+                        (*this)(this->constObject_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No const object set." << std::endl;
+                    }
+                }
                 else
                 {
-                    COUT(1) << "An error occurred in Functor.h:" << std::endl;
-                    COUT(1) << "Error: No const object set." << std::endl;
+                    if (this->object_)
+                        (*this)(this->object_, param1, param2, param3, param4, param5);
+                    else
+                    {
+                        COUT(1) << "An error occurred in Functor.h:" << std::endl;
+                        COUT(1) << "Error: No object set." << std::endl;
+                    }
                 }
             }
-            else
+
+            void setObject(T* object)
             {
-                if (this->object_)
-                    (*this)(this->object_, param1, param2, param3, param4, param5);
-                else
-                {
-                    COUT(1) << "An error occurred in Functor.h:" << std::endl;
-                    COUT(1) << "Error: No object set." << std::endl;
-                }
+                this->bConstObject_ = false;
+                this->object_ = object;
             }
-        }
-
-        void setObject(T* object)
-        {
-            this->bConstObject_ = false;
-            this->object_ = object;
-        }
-
-        void setObject(const T* object)
-        {
-            this->bConstObject_ = true;
-            this->constObject_ = object;
-        }
-
-    private:
-        const T* constObject_;
-        T* object_;
-        bool bConstObject_;
-};
+
+            void setObject(const T* object)
+            {
+                this->bConstObject_ = true;
+                this->constObject_ = object;
+            }
+
+        private:
+            const T* constObject_;
+            T* object_;
+            bool bConstObject_;
+    };
 
 
@@ -403,6 +405,7 @@
 
 
-CREATE_ALL_STATIC_FUNCTORS();
-CREATE_ALL_MEMBER_FUNCTORS();
+    CREATE_ALL_STATIC_FUNCTORS();
+    CREATE_ALL_MEMBER_FUNCTORS();
+}
 
 #endif /* _Functor_H__ */
Index: code/branches/core2/src/orxonox/core/Identifier.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Identifier.cc	(revision 941)
+++ code/branches/core2/src/orxonox/core/Identifier.cc	(revision 947)
@@ -35,4 +35,6 @@
 #include "Identifier.h"
 #include "Factory.h"
+#include "Executor.h"
+#include "CommandExecutor.h"
 
 namespace orxonox
@@ -50,4 +52,7 @@
         this->bCreatedOneObject_ = false;
         this->factory_ = 0;
+
+        this->bHasConfigValues_ = false;
+        this->bHasConsoleCommands_ = false;
 
         this->children_ = new std::set<const Identifier*>();
@@ -198,4 +203,36 @@
 
     /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> identifierMap;
+        return identifierMap;
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers.
+        @return The map
+    */
+    std::map<std::string, Identifier*>& Identifier::getLowercaseIdentifierMapIntern()
+    {
+        static std::map<std::string, Identifier*> lowercaseIdentifierMap;
+        return lowercaseIdentifierMap;
+    }
+
+    /**
+        @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)
+    {
+        this->bHasConfigValues_ = true;
+        this->configValues_[varname] = container;
+        this->configValues_LC_[getLowercase(varname)] = container;
+    }
+
+    /**
         @brief Returns the ConfigValueContainer of a variable, given by the string of its name.
         @param varname The name of the variable
@@ -212,13 +249,69 @@
 
     /**
-        @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)
-    {
-        this->configValues_[varname] = container;
-    }
-
+        @brief Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.
+        @param varname The name of the variable in lowercase
+        @return The ConfigValueContainer
+    */
+    ConfigValueContainer* Identifier::getLowercaseConfigValueContainer(const std::string& varname)
+    {
+        std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_LC_.find(varname);
+        if (it != configValues_LC_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new console command of this class.
+        @param executor The executor of the command
+        @param bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command
+        @return The executor of the command
+    */
+    ExecutorStatic& Identifier::addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut)
+    {
+        this->bHasConsoleCommands_ = true;
+        this->consoleCommands_[executor->getName()] = executor;
+        this->consoleCommands_LC_[getLowercase(executor->getName())] = executor;
+
+        if (bCreateShortcut)
+            CommandExecutor::addConsoleCommandShortcut(executor);
+
+        return (*executor);
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name.
+        @brief name The name of the requested console command
+        @return The executor of the requested console command
+    */
+    ExecutorStatic* Identifier::getConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_.find(name);
+        if (it != this->consoleCommands_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the executor of a console command with given name in lowercase.
+        @brief name The name of the requested console command in lowercae
+        @return The executor of the requested console command
+    */
+    ExecutorStatic* Identifier::getLowercaseConsoleCommand(const std::string& name) const
+    {
+        std::map<std::string, ExecutorStatic*>::const_iterator it = this->consoleCommands_LC_.find(name);
+        if (it != this->consoleCommands_LC_.end())
+            return (*it).second;
+        else
+            return 0;
+    }
+
+    /**
+        @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)
     {
Index: code/branches/core2/src/orxonox/core/Identifier.h
===================================================================
--- code/branches/core2/src/orxonox/core/Identifier.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/Identifier.h	(revision 947)
@@ -62,4 +62,5 @@
 #include "Debug.h"
 #include "Iterator.h"
+#include "util/String.h"
 
 namespace orxonox
@@ -114,4 +115,5 @@
             inline const std::string& getName() const { return this->name_; }
 
+
             /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
             inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
@@ -142,4 +144,55 @@
             inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); }
 
+
+            /** @brief Returns the map that stores all Identifiers. @return The map */
+            static inline const std::map<std::string, Identifier*>& getIdentifierMap() { return Identifier::getIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapBegin() { return Identifier::getIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapEnd() { return Identifier::getIdentifierMap().end(); }
+
+            /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
+            static inline const std::map<std::string, Identifier*>& getLowercaseIdentifierMap() { return Identifier::getLowercaseIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapBegin() { return Identifier::getLowercaseIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapEnd() { return Identifier::getLowercaseIdentifierMap().end(); }
+
+
+            /** @brief Returns the map that stores all config values. @return The const_iterator */
+            inline const std::map<std::string, ConfigValueContainer*>& getConfigValueMap() const { return this->configValues_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all config values. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getConfigValueMapBegin() const { return this->configValues_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all config values. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getConfigValueMapEnd() const { return this->configValues_.end(); }
+
+            /** @brief Returns the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline const std::map<std::string, ConfigValueContainer*>& getLowercaseConfigValueMap() const { return this->configValues_LC_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getLowercaseConfigValueMapBegin() const { return this->configValues_LC_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all config values with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ConfigValueContainer*>::const_iterator getLowercaseConfigValueMapEnd() const { return this->configValues_LC_.end(); }
+
+
+            /** @brief Returns the map that stores all console commands. @return The const_iterator */
+            inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandMap() const { return this->consoleCommands_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandMapBegin() const { return this->consoleCommands_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandMapEnd() const { return this->consoleCommands_.end(); }
+
+            /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandMap() const { return this->consoleCommands_LC_; }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandMapBegin() const { return this->consoleCommands_LC_.begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */
+            inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }
+
+
+            /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */
+            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
+            /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
+            inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
+
             /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
             inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
@@ -151,12 +204,23 @@
             void setNetworkID(unsigned int id);
 
+            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
             ConfigValueContainer* getConfigValueContainer(const std::string& varname);
-            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
-
+            ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
+
+            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
             virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0;
-            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
-
+
+            virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
             virtual XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname) = 0;
-            virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
+
+            ExecutorStatic& addConsoleCommand(ExecutorStatic* executor, bool bCreateShortcut);
+            ExecutorStatic* getConsoleCommand(const std::string& name) const;
+            ExecutorStatic* getLowercaseConsoleCommand(const std::string& name) const;
+
+        protected:
+            /** @brief Returns the map that stores all Identifiers. @return The map */
+            static std::map<std::string, Identifier*>& getIdentifierMapIntern();
+            /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
+            static std::map<std::string, Identifier*>& getLowercaseIdentifierMapIntern();
 
         private:
@@ -189,17 +253,24 @@
             }
 
-            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
-
-            std::string name_;                                          //!< The name of the class the Identifier belongs to
-
-            BaseFactory* factory_;                                      //!< The Factory, able to create new objects of the given class (if available)
-            bool bCreatedOneObject_;                                    //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
-            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)
-            unsigned int classID_;                                      //!< The network ID to identify a class through the network
-            std::map<std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer
+            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
+
+            std::string name_;                                             //!< The name of the class the Identifier belongs to
+
+            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
+            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
+            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)
+            unsigned int classID_;                                         //!< The network ID to identify a class through the network
+
+            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, ConfigValueContainer*> configValues_LC_; //!< A map to link the string of configurable variables with their ConfigValueContainer
+
+            bool bHasConsoleCommands_;                                     //!< True if this class has at least one assigned console command
+            std::map<std::string, ExecutorStatic*> consoleCommands_;       //!< All console commands of this class
+            std::map<std::string, ExecutorStatic*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
     };
 
@@ -246,8 +317,8 @@
             ~ClassIdentifier() {}                                       // don't delete
 
-            ObjectList<T>* objects_;    //!< The ObjectList, containing all objects of type T
-            bool bSetName_;             //!< True if the name is set
-            std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;
-            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;
+            ObjectList<T>* objects_;                                                                    //!< The ObjectList, containing all objects of type T
+            bool bSetName_;                                                                             //!< True if the name is set
+            std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;              //!< All loadable parameters
+            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
     };
 
@@ -300,4 +371,6 @@
             this->name_ = name;
             this->bSetName_ = true;
+            Identifier::getIdentifierMapIntern()[name] = this;
+            Identifier::getLowercaseIdentifierMapIntern()[getLowercase(name)] = this;
         }
     }
@@ -324,4 +397,9 @@
     }
 
+    /**
+        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @return The container
+    */
     template <class T>
     XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname)
@@ -334,4 +412,9 @@
     }
 
+    /**
+        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @param container The container
+    */
     template <class T>
     void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
@@ -340,4 +423,9 @@
     }
 
+    /**
+        @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
+    */
     template <class T>
     XMLPortObjectContainer* ClassIdentifier<T>::getXMLPortObjectContainer(const std::string& sectionname)
@@ -350,4 +438,9 @@
     }
 
+    /**
+        @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
+    */
     template <class T>
     void ClassIdentifier<T>::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
Index: code/branches/core2/src/orxonox/core/OutputHandler.cc
===================================================================
--- code/branches/core2/src/orxonox/core/OutputHandler.cc	(revision 941)
+++ code/branches/core2/src/orxonox/core/OutputHandler.cc	(revision 947)
@@ -33,7 +33,10 @@
 #include "DebugLevel.h"
 #include "OutputHandler.h"
+#include "ConsoleCommand.h"
 
 namespace orxonox
 {
+    ConsoleCommandShortcutGeneric(log, createExecutor(createFunctor(&OutputHandler::log), "log", AccessLevel::None));
+
     /**
         @brief Constructor: Opens the logfile and writes the first line.
Index: code/branches/core2/src/orxonox/core/OutputHandler.h
===================================================================
--- code/branches/core2/src/orxonox/core/OutputHandler.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/OutputHandler.h	(revision 947)
@@ -58,4 +58,8 @@
 
             static OutputHandler& getOutStream();
+
+            /** @brief Puts some text on the outstream. @param text The text */
+            static inline void log(const std::string& text)
+                { OutputHandler::getOutStream().output(text); }
 
             /** @brief Returns a reference to the logfile. @return The logfile */
Index: code/branches/core2/src/orxonox/core/XMLPort.h
===================================================================
--- code/branches/core2/src/orxonox/core/XMLPort.h	(revision 941)
+++ code/branches/core2/src/orxonox/core/XMLPort.h	(revision 947)
@@ -42,12 +42,12 @@
 
 #define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
-    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, createExecutor(createFunctor(&classname::loadfunction), #loadfunction), createExecutor(createFunctor(&classname::savefunction), #savefunction), xmlelement, mode)
+    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode)
 #define XMLPortParam_Template(classname, paramname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode) \
-    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, createExecutor(createFunctor loadtemplate (&classname::loadfunction), #loadfunction), createExecutor(createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode)
+    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode)
 
 #define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
-    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, createExecutor(createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
+    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
 #define XMLPortParamLoadOnly_Template(classname, paramname, loadtemplate, loadfunction, xmlelement, mode) \
-    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, createExecutor(createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
+    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
 
 #define XMLPortParamGeneric(containername, classname, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
@@ -62,7 +62,7 @@
 
 #define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
-    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, createExecutor(createFunctor(&classname::loadfunction), #loadfunction), createExecutor(createFunctor(&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
+    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
 #define XMLPortObject_Template(classname, objectclass, sectionname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
-    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, createExecutor(createFunctor loadtemplate (&classname::loadfunction), #loadfunction), createExecutor(createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
+    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
 
 #define XMLPortObjectGeneric(containername, classname, objectclass, sectionname, loadexecutor, saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
@@ -143,10 +143,4 @@
                 this->loadexecutor_ = loadexecutor;
                 this->saveexecutor_ = saveexecutor;
-
-                this->setDefaultValue_[0] = false;
-                this->setDefaultValue_[1] = false;
-                this->setDefaultValue_[2] = false;
-                this->setDefaultValue_[3] = false;
-                this->setDefaultValue_[4] = false;
             }
 
@@ -209,64 +203,36 @@
             virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiTypeMath& param)
             {
-                if (!this->setDefaultValue_[index])
-                {
-                    this->setDefaultValue_[index] = true;
+                if (!this->loadexecutor_->defaultValueSet(index))
                     this->loadexecutor_->setDefaultValue(index, param);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1)
             {
-                if (!this->setDefaultValue_[0])
-                {
-                    this->setDefaultValue_[0] = true;
+                if (!this->loadexecutor_->defaultValueSet(0))
                     this->loadexecutor_->setDefaultValues(param1);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
             {
-                if ((!this->setDefaultValue_[0]) || (!this->setDefaultValue_[1]))
-                {
-                    this->setDefaultValue_[0] = true;
-                    this->setDefaultValue_[1] = true;
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)))
                     this->loadexecutor_->setDefaultValues(param1, param2);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
             {
-                if ((!this->setDefaultValue_[0]) || (!this->setDefaultValue_[1]) || (!this->setDefaultValue_[2]))
-                {
-                    this->setDefaultValue_[0] = true;
-                    this->setDefaultValue_[1] = true;
-                    this->setDefaultValue_[3] = true;
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)))
                     this->loadexecutor_->setDefaultValues(param1, param2, param3);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
             {
-                if ((!this->setDefaultValue_[0]) || (!this->setDefaultValue_[1]) || (!this->setDefaultValue_[2]) || (!this->setDefaultValue_[3]))
-                {
-                    this->setDefaultValue_[0] = true;
-                    this->setDefaultValue_[1] = true;
-                    this->setDefaultValue_[3] = true;
-                    this->setDefaultValue_[4] = true;
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)))
                     this->loadexecutor_->setDefaultValues(param1, param2, param3, param4);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
             {
-                if ((!this->setDefaultValue_[0]) || (!this->setDefaultValue_[1]) || (!this->setDefaultValue_[2]) || (!this->setDefaultValue_[3]) || (!this->setDefaultValue_[4]))
-                {
-                    this->setDefaultValue_[0] = true;
-                    this->setDefaultValue_[1] = true;
-                    this->setDefaultValue_[3] = true;
-                    this->setDefaultValue_[4] = true;
-                    this->setDefaultValue_[5] = true;
+                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)) || (!this->loadexecutor_->defaultValueSet(4)))
                     this->loadexecutor_->setDefaultValues(param1, param2, param3, param4, param5);
-                }
                 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
             }
@@ -276,5 +242,4 @@
             ExecutorMember<T>* saveexecutor_;
             ParseParams parseParams_;
-            bool setDefaultValue_[5];
     };
 
