Index: /code/branches/consolecommands3/src/libraries/core/Identifier.cc
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/Identifier.cc	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/Identifier.cc	(revision 7216)
@@ -40,5 +40,4 @@
 #include "ClassFactory.h"
 #include "XMLPort.h"
-#include "command/ConsoleCommand.h"
 
 namespace orxonox
@@ -64,5 +63,4 @@
 
         this->bHasConfigValues_ = false;
-        this->bHasConsoleCommands_ = false;
 
         // Default network ID is the class ID
@@ -80,6 +78,4 @@
             delete this->factory_;
 
-        for (std::map<std::string, ConsoleCommand*>::iterator it = this->consoleCommands_.begin(); it != this->consoleCommands_.end(); ++it)
-            delete (it->second);
         for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
             delete (it->second);
@@ -433,57 +429,4 @@
 
     /**
-        @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
-    */
-    ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)
-    {
-        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(command->getName());
-        if (it != this->consoleCommands_.end())
-        {
-            COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << '.' << std::endl;
-            delete (it->second);
-        }
-
-        this->bHasConsoleCommands_ = true;
-        this->consoleCommands_[command->getName()] = command;
-        this->consoleCommands_LC_[getLowercase(command->getName())] = command;
-
-        if (bCreateShortcut)
-            CommandExecutor::addConsoleCommandShortcut(command);
-
-        return (*command);
-    }
-
-    /**
-        @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
-    */
-    ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const
-    {
-        std::map<std::string, ConsoleCommand*>::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
-    */
-    ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const
-    {
-        std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);
-        if (it != this->consoleCommands_LC_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
         @brief Returns a XMLPortParamContainer that loads a parameter of this class.
         @param paramname The name of the parameter
Index: /code/branches/consolecommands3/src/libraries/core/Identifier.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/Identifier.h	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/Identifier.h	(revision 7216)
@@ -202,29 +202,4 @@
             void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
             ConfigValueContainer* getConfigValueContainer(const std::string& varname);
-
-
-            ////////////////////////////
-            ///// Console Commands /////
-            ////////////////////////////
-            /** @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 the map that stores all console commands. @return The const_iterator */
-            inline const std::map<std::string, ConsoleCommand*>& 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, ConsoleCommand*>::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, ConsoleCommand*>::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, ConsoleCommand*>& 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, ConsoleCommand*>::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, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }
-
-            ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);
-            ConsoleCommand* getConsoleCommand(const std::string& name) const;
-            ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
 
 
@@ -305,8 +280,4 @@
             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
-
-            bool bHasConsoleCommands_;                                     //!< True if this class has at least one assigned console command
-            std::map<std::string, ConsoleCommand*> consoleCommands_;       //!< All console commands of this class
-            std::map<std::string, ConsoleCommand*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
 
             std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
Index: /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.cc
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.cc	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.cc	(revision 7216)
@@ -54,51 +54,4 @@
     }
 
-    ConsoleCommand& CommandExecutor::addConsoleCommandShortcut(ConsoleCommand* command, bool bDeleteAtExit)
-    {
-        std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_.find(command->getName());
-        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_.end())
-        {
-            COUT(2) << "Warning: Overwriting console-command shortcut with name " << command->getName() << '.' << std::endl;
-        }
-
-        // Make sure we can also delete the external ConsoleCommands that don't belong to an Identifier
-        if (command && bDeleteAtExit)
-        {
-            CommandExecutor::getInstance().consoleCommandExternals_.insert(command);
-        }
-
-        CommandExecutor::getInstance().consoleCommandShortcuts_[command->getName()] = command;
-        CommandExecutor::getInstance().consoleCommandShortcuts_LC_[getLowercase(command->getName())] = command;
-        return (*command);
-    }
-
-    /**
-        @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
-    */
-    ConsoleCommand* CommandExecutor::getConsoleCommandShortcut(const std::string& name)
-    {
-        std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_.find(name);
-        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_.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
-    */
-    ConsoleCommand* CommandExecutor::getLowercaseConsoleCommandShortcut(const std::string& name)
-    {
-        std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_LC_.find(name);
-        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
     bool CommandExecutor::execute(const std::string& command, bool useTcl)
     {
Index: /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.h	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/command/CommandExecutor.h	(revision 7216)
@@ -57,24 +57,4 @@
             static const CommandEvaluation& getLastEvaluation();
 
-            static ConsoleCommand& addConsoleCommandShortcut(ConsoleCommand* command, bool bDeleteAtExit = false);
-            static ConsoleCommand* getConsoleCommandShortcut(const std::string& name);
-            static ConsoleCommand* 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, ConsoleCommand*>& getConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_; }
-            /** @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, ConsoleCommand*>::const_iterator getConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_.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, ConsoleCommand*>::const_iterator getConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_.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, ConsoleCommand*>& getLowercaseConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_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 */
-            static inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_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 */
-            static inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end(); }
-
-            static void destroyExternalCommands();
-
         private:
             CommandExecutor() {}
@@ -107,7 +87,4 @@
 
             CommandEvaluation evaluation_;
-            std::map<std::string, ConsoleCommand*> consoleCommandShortcuts_;
-            std::map<std::string, ConsoleCommand*> consoleCommandShortcuts_LC_;
-            std::set<ConsoleCommand*>              consoleCommandExternals_;
     }; // tolua_export
 } // tolua_export
Index: /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc	(revision 7216)
@@ -28,94 +28,7 @@
 
 #include "ConsoleCommand.h"
-#include <cassert>
 
 #include "util/Convert.h"
 #include "core/Language.h"
-
-namespace orxonox
-{
-    ConsoleCommand::ConsoleCommand(const FunctorPtr& functor, const std::string& name) : Executor(functor, name)
-    {
-        this->accessLevel_ = AccessLevel::None;
-        this->argumentCompleter_[0] = 0;
-        this->argumentCompleter_[1] = 0;
-        this->argumentCompleter_[2] = 0;
-        this->argumentCompleter_[3] = 0;
-        this->argumentCompleter_[4] = 0;
-
-        this->keybindMode_ = KeybindMode::OnPress;
-        this->inputConfiguredParam_ = -1;
-    }
-
-    ConsoleCommand& ConsoleCommand::argumentCompleter(unsigned int param, ArgumentCompleter* completer)
-    {
-        if (param < 5)
-            this->argumentCompleter_[param] = completer;
-        else
-        {
-            COUT(2) << "Warning: Couldn't add autocompletion-function for param " << param << ": index out of bound." << std::endl;
-        }
-        return (*this);
-    }
-
-    ArgumentCompleter* ConsoleCommand::getArgumentCompleter(unsigned int param) const
-    {
-        if (param < 5)
-            return this->argumentCompleter_[param];
-        else
-            return 0;
-    }
-
-    void ConsoleCommand::createArgumentCompletionList(unsigned int param, const std::string& param1, const std::string& param2, const std::string& param3, const std::string& param4, const std::string& param5)
-    {
-        if (param < 5 && this->argumentCompleter_[param])
-            this->argumentList_ = (*this->argumentCompleter_[param])(param1, param2, param3, param4, param5);
-        else
-            this->argumentList_.clear();
-    }
-
-    ConsoleCommand& ConsoleCommand::description(const std::string& description)
-    {
-        this->description_ = std::string("ConsoleCommandDescription::" + this->name_ + "::function");
-        AddLanguageEntry(this->description_, description);
-        return (*this);
-    }
-
-    const std::string& ConsoleCommand::getDescription() const
-    {
-        return GetLocalisation_noerror(this->description_);
-    }
-
-    ConsoleCommand& ConsoleCommand::descriptionParam(unsigned int param, const std::string& description)
-    {
-        if (param < MAX_FUNCTOR_ARGUMENTS)
-        {
-            this->descriptionParam_[param] = std::string("ConsoleCommandDescription::" + this->name_ + "::param" + multi_cast<std::string>(param));
-            AddLanguageEntry(this->descriptionParam_[param], description);
-        }
-        return (*this);
-    }
-
-    const std::string& ConsoleCommand::getDescriptionParam(unsigned int param) const
-    {
-        if (param < MAX_FUNCTOR_ARGUMENTS)
-            return GetLocalisation_noerror(this->descriptionParam_[param]);
-
-        return this->descriptionParam_[0];
-    }
-
-    ConsoleCommand& ConsoleCommand::descriptionReturnvalue(const std::string& description)
-    {
-        this->descriptionReturnvalue_ = std::string("ConsoleCommandDescription::" + this->name_ + "::returnvalue");
-        AddLanguageEntry(this->descriptionReturnvalue_, description);
-        return (*this);
-    }
-
-    const std::string& ConsoleCommand::getDescriptionReturnvalue(int param) const
-    {
-        return GetLocalisation_noerror(this->descriptionReturnvalue_);
-    }
-}
-
 #include "core/BaseObject.h" // remove this
 
@@ -537,3 +450,9 @@
         }
     }
+
+    /* static */ void _ConsoleCommand::destroyAll()
+    {
+        while (!_ConsoleCommand::getCommandMap().empty() && !_ConsoleCommand::getCommandMap().begin().empty())
+            _ConsoleCommand::getCommandMap().begin().erase(_ConsoleCommand::getCommandMap().begin().begin());
+    }
 }
Index: /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h	(revision 7215)
+++ /code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h	(revision 7216)
@@ -37,131 +37,6 @@
 
 #include "util/VA_NARGS.h"
-#include "core/Identifier.h"
 #include "ArgumentCompletionFunctions.h"
-#include "CommandExecutor.h"
 #include "Executor.h"
-
-
-#define SetConsoleCommand(classname, function, bCreateShortcut) \
-    SetConsoleCommandGeneric(classname, function, #function, bCreateShortcut)
-#define SetConsoleCommandAlias(classname, function, name, bCreateShortcut) \
-    SetConsoleCommandGeneric(classname, function, name, bCreateShortcut)
-
-#define SetConsoleCommandGeneric(classname, function, name, bCreateShortcut) \
-    orxonox::ConsoleCommand& BOOST_PP_CAT(classname##function##consolecommand__, __LINE__) = orxonox::ClassIdentifier<classname>::getIdentifier(#classname)->addConsoleCommand(orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name), bCreateShortcut)
-
-
-#define SetConsoleCommandShortcut(classname, function) \
-    SetConsoleCommandShortcutAliasGeneric(classname, function, #function)
-#define SetConsoleCommandShortcutAlias(classname, function, name) \
-    SetConsoleCommandShortcutAliasGeneric(classname, function, name)
-#define SetConsoleCommandShortcutAliasGeneric(classname, function, name) \
-    SetConsoleCommandShortcutGeneric(BOOST_PP_CAT(function##consolecommand__, __LINE__), orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name))
-
-#define SetConsoleCommandShortcutExtern(function) \
-    SetConsoleCommandShortcutExternAliasGeneric(function, #function)
-#define SetConsoleCommandShortcutExternAlias(function, name) \
-    SetConsoleCommandShortcutExternAliasGeneric(function, name)
-#define SetConsoleCommandShortcutExternAliasGeneric(function, name) \
-    SetConsoleCommandShortcutGeneric(BOOST_PP_CAT(function##consolecommand__, __LINE__), orxonox::createConsoleCommand(orxonox::createFunctor(&function), name))
-
-#define SetConsoleCommandShortcutGeneric(fakevariable, command) \
-    orxonox::ConsoleCommand& fakevariable = orxonox::CommandExecutor::addConsoleCommandShortcut(command, true)
-
-
-namespace orxonox
-{
-    namespace AccessLevel
-    {
-        enum Value
-        {
-            None,
-            User,
-            Admin,
-            Offline,
-            Debug,
-            Disabled
-        };
-    }
-
-    class _CoreExport ConsoleCommand : public Executor
-    {
-        public:
-            ConsoleCommand(const FunctorPtr& functor, const std::string& name = "");
-
-            ConsoleCommand& description(const std::string& description);
-            const std::string& getDescription() const;
-
-            ConsoleCommand& descriptionParam(unsigned int param, const std::string& description);
-            const std::string& getDescriptionParam(unsigned int param) const;
-
-            ConsoleCommand& descriptionReturnvalue(const std::string& description);
-            const std::string& getDescriptionReturnvalue(int param) const;
-
-            inline ConsoleCommand& defaultValues(const MultiType& param1)
-                { this->Executor::setDefaultValues(param1); return (*this); }
-            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2)
-                { this->Executor::setDefaultValues(param1, param2); return (*this); }
-            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
-                { this->Executor::setDefaultValues(param1, param2, param3); return (*this); }
-            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
-                { this->Executor::setDefaultValues(param1, param2, param3, param4); return (*this); }
-            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
-                { this->Executor::setDefaultValues(param1, param2, param3, param4, param5); return (*this); }
-            inline ConsoleCommand& defaultValue(unsigned int index, const MultiType& param)
-                { this->Executor::setDefaultValue(index, param); return (*this); }
-
-            inline ConsoleCommand& accessLevel(AccessLevel::Value level)
-                { this->accessLevel_ = level; return (*this); }
-            inline AccessLevel::Value getAccessLevel() const
-                { return this->accessLevel_; }
-
-            ConsoleCommand& argumentCompleter(unsigned int param, ArgumentCompleter* completer);
-            ArgumentCompleter* getArgumentCompleter(unsigned int param) const;
-
-            void createArgumentCompletionList(unsigned int param, const std::string& param1 = "", const std::string& param2 = "", const std::string& param3 = "", const std::string& param4 = "", const std::string& param5 = "");
-            const ArgumentCompletionList& getArgumentCompletionList() const
-                { return this->argumentList_; }
-            ArgumentCompletionList::const_iterator getArgumentCompletionListBegin() const
-                { return this->argumentList_.begin(); }
-            ArgumentCompletionList::const_iterator getArgumentCompletionListEnd() const
-                { return this->argumentList_.end(); }
-
-            inline ConsoleCommand& setAsInputCommand()
-            {
-                this->keybindMode(KeybindMode::OnHold);
-                this->defaultValue(0, Vector2(0.0f, 0.0f));
-                this->inputConfiguredParam(0);
-                return *this;
-            }
-
-            inline ConsoleCommand& keybindMode(KeybindMode::Value mode)
-                { this->keybindMode_ = mode; return *this; }
-            inline KeybindMode::Value getKeybindMode() const
-                { return this->keybindMode_; }
-
-            inline ConsoleCommand& inputConfiguredParam(int index)
-                { this->inputConfiguredParam_ = index; return *this; }
-            inline int getInputConfiguredParam_() const
-                { return this->inputConfiguredParam_; }
-
-        private:
-            AccessLevel::Value accessLevel_;
-            ArgumentCompleter* argumentCompleter_[5];
-            ArgumentCompletionList argumentList_;
-
-            KeybindMode::Value keybindMode_;
-            int inputConfiguredParam_;
-
-            LanguageEntryLabel description_;
-            LanguageEntryLabel descriptionReturnvalue_;
-            LanguageEntryLabel descriptionParam_[MAX_FUNCTOR_ARGUMENTS];
-    };
-
-    inline ConsoleCommand* createConsoleCommand(const FunctorPtr& functor, const std::string& name = "")
-    {
-        return new ConsoleCommand(functor, name);
-    }
-}
 
 
@@ -452,4 +327,6 @@
             static const _ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
 
+            static void destroyAll();
+
         private:
             static std::map<std::string, std::map<std::string, _ConsoleCommand*> >& getCommandMap();
