Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7284


Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
28 deleted
118 edited
37 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/data/gui/scripts/MiscConfigMenu.lua

    r7163 r7284  
    102102    local configvalue = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue")
    103103    configvalue:setProperty("ReadOnly", "set:False")
    104     orxonox.CommandExecutor:execute("getConfig " .. P.commandList[k])
    105     local value = orxonox.CommandExecutor:getReturnValueString()
     104    local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[k])
    106105    configvalue:setText(value)
    107106    P.sampleWindow:setText(value)
     
    168167
    169168    orxonox.CommandExecutor:execute("config " .. P.commandList[commandNr] .. " " .. window:getText())
    170     orxonox.CommandExecutor:execute("getConfig " .. P.commandList[commandNr])
    171     local value = orxonox.CommandExecutor:getReturnValueString()
     169    local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[commandNr])
    172170    window:setText(value)
    173171end
  • code/trunk/data/levels/fps_test.oxw

    r7163 r7284  
    2020   skybox       = "Orxonox/skypanoramagen1"
    2121   gravity      = "0,-1000,0"
    22    negativeWorldRange = "(-100000, -100000, -100000)"
    23    positiveWorldRange = "( 100000,  100000,  100000)"
     22   negativeWorldRange = "-100000, -100000, -100000"
     23   positiveWorldRange = " 100000,  100000,  100000"
    2424   hasPhysics   = true
    2525  >
  • code/trunk/data/levels/old/physicstest2.oxw

    r6417 r7284  
    1313   ambientlight = "0.5, 0.5, 0.5"
    1414   skybox       = "Orxonox/Starbox"
    15    negativeWorldRange = "(-100000, -100000, -100000)"
    16    positiveWorldRange = "( 100000,  100000,  100000)"
     15   negativeWorldRange = "-100000, -100000, -100000"
     16   positiveWorldRange = " 100000,  100000,  100000"
    1717   hasPhysics   = true
    1818  >
  • code/trunk/data/levels/presentation_FS10.oxw

    r7163 r7284  
    2020   skybox       = "Orxonox/skypanoramagen1"
    2121   gravity      = "0,-1000,0"
    22    negativeWorldRange = "(-100000, -100000, -100000)"
    23    positiveWorldRange = "( 100000,  100000,  100000)"
     22   negativeWorldRange = "-100000, -100000, -100000"
     23   positiveWorldRange = " 100000,  100000,  100000"
    2424   hasPhysics   = true
    2525  >
  • code/trunk/data/levels/presentation_FS10_ed.oxw

    r7163 r7284  
    2020   skybox       = "Orxonox/skypanoramagen1"
    2121   gravity      = "0,-1000,0"
    22    negativeWorldRange = "(-100000, -100000, -100000)"
    23    positiveWorldRange = "( 100000,  100000,  100000)"
     22   negativeWorldRange = "-100000, -100000, -100000"
     23   positiveWorldRange = " 100000,  100000,  100000"
    2424   hasPhysics   = true
    2525  >
  • code/trunk/data/tcl/irk/lib/irkreceive.tcl

    r5781 r7284  
    3737        append state($token,ERRORS) "$nick $dest $rest\n"
    3838#       puts "Got ERROR: $token $nick ---> $dest: $rest"
    39         orxonox::execute error "Got ERROR: $token $nick ---> $dest: $rest"
     39        ::orxonox::execute error "Got ERROR: $token $nick ---> $dest: $rest"
    4040
    4141        return ""
     
    5353        return ""
    5454    }
    55    
     55
    5656    # This procedure deals with the WHOIS USER message:
    5757
     
    116116
    117117        set state($token,ident,$unick,ident) 1
    118     }   
     118    }
    119119
    120120    # This procedure deals with the WHOIS CONNECTTIME message:
     
    249249        if {[isus $token $nick]} {
    250250#           puts "You joined $dest"
    251           orxonox::irc::info $token "You joined $dest"
     251          ::orxonox::irc::info $token "You joined $dest"
    252252
    253253            addChannel $token $dest
    254254        } else {
    255255#           puts "$nick joined $dest"
    256           orxonox::irc::info $token "$nick joined $dest"
     256          ::orxonox::irc::info $token "$nick joined $dest"
    257257
    258258            addToChannel $token $nick $dest
     
    271271        if {[isus $token $nick]} {
    272272#           puts "You left channel $chan"
    273           orxonox::irc::info $token "You left channel $chan"
     273          ::orxonox::irc::info $token "You left channel $chan"
    274274        } else {
    275275#           puts "$nick left [string tolower $dest]"
    276           orxonox::irc::info $token "$nick left [string tolower $dest]"
    277         }           
     276          ::orxonox::irc::info $token "$nick left [string tolower $dest]"
     277        }
    278278        removeFromChannel $token $nick $chan
    279279        removeFromChannel $token @$nick $chan
     
    287287        set rest [eval concat $rest]
    288288#       puts "$nick sets mode $dest $rest"
    289       orxonox::irc::info "$nick $token sets mode $dest $rest"
     289      ::orxonox::irc::info "$nick $token sets mode $dest $rest"
    290290
    291291        return ""
     
    313313
    314314#       puts "$nick ${user} ($token) changes his/her nickname to $newnick"
    315       orxonox::irc::info $token "$nick changes his/her nickname to $newnick"
     315      ::orxonox::irc::info $token "$nick changes his/her nickname to $newnick"
    316316
    317317        return ""
     
    325325        set rest [eval concat $rest]
    326326#       puts "Received QUIT $token $nick $rest"
    327       orxonox::irc::info $token "Received QUIT $token $nick $rest"
     327      ::orxonox::irc::info $token "Received QUIT $token $nick $rest"
    328328
    329329        if {[string match ":*" $dest]} {
     
    332332        if {[isus $token $nick]} {
    333333#           puts "You left the server $state($token,host) ($dest $rest)"
    334           orxonox::irc::info $token "You left the server $state($token,host) ($dest $rest)"
     334          ::orxonox::irc::info $token "You left the server $state($token,host) ($dest $rest)"
    335335            forgetConnection $token
    336336        } else {
     
    352352        } else {
    353353#           puts "$nick$dest: [eval concat $rest]"
    354           orxonox::irc::say $token $nick [eval concat $rest]
     354          ::orxonox::irc::say $token $nick [eval concat $rest]
    355355        }
    356356
     
    426426        } else {
    427427#           puts "$nick: [eval concat $rest]"
    428           orxonox::irc::privmsg $nick $nick [eval concat $rest]
     428          ::orxonox::irc::privmsg $nick $nick [eval concat $rest]
    429429        }
    430430
     
    464464        if {[isus $token $kicked]} {
    465465#           puts "$nick kicked you from $dest because $reason"
    466           orxonox::irc::info $token "$nick kicked you from $dest because $reason"
     466          ::orxonox::irc::info $token "$nick kicked you from $dest because $reason"
    467467
    468468            removeChannel $token $dest
    469469        } else {
    470470#           puts "$nick kicks $kicked from $dest because $reason"
    471           orxonox::irc::info $token "$nick kicks $kicked from $dest because $reason"
     471          ::orxonox::irc::info $token "$nick kicks $kicked from $dest because $reason"
    472472
    473473            removeFromChannel $token $kicked $dest
     
    584584    proc RECV,CTCP,ACTION {token nick user comm dest action rest} {
    585585#       puts "$nick $rest"
    586       orxonox::irc::action $token $nick $rest
     586      ::orxonox::irc::action $token $nick $rest
    587587
    588588        return ""
     
    612612    proc defaultAction {token nick user comm dest rest} {
    613613#       puts "$token: $nick $user: $comm -> $dest ... [eval concat $rest]"
    614       orxonox::execute log "$token: $nick $user: $comm -> $dest ... [eval concat $rest]"
     614      ::orxonox::execute log "$token: $nick $user: $comm -> $dest ... [eval concat $rest]"
    615615
    616616        return ""
  • code/trunk/src/libraries/core/BaseObject.cc

    r7163 r7284  
    3939#include "Event.h"
    4040#include "EventIncludes.h"
    41 #include "Functor.h"
    4241#include "Iterator.h"
    4342#include "Template.h"
     
    4544#include "XMLNameListener.h"
    4645#include "XMLPort.h"
     46#include "command/Functor.h"
    4747
    4848namespace orxonox
     
    477477                if (!container)
    478478                {
    479                     ExecutorMember<BaseObject>* setfunctor = createExecutor(createFunctor(&BaseObject::addEventSource), std::string( "BaseObject" ) + "::" + "addEventSource" + '(' + statename + ')');
    480                     ExecutorMember<BaseObject>* getfunctor = createExecutor(createFunctor(&BaseObject::getEventSource), std::string( "BaseObject" ) + "::" + "getEventSource" + '(' + statename + ')');
     479                    const ExecutorMemberPtr<BaseObject>& setfunctor = createExecutor(createFunctor(&BaseObject::addEventSource), std::string( "BaseObject" ) + "::" + "addEventSource" + '(' + statename + ')');
     480                    const ExecutorMemberPtr<BaseObject>& getfunctor = createExecutor(createFunctor(&BaseObject::getEventSource), std::string( "BaseObject" ) + "::" + "getEventSource" + '(' + statename + ')');
    481481                    setfunctor->setDefaultValue(1, statename);
    482482                    getfunctor->setDefaultValue(1, statename);
  • code/trunk/src/libraries/core/BaseObject.h

    r7163 r7284  
    196196            mbool                   bVisible_;                 //!< True = the object is visible
    197197            std::string             mainStateName_;
    198             Functor              mainStateFunctor_;
     198            FunctorPtr              mainStateFunctor_;
    199199            std::set<std::string>   networkTemplateNames_;
    200200
  • code/trunk/src/libraries/core/CMakeLists.txt

    r7163 r7284  
    1919
    2020SET_SOURCE_FILES(CORE_SRC_FILES
     21  CommandLineParser.cc
    2122  ConfigValueContainer.cc
    2223  Core.cc
     
    2930  GraphicsManager.cc
    3031  GUIManager.cc
    31   IOConsole.cc
    3232  Language.cc
    3333  LuaState.cc
     
    3535  OrxonoxClass.cc
    3636  Resource.cc
    37   ScopedSingletonManager.cc
    3837  WindowEventListener.cc
    39 
    40   # command
    41   CommandEvaluation.cc
    42   CommandExecutor.cc
    43   CommandLineParser.cc
    44   ConsoleCommand.cc
    45   ConsoleCommandCompilation.cc
    46   Executor.cc
    4738
    4839  # hierarchy
     
    6051  XMLNameListener.cc
    6152
    62   # shell
    63   IRC.cc
    64   Shell.cc
    65   TclBind.cc
    66 
    6753COMPILATION_BEGIN FilesystemCompilation.cc
    68   ArgumentCompletionFunctions.cc
     54  command/ArgumentCompletionFunctions.cc
    6955  ConfigFileManager.cc
    7056  MemoryArchive.cc
     
    7561  ThreadPool.cc
    7662COMPILATION_BEGIN ThreadCompilation.cc
    77   TclThreadManager.cc
     63  command/TclThreadManager.cc
    7864  Thread.cc
    7965COMPILATION_END
    8066)
    8167
     68ADD_SUBDIRECTORY(command)
    8269ADD_SUBDIRECTORY(input)
    8370
     
    8572  FIND_HEADER_FILES
    8673  TOLUA_FILES
    87     CommandExecutor.h
     74    command/CommandExecutor.h
    8875    ConfigFileManager.h
    8976    Game.h
  • code/trunk/src/libraries/core/CommandLineParser.cc

    r6417 r7284  
    335335    {
    336336        std::vector<std::string> args;
    337         SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '(', ')', false);
     337        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '\0', '\0', false);
    338338        for (unsigned i = 0; i < tokens.size(); ++i)
    339339            args.push_back(tokens[i]);
     
    363363                //if (!(line[0] == '#' || line[0] == '%'))
    364364                //{
    365                 SubString tokens(line, " ", " ", false, '\\', true, '"', true, '(', ')', false, '#');
     365                SubString tokens(line, " ", " ", false, '\\', true, '"', true, '\0', '\0', false, '#');
    366366                for (unsigned i = 0; i < tokens.size(); ++i)
    367367                    if (tokens[i][0] != '#')
  • code/trunk/src/libraries/core/CommandLineParser.h

    r6021 r7284  
    6464        Note the difference between "-" and "--"!
    6565        Also, there is no restriction to the number of strings you add after --name.
    66         So "--startVector (2, 4, 5)" is perfectly legal.
     66        So "--startVector {2, 4, 5}" is perfectly legal.
    6767
    6868        Retrieving an argument is possible with the getCommandLineArgument function of the
  • code/trunk/src/libraries/core/ConfigFileManager.cc

    r7163 r7284  
    3434#include "util/Math.h"
    3535#include "util/StringUtils.h"
    36 #include "ConsoleCommand.h"
    3736#include "ConfigValueContainer.h"
    3837#include "PathConfig.h"
     38#include "command/ConsoleCommand.h"
    3939
    4040namespace orxonox
     
    277277                            if (commentposition == std::string::npos)
    278278                            {
    279                                 value = removeTrailingWhitespaces(line.substr(pos1 + 1));
     279                                value = line.substr(pos1 + 1);
    280280                            }
    281281                            else
    282282                            {
    283                                 value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
     283                                value = line.substr(pos1 + 1, commentposition - pos1 - 1);
    284284                                comment = removeTrailingWhitespaces(line.substr(commentposition));
    285285                            }
     286
     287                            value = removeTrailingWhitespaces(value);
     288                            value = removeSlashes(value);
    286289
    287290                            if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
     
    425428    ////////////////////////
    426429
     430    static const std::string __CC_load_name = "reloadSettings";
     431    static const std::string __CC_setFilename_name = "setSettingsFile";
     432    static const std::string __CC_config_name = "config";
     433    static const std::string __CC_tconfig_name = "tconfig";
     434    static const std::string __CC_getConfig_name = "getConfig";
     435
     436    SetConsoleCommand(__CC_load_name,            &ConfigFile::load);
     437    SetConsoleCommand(__CC_setFilename_name,     &SettingsConfigFile::setFilename);
     438    SetConsoleCommand(__CC_config_name,          &SettingsConfigFile::config).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
     439    SetConsoleCommand(__CC_tconfig_name,         &SettingsConfigFile::tconfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
     440    SetConsoleCommand(__CC_getConfig_name,       &SettingsConfigFile::getConfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries());
     441
    427442    SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;
    428443
     
    430445        : ConfigFile(filename)
    431446    {
    432         ConsoleCommand* command = createConsoleCommand(createFunctor(&ConfigFile::load, this), "reloadSettings");
    433         CommandExecutor::addConsoleCommandShortcut(command);
    434         command = createConsoleCommand(createFunctor(&SettingsConfigFile::setFilename, this), "setSettingsFile");
    435         CommandExecutor::addConsoleCommandShortcut(command);
    436         command = createConsoleCommand(createFunctor(&SettingsConfigFile::config, this), "config");
    437         CommandExecutor::addConsoleCommandShortcut(command).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
    438         command = createConsoleCommand(createFunctor(&SettingsConfigFile::tconfig, this), "tconfig");
    439         CommandExecutor::addConsoleCommandShortcut(command).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()).argumentCompleter(2, autocompletion::settingsvalue());
    440         command = createConsoleCommand(createFunctor(&SettingsConfigFile::getConfig, this), "getConfig");
    441         CommandExecutor::addConsoleCommandShortcut(command).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries());
     447        ModifyConsoleCommand(__CC_load_name).setObject(this);
     448        ModifyConsoleCommand(__CC_setFilename_name).setObject(this);
     449        ModifyConsoleCommand(__CC_config_name).setObject(this);
     450        ModifyConsoleCommand(__CC_tconfig_name).setObject(this);
     451        ModifyConsoleCommand(__CC_getConfig_name).setObject(this);
    442452    }
    443453
    444454    SettingsConfigFile::~SettingsConfigFile()
    445455    {
     456        ModifyConsoleCommand(__CC_load_name).setObject(0);
     457        ModifyConsoleCommand(__CC_setFilename_name).setObject(0);
     458        ModifyConsoleCommand(__CC_config_name).setObject(0);
     459        ModifyConsoleCommand(__CC_tconfig_name).setObject(0);
     460        ModifyConsoleCommand(__CC_getConfig_name).setObject(0);
    446461    }
    447462
     
    543558    }
    544559
    545     bool SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
    546     {
    547         return this->configImpl(section, entry, value, &ConfigValueContainer::set);
    548     }
    549 
    550     bool SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
    551     {
    552         return this->configImpl(section, entry, value, &ConfigValueContainer::tset);
     560    void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
     561    {
     562        if (!this->configImpl(section, entry, value, &ConfigValueContainer::set))
     563            COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
     564    }
     565
     566    void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
     567    {
     568        if (!this->configImpl(section, entry, value, &ConfigValueContainer::tset))
     569            COUT(1) << "Error: Config value \"" << entry << "\" in section \"" << section << "\" doesn't exist." << std::endl;
    553570    }
    554571
  • code/trunk/src/libraries/core/ConfigFileManager.h

    r7163 r7284  
    331331            void clean(bool bCleanComments = false); // tolua_export
    332332
    333             bool config(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
    334             bool tconfig(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
     333            void config(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
     334            void tconfig(const std::string& section, const std::string& entry, const std::string& value); // tolua_export
    335335            std::string getConfig(const std::string& section, const std::string& entry); // tolua_export
    336336
  • code/trunk/src/libraries/core/ConfigValueContainer.cc

    r6536 r7284  
    302302    bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input)
    303303    {
    304         SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '(', ')', false, '\0');
     304        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '\0', '\0', false, '\0');
    305305        int index = -1;
    306306        bool success = false;
  • code/trunk/src/libraries/core/Core.cc

    r7175 r7284  
    5252#include "util/Exception.h"
    5353#include "util/Scope.h"
     54#include "util/ScopedSingletonManager.h"
    5455#include "util/SignalHandler.h"
    5556#include "PathConfig.h"
    56 #include "CommandExecutor.h"
    5757#include "CommandLineParser.h"
    5858#include "ConfigFileManager.h"
     
    6565#include "Identifier.h"
    6666#include "Language.h"
    67 #include "IOConsole.h"
    6867#include "LuaState.h"
    69 #include "ScopedSingletonManager.h"
    70 #include "TclBind.h"
    71 #include "TclThreadManager.h"
     68#include "command/ConsoleCommand.h"
     69#include "command/IOConsole.h"
     70#include "command/TclBind.h"
     71#include "command/TclThreadManager.h"
    7272#include "input/InputManager.h"
    7373
     
    8888        : identifierDestroyer_(Identifier::destroyAllIdentifiers)
    8989        // Cleanup guard for external console commands that don't belong to an Identifier
    90         , consoleCommandDestroyer_(CommandExecutor::destroyExternalCommands)
     90        , consoleCommandDestroyer_(ConsoleCommand::destroyAll)
    9191        , bGraphicsLoaded_(false)
    9292        , bStartIOConsole_(true)
  • code/trunk/src/libraries/core/CorePrereqs.h

    r7271 r7284  
    119119    T orxonox_cast(U*);
    120120
    121     class ArgumentCompleter;
    122     class ArgumentCompletionListElement;
    123121    class BaseObject;
    124122    template <class T>
     
    130128    class ClassTreeMaskNode;
    131129    class ClassTreeMaskObjectIterator;
    132     class CommandEvaluation;
    133130    class CommandLineParser;
    134131    class CommandLineArgument;
     
    140137    class ConfigFileSection;
    141138    class ConfigValueContainer;
    142     class ConsoleCommand;
    143139    class Core;
    144140    class DynLib;
     
    146142    struct Event;
    147143    class EventState;
    148     class Executor;
    149     template <class T>
    150     class ExecutorMember;
    151     class ExecutorStatic;
    152144    class Factory;
    153     class Functor;
    154     template <class T>
    155     class FunctorMember;
    156     class FunctorStatic;
    157145    class Game;
    158146    class GameState;
     
    162150    class GUIManager;
    163151    class Identifier;
    164     class IOConsole;
    165     class IRC;
    166152    template <class T>
    167153    class Iterator;
    168154    class Language;
     155    class LuaFunctor;
    169156    class LuaState;
    170157    class MemoryArchive;
     
    187174    struct ResourceInfo;
    188175    class SettingsConfigFile;
    189     class Shell;
    190     class ShellListener;
    191176    template <class T>
    192177    class SmartPtr;
    193178    template <class T>
    194179    class SubclassIdentifier;
    195     class TclBind;
    196     struct TclInterpreterBundle;
    197     template <class T>
    198     class TclThreadList;
    199     class TclThreadManager;
    200180    class Template;
    201181    class Thread;
     
    212192    class XMLPortObjectContainer;
    213193    class XMLPortParamContainer;
     194
     195    // Command
     196    class ArgumentCompleter;
     197    class ArgumentCompletionListElement;
     198    class CommandEvaluation;
     199    class ConsoleCommand;
     200    class Executor;
     201    template <class T>
     202    class ExecutorMember;
     203    class ExecutorStatic;
     204    class Functor;
     205    template <class O>
     206    class FunctorMember;
     207    typedef FunctorMember<void> FunctorStatic;
     208    template <class F, class O>
     209    class FunctorPointer;
     210    class IOConsole;
     211    class IRC;
     212    class Shell;
     213    class ShellListener;
     214    class TclBind;
     215    struct TclInterpreterBundle;
     216    template <class T>
     217    class TclThreadList;
     218    class TclThreadManager;
    214219
    215220    // Input
     
    238243}
    239244
     245#include "command/FunctorPtr.h"
     246#include "command/ExecutorPtr.h"
     247
    240248// CppTcl
    241249namespace Tcl
  • code/trunk/src/libraries/core/Event.cc

    r7271 r7284  
    3434namespace orxonox
    3535{
    36     /**
    37         @brief Destructor: Deletes the functor of the event state.
    38     */
    39     EventState::~EventState()
    40     {
    41         if (this->statefunction_)
    42             delete this->statefunction_;
    43     }
    44 
    4536    /**
    4637        @brief Processes an event (calls the set-function if the necessary conditions are met).
  • code/trunk/src/libraries/core/Event.h

    r6800 r7284  
    6767    {
    6868        public:
    69             EventState(Functor* statefunction, Identifier* subclass, bool bSink = false) : bProcessingEvent_(false), activeEvents_(0), statefunction_(statefunction), subclass_(subclass), bSink_(bSink) {}
    70             virtual ~EventState();
     69            EventState(const FunctorPtr& statefunction, Identifier* subclass, bool bSink = false) : bProcessingEvent_(false), activeEvents_(0), statefunction_(statefunction), subclass_(subclass), bSink_(bSink) {}
    7170
    7271            void process(const Event& event, BaseObject* object);
    7372
    74             Functor* getFunctor() const
     73            const FunctorPtr& getFunctor() const
    7574                { return this->statefunction_; }
    7675
     
    7877            bool        bProcessingEvent_;  //!< This becomes true while the container processes an event (used to prevent loops)
    7978            int         activeEvents_;      //!< The number of events which affect this state and are currently active
    80             Functor  statefunction_;     //!< A functor to set the state
     79            FunctorPtr  statefunction_;     //!< A functor to set the state
    8180            Identifier* subclass_;          //!< Originators must be an instance of this class (usually BaseObject, but some statefunctions allow a second argument with an originator of a specific class)
    8281            bool        bSink_;             //!< Determines whether the EventState acts as an EventSink forwarding any Event (even if the state didn't change) or in the normal manner, only processing Events that change the state.
  • code/trunk/src/libraries/core/EventIncludes.h

    r7163 r7284  
    3131
    3232#include "CorePrereqs.h"
    33 #include "Executor.h"
    3433#include "XMLPort.h"
     34#include "command/Executor.h"
    3535
    3636/**
     
    7676
    7777#define XMLPortEventStateIntern(name, classname, statename, xmlelement, mode) \
    78     static orxonox::ExecutorMember<classname>* xmlsetfunctor##name = (orxonox::ExecutorMember<classname>*)&orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')')->setDefaultValue(1, statename); \
    79     static orxonox::ExecutorMember<classname>* xmlgetfunctor##name = (orxonox::ExecutorMember<classname>*)&orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')')->setDefaultValue(1, statename); \
     78    static orxonox::ExecutorMemberPtr<classname> xmlsetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname> >(); \
     79    static orxonox::ExecutorMemberPtr<classname> xmlgetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname> >(); \
     80    xmlsetfunctor##name->setDefaultValue(1, statename); \
     81    xmlgetfunctor##name->setDefaultValue(1, statename); \
    8082    XMLPortObjectGeneric(xmlport##name, classname, orxonox::BaseObject, statename, xmlsetfunctor##name, xmlgetfunctor##name, xmlelement, mode, false, true)
    8183
  • code/trunk/src/libraries/core/GUIManager.cc

    r7163 r7284  
    5757#include "util/Exception.h"
    5858#include "util/OrxAssert.h"
    59 #include "ConsoleCommand.h"
    6059#include "Core.h"
    6160#include "GraphicsManager.h"
     
    6362#include "PathConfig.h"
    6463#include "Resource.h"
     64#include "command/ConsoleCommand.h"
    6565#include "input/InputManager.h"
    6666#include "input/InputState.h"
     
    7171    static void key_esc()
    7272        { GUIManager::getInstance().keyESC(); }
    73     SetConsoleCommandShortcutExternAlias(key_esc, "keyESC");
     73    SetConsoleCommand("keyESC", &key_esc);
    7474
    7575    class CEGUILogger : public CEGUI::DefaultLogger
     
    9999    GUIManager* GUIManager::singletonPtr_s = 0;
    100100
    101     SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User).defaultValue(1, false).defaultValue(2, true);
    102     SetConsoleCommandShortcut(GUIManager, hideGUI).accessLevel(AccessLevel::User);
     101    SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, true);
     102    SetConsoleCommand("hideGUI", &GUIManager::hideGUI);
    103103
    104104    /**
  • code/trunk/src/libraries/core/Game.cc

    r7266 r7284  
    4545#include "util/SubString.h"
    4646#include "CommandLineParser.h"
    47 #include "ConsoleCommand.h"
    4847#include "Core.h"
    4948#include "CoreIncludes.h"
     
    5251#include "GameState.h"
    5352#include "GUIManager.h"
     53#include "command/ConsoleCommand.h"
    5454
    5555namespace orxonox
     
    5757    static void stop_game()
    5858        { Game::getInstance().stop(); }
    59     SetConsoleCommandShortcutExternAlias(stop_game, "exit");
     59    SetConsoleCommand("exit", &stop_game);
    6060    static void printFPS()
    6161        { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
    62     SetConsoleCommandShortcutExternAlias(printFPS, "printFPS");
     62    SetConsoleCommand("printFPS", &printFPS);
    6363    static void printTickTime()
    6464        { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }
    65     SetConsoleCommandShortcutExternAlias(printTickTime, "printTickTime");
     65    SetConsoleCommand("printTickTime", &printTickTime);
    6666
    6767    std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s;
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r6524 r7284  
    5252#include "util/StringUtils.h"
    5353#include "util/SubString.h"
    54 #include "ConsoleCommand.h"
    5554#include "ConfigValueIncludes.h"
    5655#include "CoreIncludes.h"
     
    6261#include "WindowEventListener.h"
    6362#include "XMLFile.h"
     63#include "command/ConsoleCommand.h"
    6464
    6565namespace orxonox
    6666{
     67    static const std::string __CC_printScreen_name = "printScreen";
     68    DeclareConsoleCommand(__CC_printScreen_name, &prototype::void__void);
     69
    6770    class OgreWindowEventListener : public Ogre::WindowEventListener
    6871    {
     
    131134
    132135        Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get());
    133         // TODO: Destroy the console command
     136        ModifyConsoleCommand(__CC_printScreen_name).resetFunction();
    134137
    135138        // Undeclare the resources
     
    290293        boost::filesystem::path folder(ogrePluginsDirectory_);
    291294        // Do some SubString magic to get the comma separated list of plugins
    292         SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0');
     295        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
    293296        // Use backslash paths on Windows! file_string() already does that though.
    294297        for (unsigned int i = 0; i < plugins.size(); ++i)
     
    321324
    322325        // add console commands
    323         ccPrintScreen_ = createConsoleCommand(createFunctor(&GraphicsManager::printScreen, this), "printScreen");
    324         CommandExecutor::addConsoleCommandShortcut(ccPrintScreen_);
     326        ModifyConsoleCommand(__CC_printScreen_name).setFunction(&GraphicsManager::printScreen, this);
    325327    }
    326328
  • code/trunk/src/libraries/core/GraphicsManager.h

    r6417 r7284  
    114114        int                 ogreLogLevelCritical_;     //!< Corresponding Orxonox debug level for LL_CRITICAL
    115115
    116         // console commands
    117         ConsoleCommand*     ccPrintScreen_;
    118 
    119116        static GraphicsManager* singletonPtr_s;        //!< Pointer to the Singleton
    120117    };
  • code/trunk/src/libraries/core/Identifier.cc

    r6536 r7284  
    3838#include "util/StringUtils.h"
    3939#include "ConfigValueContainer.h"
    40 #include "ConsoleCommand.h"
    4140#include "ClassFactory.h"
    4241#include "XMLPort.h"
     
    6463
    6564        this->bHasConfigValues_ = false;
    66         this->bHasConsoleCommands_ = false;
    6765
    6866        // Default network ID is the class ID
     
    8078            delete this->factory_;
    8179
    82         for (std::map<std::string, ConsoleCommand*>::iterator it = this->consoleCommands_.begin(); it != this->consoleCommands_.end(); ++it)
    83             delete (it->second);
    8480        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
    8581            delete (it->second);
     
    433429
    434430    /**
    435         @brief Adds a new console command of this class.
    436         @param executor The executor of the command
    437         @param bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command
    438         @return The executor of the command
    439     */
    440     ConsoleCommand& Identifier::addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut)
    441     {
    442         std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(command->getName());
    443         if (it != this->consoleCommands_.end())
    444         {
    445             COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << '.' << std::endl;
    446             delete (it->second);
    447         }
    448 
    449         this->bHasConsoleCommands_ = true;
    450         this->consoleCommands_[command->getName()] = command;
    451         this->consoleCommands_LC_[getLowercase(command->getName())] = command;
    452 
    453         if (bCreateShortcut)
    454             CommandExecutor::addConsoleCommandShortcut(command);
    455 
    456         return (*command);
    457     }
    458 
    459     /**
    460         @brief Returns the executor of a console command with given name.
    461         @brief name The name of the requested console command
    462         @return The executor of the requested console command
    463     */
    464     ConsoleCommand* Identifier::getConsoleCommand(const std::string& name) const
    465     {
    466         std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_.find(name);
    467         if (it != this->consoleCommands_.end())
    468             return it->second;
    469         else
    470             return 0;
    471     }
    472 
    473     /**
    474         @brief Returns the executor of a console command with given name in lowercase.
    475         @brief name The name of the requested console command in lowercae
    476         @return The executor of the requested console command
    477     */
    478     ConsoleCommand* Identifier::getLowercaseConsoleCommand(const std::string& name) const
    479     {
    480         std::map<std::string, ConsoleCommand*>::const_iterator it = this->consoleCommands_LC_.find(name);
    481         if (it != this->consoleCommands_LC_.end())
    482             return it->second;
    483         else
    484             return 0;
    485     }
    486 
    487     /**
    488431        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
    489432        @param paramname The name of the parameter
  • code/trunk/src/libraries/core/Identifier.h

    r7271 r7284  
    202202            void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
    203203            ConfigValueContainer* getConfigValueContainer(const std::string& varname);
    204 
    205 
    206             ////////////////////////////
    207             ///// Console Commands /////
    208             ////////////////////////////
    209             /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
    210             inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
    211 
    212             /** @brief Returns the map that stores all console commands. @return The const_iterator */
    213             inline const std::map<std::string, ConsoleCommand*>& getConsoleCommandMap() const { return this->consoleCommands_; }
    214             /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
    215             inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapBegin() const { return this->consoleCommands_.begin(); }
    216             /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
    217             inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapEnd() const { return this->consoleCommands_.end(); }
    218 
    219             /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
    220             inline const std::map<std::string, ConsoleCommand*>& getLowercaseConsoleCommandMap() const { return this->consoleCommands_LC_; }
    221             /** @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 */
    222             inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapBegin() const { return this->consoleCommands_LC_.begin(); }
    223             /** @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 */
    224             inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }
    225 
    226             ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);
    227             ConsoleCommand* getConsoleCommand(const std::string& name) const;
    228             ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
    229204
    230205
     
    305280            bool bHasConfigValues_;                                        //!< True if this class has at least one assigned config value
    306281            std::map<std::string, ConfigValueContainer*> configValues_;    //!< A map to link the string of configurable variables with their ConfigValueContainer
    307 
    308             bool bHasConsoleCommands_;                                     //!< True if this class has at least one assigned console command
    309             std::map<std::string, ConsoleCommand*> consoleCommands_;       //!< All console commands of this class
    310             std::map<std::string, ConsoleCommand*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
    311282
    312283            std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
  • code/trunk/src/libraries/core/Language.cc

    r6417 r7284  
    3636#include <fstream>
    3737#include "util/Debug.h"
     38#include "util/StringUtils.h"
    3839#include "Core.h"
    3940#include "PathConfig.h"
     
    169170        @return The localisation
    170171    */
    171     const std::string& Language::getLocalisation(const LanguageEntryLabel& label) const
     172    const std::string& Language::getLocalisation(const LanguageEntryLabel& label, bool bError) const
    172173    {
    173174        std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(label);
    174175        if (it != this->languageEntries_.end())
    175176            return it->second->getLocalisation();
    176         else
     177        else if (bError)
    177178        {
    178179            // Uh, oh, an undefined entry was requested: return the default string
     
    180181            return this->defaultLocalisation_;
    181182        }
     183        else
     184            return BLANKSTRING;
    182185    }
    183186
  • code/trunk/src/libraries/core/Language.h

    r6536 r7284  
    116116
    117117            void addEntry(const LanguageEntryLabel& label, const std::string& entry);
    118             const std::string& getLocalisation(const LanguageEntryLabel& label) const;
     118            const std::string& getLocalisation(const LanguageEntryLabel& label, bool bError = true) const;
    119119
    120120        private:
     
    145145        return Language::getInstance().getLocalisation(label);
    146146    }
     147
     148    //! Shortcut function for Language::getLocalisation without printing an error in case the label doesn't exist
     149    inline const std::string& GetLocalisation_noerror(const LanguageEntryLabel& label)
     150    {
     151        return Language::getInstance().getLocalisation(label, false);
     152    }
    147153}
    148154
  • code/trunk/src/libraries/core/LuaState.cc

    r7266 r7284  
    3939#include "util/Debug.h"
    4040#include "util/Exception.h"
    41 #include "IOConsole.h"
    4241#include "Resource.h"
    4342#include "ToluaBindCore.h"
     43#include "command/IOConsole.h"
    4444
    4545namespace orxonox
     
    370370    }
    371371
    372     void LuaFunctor::operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
     372    void LuaFunctor::operator()()
    373373    {
    374374        lua_->doString(this->code_);
  • code/trunk/src/libraries/core/LuaState.h

    r7266 r7284  
    4040#include <loki/ScopeGuard.h>
    4141
    42 #include "Functor.h"
    4342#include "ToluaInterface.h"
    4443
    4544namespace orxonox // tolua_export
    4645{ // tolua_export
    47     class Functor; // tolua_export
     46    class LuaFunctor; // tolua_export
    4847
    49     //! Functor subclass that simply executes code with 0 arguments.
    50     class _CoreExport LuaFunctor : public Functor
     48    //! callback class that executes lua code
     49    class _CoreExport LuaFunctor
    5150    {
    5251        public:
    5352            LuaFunctor(const std::string& code, LuaState* luaState);
    54             void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null);
    55             void evaluateParam(unsigned int index, MultiType& param) const {}
     53            void operator()();
    5654
    5755        private:
     
    9189        const shared_ptr<ResourceInfo>& getDefaultResourceInfo() { return this->sourceFileInfo_; }
    9290
    93         Functor* createLuaFunctor(const std::string& code) { return new LuaFunctor(code, this); } // tolua_export
     91        LuaFunctor* createLuaFunctor(const std::string& code) { return new LuaFunctor(code, this); } // tolua_export
    9492        //! Tells about whether IOConsole was activated. The Lua debugger only works with a normal console.
    9593        bool usingIOConsole() const; // tolua_export
  • code/trunk/src/libraries/core/Thread.cc

    r6417 r7284  
    3636
    3737#include "util/Sleep.h"
    38 #include "Executor.h"
     38#include "command/Executor.h"
    3939
    4040namespace orxonox
     
    7575    }
    7676
    77     bool Thread::evaluateExecutor( Executor* executor )
     77    bool Thread::evaluateExecutor( const ExecutorPtr& executor )
    7878    {
    7979        this->isWorkingMutex_->lock();
     
    9292        {
    9393            //this->executorMutex_->lock();
    94             Executor* executor = this->executor_;
     94            ExecutorPtr executor = this->executor_;
    9595            //this->executorMutex_->unlock();
    9696            if( executor )
     
    9898                (*executor)();
    9999                this->executorMutex_->lock();
    100                 delete this->executor_;
    101100                this->executor_ = 0;
    102101                this->executorMutex_->unlock();
  • code/trunk/src/libraries/core/Thread.h

    r6417 r7284  
    4646        bool isWorking();
    4747        void waitUntilFinished();
    48         bool evaluateExecutor( Executor* executor );
     48        bool evaluateExecutor( const ExecutorPtr& executor );
    4949
    5050    private:
    5151        void            threadLoop();
    5252
    53         Executor     executor_;
     53        ExecutorPtr     executor_;
    5454        bool            isWorking_;
    5555        bool            stopThread_;
    5656        boost::thread*  workerThread_;
    5757        boost::mutex*   executorMutex_;
    58         boost::mutex*     isWorkingMutex_;
     58        boost::mutex*   isWorkingMutex_;
    5959        boost::mutex*   stopThreadMutex_;
    6060    };
  • code/trunk/src/libraries/core/ThreadPool.cc

    r6417 r7284  
    8181    }
    8282
    83     bool ThreadPool::passFunction( Executor* executor, bool addThread )
     83    bool ThreadPool::passFunction( const ExecutorPtr& executor, bool addThread )
    8484    {
    8585        std::vector<Thread*>::iterator it;
  • code/trunk/src/libraries/core/ThreadPool.h

    r6417 r7284  
    4646        unsigned int setNrOfThreads( unsigned int nr );
    4747
    48         bool passFunction( Executor* executor, bool addThread=false );
     48        bool passFunction( const ExecutorPtr& executor, bool addThread=false );
    4949        void synchronise();
    5050
  • code/trunk/src/libraries/core/WeakPtr.h

    r7268 r7284  
    3737#include "Identifier.h"
    3838#include "OrxonoxClass.h"
    39 #include "Functor.h"
     39#include "command/Functor.h"
    4040
    4141namespace orxonox
     
    7878                if (this->base_)
    7979                    this->base_->unregisterWeakPtr(this);
    80                 if (this->callback_)
    81                     delete this->callback_;
    8280
    8381            }
     
    169167            }
    170168
    171             inline void setCallback(Functor* callback)
     169            inline void setCallback(const FunctorPtr& callback)
    172170            {
    173171                this->callback_ = callback;
    174172            }
    175173
    176             inline Functor* getFunctor() const
     174            inline const FunctorPtr& getCallback() const
    177175            {
    178176                return this->callback_;
     
    190188            T* pointer_;
    191189            OrxonoxClass* base_;
    192             Functor* callback_;
     190            FunctorPtr callback_;
    193191    };
    194192
  • code/trunk/src/libraries/core/XMLPort.h

    r7271 r7284  
    5353#include "util/StringUtils.h"
    5454#include "Identifier.h"
    55 #include "Executor.h"
    5655#include "BaseObject.h"
     56#include "command/Executor.h"
    5757
    5858// ------------
     
    7575*/
    7676#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
    77     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    78     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     77    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     78    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    7979    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode)
    8080
     
    9494#define XMLPortParamVariable(classname, paramname, variable, xmlelement, mode) \
    9595    XMLPortVariableHelperClass xmlcontainer##variable##dummy(static_cast<void*>(&variable)); \
    96     static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##loadexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader")); \
    97     static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##saveexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" )); \
     96    static ExecutorMemberPtr<orxonox::XMLPortVariableHelperClass> xmlcontainer##variable##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader"); \
     97    static ExecutorMemberPtr<orxonox::XMLPortVariableHelperClass> xmlcontainer##variable##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" ); \
    9898    XMLPortParamGeneric(xmlcontainer##variable, classname, orxonox::XMLPortVariableHelperClass, &xmlcontainer##variable##dummy, paramname, xmlcontainer##variable##loadexecutor, xmlcontainer##variable##saveexecutor, xmlelement, mode)
    9999
     
    110110*/
    111111#define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
    112     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    113     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     112    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<void, classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     113    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    114114    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode)
    115115
     
    129129*/
    130130#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
    131     static ExecutorMember<classname>* xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     131    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    132132    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, xmlcontainer##loadfunction##0##loadexecutor, 0, xmlelement, mode)
    133133/**
     
    135135*/
    136136#define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \
    137     static ExecutorMember<classname>* xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     137    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<void, classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    138138    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, xmlcontainer##loadfunction##0##loadexecutor, 0, xmlelement, mode)
    139139
     
    161161*/
    162162#define XMLPortParamExtern(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode) \
    163     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
    164     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
     163    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
     164    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
    165165    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode);
    166166/**
     
    168168*/
    169169#define XMLPortParamExternTemplate(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
    170     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<externclass, __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
    171     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
     170    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<void, externclass, __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
     171    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
    172172    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode);
    173173
     
    249249*/
    250250#define XMLPortObjectExtended(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    251     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    252     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     251    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     252    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    253253    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    254254/**
     
    256256*/
    257257#define XMLPortObjectExtendedTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore, ...) \
    258     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    259     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     258    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<void, classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     259    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    260260    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    261261
     
    267267*/
    268268#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode) \
    269     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    270     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     269    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     270    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    271271    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, false, true)
    272272/**
     
    274274*/
    275275#define XMLPortObjectTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, ...) \
    276     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    277     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     276    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<void, classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     277    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    278278    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, false, true)
    279279
     
    317317                { return this->paramname_; }
    318318
    319             virtual XMLPortParamContainer& description(const std::string& description) = 0;
    320             virtual const std::string& getDescription() = 0;
     319            inline XMLPortParamContainer& description(const std::string& description)
     320                { this->description_ = description; return *this; }
     321            inline const std::string& getDescription() const
     322                { return this->description_; }
    321323
    322324            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param) = 0;
     
    332334            Identifier* identifier_;
    333335            BaseObject* owner_;
     336            std::string description_;
    334337    };
    335338
     
    345348
    346349        public:
    347             XMLPortClassParamContainer(const std::string& paramname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor)
     350            XMLPortClassParamContainer(const std::string& paramname, Identifier* identifier, const ExecutorMemberPtr<T>& loadexecutor, const ExecutorMemberPtr<T>& saveexecutor)
    348351            {
    349352                this->paramname_ = paramname;
     
    355358            ~XMLPortClassParamContainer()
    356359            {
    357                 assert(this->loadexecutor_);
    358                 delete this->loadexecutor_;
    359                 if (this->saveexecutor_)
    360                     delete this->saveexecutor_;
    361360            }
    362361
     
    395394                        {
    396395                            COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
    397                             if (this->loadexecutor_->parse(object, attributeValue, ",") || (mode  == XMLPort::ExpandObject))
     396                            int error;
     397                            this->loadexecutor_->parse(object, attributeValue, &error, ",");
     398                            if (!error || (mode  == XMLPort::ExpandObject))
    398399                                this->parseResult_ = PR_finished;
    399400                            else
     
    436437            }
    437438
    438             virtual XMLPortParamContainer& description(const std::string& description)
    439                 { this->loadexecutor_->setDescription(description); return (*this); }
    440             virtual const std::string& getDescription()
    441                 { return this->loadexecutor_->getDescription(); }
    442 
    443439            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param)
    444440            {
     
    479475
    480476        private:
    481             ExecutorMember<T>* loadexecutor_;
    482             ExecutorMember<T>* saveexecutor_;
     477            ExecutorMemberPtr<T> loadexecutor_;
     478            ExecutorMemberPtr<T> saveexecutor_;
    483479            ParseParams parseParams_;
    484480    };
     
    502498                { return this->sectionname_; }
    503499
    504             virtual XMLPortObjectContainer& description(const std::string& description) = 0;
    505             virtual const std::string& getDescription() = 0;
     500            inline XMLPortObjectContainer& description(const std::string& description)
     501                { this->description_ = description; return *this; }
     502            const std::string& getDescription() const
     503                { return this->description_; }
    506504
    507505            bool identifierIsIncludedInLoaderMask(const Identifier* identifier);
     
    513511            Identifier* identifier_;
    514512            Identifier* objectIdentifier_;
     513            std::string description_;
    515514    };
    516515
     
    519518    {
    520519        public:
    521             XMLPortClassObjectContainer(const std::string& sectionname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
     520            XMLPortClassObjectContainer(const std::string& sectionname, Identifier* identifier, const ExecutorMemberPtr<T>& loadexecutor, const ExecutorMemberPtr<T>& saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
    522521            {
    523522                this->sectionname_ = sectionname;
     
    533532            ~XMLPortClassObjectContainer()
    534533            {
    535                 assert(this->loadexecutor_);
    536                 delete this->loadexecutor_;
    537                 if (this->saveexecutor_)
    538                     delete this->saveexecutor_;
    539534            }
    540535
     
    549544            }
    550545
    551             virtual XMLPortObjectContainer& description(const std::string& description)
    552                 { this->loadexecutor_->setDescription(description); return (*this); }
    553             virtual const std::string& getDescription()
    554                 { return this->loadexecutor_->getDescription(); }
    555 
    556546        private:
    557             ExecutorMember<T>* loadexecutor_;
    558             ExecutorMember<T>* saveexecutor_;
     547            ExecutorMemberPtr<T> loadexecutor_;
     548            ExecutorMemberPtr<T> saveexecutor_;
    559549    };
    560550
  • code/trunk/src/libraries/core/input/Button.cc

    r6536 r7284  
    3939#include "util/StringUtils.h"
    4040#include "util/Debug.h"
    41 #include "core/ConsoleCommand.h"
    42 #include "core/CommandEvaluation.h"
    43 #include "core/CommandExecutor.h"
     41#include "core/command/ConsoleCommand.h"
     42#include "core/command/CommandEvaluation.h"
     43#include "core/command/CommandExecutor.h"
    4444#include "core/ConfigFileManager.h"
    4545
     
    117117        // separate the commands
    118118        SubString commandStrings(bindingString_, "|", SubString::WhiteSpaces, false,
    119             '\\', false, '"', false, '(', ')', false, '\0');
     119            '\\', false, '"', false, '{', '}', false, '\0');
    120120
    121121        for (unsigned int iCommand = 0; iCommand < commandStrings.size(); iCommand++)
     
    124124            {
    125125                SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
    126                     '\\', false, '"', false, '(', ')', false, '\0');
     126                    '\\', false, '"', false, '{', '}', false, '\0');
    127127
    128128                KeybindMode::Value mode = KeybindMode::None;
     
    175175
    176176                // evaluate the command
    177                 const CommandEvaluation& eval = CommandExecutor::evaluate(commandStr);
    178                 if (!eval.isValid())
     177                CommandEvaluation eval = CommandExecutor::evaluate(commandStr);
     178                if (!eval.isValid() || eval.evaluateParams(true))
    179179                {
    180180                    parseError("Command evaluation of \"" + commandStr + "\"failed.", true);
  • code/trunk/src/libraries/core/input/HalfAxis.cc

    r5781 r7284  
    3434
    3535#include "HalfAxis.h"
    36 #include "core/CommandEvaluation.h"
     36#include "core/command/CommandEvaluation.h"
    3737
    3838namespace orxonox
  • code/trunk/src/libraries/core/input/InputCommands.h

    r6417 r7284  
    3737
    3838#include "InputPrereqs.h"
    39 #include "core/CommandEvaluation.h"
     39#include "core/command/CommandEvaluation.h"
    4040
    4141namespace orxonox
  • code/trunk/src/libraries/core/input/InputManager.cc

    r7266 r7284  
    4747#include "core/CoreIncludes.h"
    4848#include "core/ConfigValueIncludes.h"
    49 #include "core/ConsoleCommand.h"
    5049#include "core/CommandLineParser.h"
    51 #include "core/Functor.h"
    5250#include "core/GraphicsManager.h"
     51#include "core/command/ConsoleCommand.h"
     52#include "core/command/Functor.h"
    5353
    5454#include "InputBuffer.h"
     
    6161{
    6262    SetCommandLineSwitch(keyboard_no_grab).information("Whether not to exclusively grab the keyboard");
     63
     64    static const std::string __CC_InputManager_name = "InputManager";
     65    static const std::string __CC_calibrate_name = "calibrate";
     66    static const std::string __CC_reload_name = "reload";
     67
     68    SetConsoleCommand(__CC_InputManager_name, __CC_calibrate_name, &InputManager::calibrate).addShortcut();
     69    SetConsoleCommand(__CC_InputManager_name, __CC_reload_name,    &InputManager::reload   );
    6370
    6471    // Abuse of this source file for the InputHandler
     
    118125        this->updateActiveStates();
    119126
    120         // calibrate console command
    121         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::calibrate, this), "calibrate"), true);
    122         // reload console command
    123         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::reload, this), "reload"), false);
     127        ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(this);
     128        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
    124129
    125130        CCOUT(4) << "Construction complete." << std::endl;
     
    287292        if (!(internalState_ & Bad))
    288293            this->destroyDevices();
     294
     295        // Reset console commands
     296        ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(0);
     297        ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
    289298
    290299        CCOUT(3) << "Destruction complete." << std::endl;
  • code/trunk/src/libraries/core/input/InputState.cc

    r6746 r7284  
    2828
    2929#include "InputState.h"
    30 #include "core/Functor.h"
     30#include "core/command/Functor.h"
    3131
    3232namespace orxonox
  • code/trunk/src/libraries/core/input/InputState.h

    r6746 r7284  
    150150        void left();
    151151        //! Sets a functor to be called upon activation of the state
    152         void setEnterFunctor(Functor* functor) { this->enterFunctor_ = functor; }
     152        void setEnterFunctor(const FunctorPtr& functor) { this->enterFunctor_ = functor; }
    153153        //! Sets a functor to be called upon deactivation of the state
    154         void setLeaveFunctor(Functor* functor) { this->leaveFunctor_ = functor; }
     154        void setLeaveFunctor(const FunctorPtr& functor) { this->leaveFunctor_ = functor; }
    155155
    156156    private:
     
    172172        //! Handler to be used for all joy sticks (needs to be saved in case another joy stick gets attached)
    173173        InputHandler*               joyStickHandlerAll_;
    174         Functor                  enterFunctor_;          //!< Functor to be executed on enter
    175         Functor                  leaveFunctor_;          //!< Functor to be executed on leave
     174        FunctorPtr                  enterFunctor_;          //!< Functor to be executed on enter
     175        FunctorPtr                  leaveFunctor_;          //!< Functor to be executed on leave
    176176    };
    177177
  • code/trunk/src/libraries/core/input/KeyBinderManager.cc

    r6417 r7284  
    3131#include "util/Debug.h"
    3232#include "util/Exception.h"
     33#include "util/ScopedSingletonManager.h"
    3334#include "core/ConfigValueIncludes.h"
    34 #include "core/ConsoleCommand.h"
    3535#include "core/CoreIncludes.h"
    36 #include "core/ScopedSingletonManager.h"
     36#include "core/LuaState.h"
     37#include "core/command/ConsoleCommand.h"
    3738#include "InputManager.h"
    3839#include "KeyDetector.h"
     
    4142{
    4243    ManageScopedSingleton(KeyBinderManager, ScopeID::Graphics, false);
     44
     45    static const std::string __CC_keybind_name = "keybind";
     46    static const std::string __CC_tkeybind_name = "tkeybind";
     47    static const std::string __CC_unbind_name = "unbind";
     48    static const std::string __CC_tunbind_name = "tunbind";
     49
     50    SetConsoleCommand(__CC_keybind_name,  &KeyBinderManager::keybind).defaultValues("").argumentCompleter(0, autocompletion::command());
     51    SetConsoleCommand(__CC_tkeybind_name, &KeyBinderManager::tkeybind).defaultValues("").argumentCompleter(0, autocompletion::command());
     52    SetConsoleCommand(__CC_unbind_name,   &KeyBinderManager::unbind).defaultValues("");
     53    SetConsoleCommand(__CC_tunbind_name,  &KeyBinderManager::tunbind).defaultValues("");
    4354
    4455    KeyBinderManager::KeyBinderManager()
     
    5162
    5263        // keybind console commands
    53         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyBinderManager::keybind,  this), "keybind" ))
    54             .defaultValues("");
    55         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyBinderManager::tkeybind, this), "tkeybind"))
    56             .defaultValues("");
    57         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyBinderManager::unbind, this), "unbind"))
    58             .defaultValues("");
    59         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyBinderManager::tunbind, this), "tunbind"))
    60             .defaultValues("");
     64        ModifyConsoleCommand(__CC_keybind_name ).setObject(this);
     65        ModifyConsoleCommand(__CC_tkeybind_name).setObject(this);
     66        ModifyConsoleCommand(__CC_unbind_name  ).setObject(this);
     67        ModifyConsoleCommand(__CC_tunbind_name ).setObject(this);
    6168
    6269        // Load default key binder
     
    6976        for (std::map<std::string, KeyBinder*>::const_iterator it = this->binders_.begin(); it != this->binders_.end(); ++it)
    7077            delete it->second;
     78
     79        // Reset console commands
     80        ModifyConsoleCommand(__CC_keybind_name ).setObject(0);
     81        ModifyConsoleCommand(__CC_tkeybind_name).setObject(0);
     82        ModifyConsoleCommand(__CC_unbind_name  ).setObject(0);
     83        ModifyConsoleCommand(__CC_tunbind_name ).setObject(0);
    7184    }
    7285
     
    156169        {
    157170            COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
    158             KeyDetector::getInstance().setCallback(shared_ptr<Functor>(createFunctor(&KeyBinderManager::keybindKeyPressed, this)));
     171            KeyDetector::getInstance().setCallback(createFunctor(&KeyBinderManager::keybindKeyPressed, this));
    159172            InputManager::getInstance().enterState("detector");
    160173            this->command_ = command;
     
    187200        // else: A key was probably pressed within the same tick, ignore it.
    188201    }
     202
     203    void KeyBinderManager::registerKeybindCallback(LuaFunctor* function)
     204    {
     205        this->callbackFunction_ = function;
     206    }
    189207}
  • code/trunk/src/libraries/core/input/KeyBinderManager.h

    r6417 r7284  
    9999        void unbind(const std::string& binding); //tolua_export
    100100        void tunbind(const std::string& binding);
    101         inline void registerKeybindCallback(Functor* function) { this->callbackFunction_.reset(function); } // tolua_export
     101        void registerKeybindCallback(LuaFunctor* function); //tolua_export
    102102
    103103    private:
     
    114114
    115115        // keybind command related
    116         shared_ptr<Functor> callbackFunction_;       //! Function to be called when key was pressed after "keybind" command
     116        SharedPtr<LuaFunctor> callbackFunction_;     //! Function to be called when key was pressed after "keybind" command
    117117        bool bBinding_;                              //! Tells whether a key binding process is active
    118118        bool bTemporary_;                            //! Stores tkeybind/keybind value
  • code/trunk/src/libraries/core/input/KeyDetector.cc

    r6428 r7284  
    2929#include "KeyDetector.h"
    3030
    31 #include "core/ConsoleCommand.h"
     31#include "util/ScopedSingletonManager.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/ScopedSingletonManager.h"
     33#include "core/command/ConsoleCommand.h"
    3434#include "Button.h"
    3535#include "InputManager.h"
     
    3838namespace orxonox
    3939{
    40     std::string KeyDetector::callbackCommand_s = "KeyDetectorKeyPressed";
    4140    ManageScopedSingleton(KeyDetector, ScopeID::Graphics, false);
     41
     42    static const std::string __CC_KeyDetector_callback_name = "KeyDetectorKeyPressed";
     43    DeclareConsoleCommand(__CC_KeyDetector_callback_name, &prototype::void__string).hide();
    4244
    4345    KeyDetector::KeyDetector()
     
    4648        RegisterObject(KeyDetector);
    4749
    48         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&KeyDetector::callback,  this), callbackCommand_s));
     50        ModifyConsoleCommand(__CC_KeyDetector_callback_name).setFunction(&KeyDetector::callback, this);
     51
    4952        this->assignCommands();
    5053
     
    5962        inputState_->setHandler(NULL);
    6063        InputManager::getInstance().destroyState("detector");
     64        ModifyConsoleCommand(__CC_KeyDetector_callback_name).resetFunction();
    6165    }
    6266
     
    6569        // Assign every button/axis the same command, but with its name as argument
    6670        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
    67             it->second->parse(callbackCommand_s + ' ' + it->second->groupName_ + "." + it->second->name_);
     71            it->second->parse(__CC_KeyDetector_callback_name + ' ' + it->second->groupName_ + "." + it->second->name_);
    6872    }
    6973
  • code/trunk/src/libraries/core/input/KeyDetector.h

    r6417 r7284  
    4646        ~KeyDetector();
    4747
    48         void setCallback(const shared_ptr<Functor>& function) { this->callbackFunction_ = function; }
     48        void setCallback(const FunctorPtr& function) { this->callbackFunction_ = function; }
    4949
    5050    private:
     
    5555        void assignCommands();
    5656
    57         shared_ptr<Functor> callbackFunction_;
     57        FunctorPtr callbackFunction_;
    5858        InputState* inputState_;
    59         static std::string callbackCommand_s;
    6059        static KeyDetector* singletonPtr_s;
    6160    };
  • code/trunk/src/libraries/core/input/Mouse.cc

    r5929 r7284  
    3030
    3131#include <ois/OISMouse.h>
    32 #include "core/ConsoleCommand.h"
    3332#include "core/CoreIncludes.h"
     33#include "core/command/ConsoleCommand.h"
    3434#include "InputState.h"
    3535
     
    4141namespace orxonox
    4242{
     43#ifdef ORXONOX_PLATFORM_LINUX
     44    static const std::string __CC_Mouse_name = "Mouse";
     45    static const std::string __CC_grab_name = "grab";
     46    static const std::string __CC_ungrab_name = "ungrab";
     47
     48    SetConsoleCommand(__CC_Mouse_name, __CC_grab_name,   &Mouse::grab);
     49    SetConsoleCommand(__CC_Mouse_name, __CC_ungrab_name, &Mouse::ungrab);
     50#endif
     51
    4352    Mouse::Mouse(unsigned int id, OIS::InputManager* oisInputManager)
    4453        : super(id, oisInputManager)
     
    4857
    4958#ifdef ORXONOX_PLATFORM_LINUX
    50         // Mouse grab console command
    51         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&Mouse::grab, this), "grab"), false);
    52         // Mouse ungrab console command
    53         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&Mouse::ungrab, this), "ungrab"), false);
     59        ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject(this);
     60        ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject(this);
     61#endif
     62    }
     63
     64    Mouse::~Mouse()
     65    {
     66#ifdef ORXONOX_PLATFORM_LINUX
     67        ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject(0);
     68        ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject(0);
    5469#endif
    5570    }
  • code/trunk/src/libraries/core/input/Mouse.h

    r5781 r7284  
    6464        //! Only sets the clipping size. Initialising is done in the base class.
    6565        Mouse(unsigned int id, OIS::InputManager* oisInputManager);
    66         ~Mouse() { }
     66        ~Mouse();
    6767
    6868#ifdef ORXONOX_PLATFORM_LINUX
  • code/trunk/src/libraries/network/Client.cc

    r7163 r7284  
    4545#include "util/Clock.h"
    4646#include "util/Debug.h"
     47#include "util/ScopedSingletonManager.h"
    4748#include "synchronisable/Synchronisable.h"
    4849#include "packet/Chat.h"
     
    5253#include "core/CommandLineParser.h"
    5354#include "core/Game.h"
    54 #include "core/ScopedSingletonManager.h"
    5555
    5656namespace orxonox
     
    107107    return ClientConnection::closeConnection();
    108108  }
    109  
     109
    110110  void Client::setDestination(const std::string& serverAddress, unsigned int port)
    111111  {
  • code/trunk/src/libraries/network/ClientConnection.cc

    r6417 r7284  
    149149  uint32_t ClientConnection::getRTT()
    150150  {
    151     assert(server_);
    152     return server_->roundTripTime;
     151    if (server_)
     152        return server_->roundTripTime;
     153    else
     154        return 0;
    153155  }
    154156
  • code/trunk/src/libraries/network/GamestateManager.cc

    r7163 r7284  
    4747
    4848#include "util/Debug.h"
    49 #include "core/Executor.h"
    5049#include "core/ThreadPool.h"
     50#include "core/command/Executor.h"
    5151#include "ClientInformation.h"
    5252#include "packet/Acknowledgement.h"
  • code/trunk/src/libraries/network/Host.cc

    r7163 r7284  
    3232#include <string>
    3333
    34 #include "core/ConsoleCommand.h"
    3534#include "core/ObjectList.h"
     35#include "core/command/ConsoleCommand.h"
    3636#include "ChatListener.h"
    3737
    3838namespace orxonox {
    3939
    40   SetConsoleCommandShortcut(Host, Chat);
     40  static const std::string __CC_printRTT_name = "printRTT";
     41
     42  SetConsoleCommand("chat", &Host::Chat);
     43  SetConsoleCommand(__CC_printRTT_name, &Host::printRTT);
    4144
    4245  // Host*               Host::instance_=0;
     
    5255  //   assert(instance_==0);
    5356    instances_s.push_back(this);
    54     this->printRTTCC_ = createConsoleCommand( createFunctor(&Host::printRTT, this), "printRTT" );
    55     CommandExecutor::addConsoleCommandShortcut( this->printRTTCC_ );
     57    ModifyConsoleCommand(__CC_printRTT_name).setObject(this);
    5658    this->bIsActive_ = false;
    5759  }
     
    6567    assert( std::find( instances_s.begin(), instances_s.end(), this )!=instances_s.end() );
    6668    instances_s.erase(std::find( instances_s.begin(), instances_s.end(), this ));
    67     if( this->printRTTCC_ )
    68       delete this->printRTTCC_;
     69    ModifyConsoleCommand(__CC_printRTT_name).setObject(0);
    6970  }
    7071
     
    8990  }
    9091
    91   bool Host::Chat(const std::string& message)
     92  void Host::Chat(const std::string& message)
    9293  {
    9394    if(instances_s.size()==0)
     
    9596      for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    9697        it->incomingChat(message, 0);
    97       return true;
     98//      return true;
    9899    }
    99100    else
     
    108109        }
    109110      }
    110       return result;
     111//      return result;
    111112    }
    112113  }
     
    139140    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    140141      it->incomingChat(message, playerID);
    141    
     142
    142143    bool result = true;
    143144    for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
  • code/trunk/src/libraries/network/Host.h

    r7163 r7284  
    7979    static void setShipID(unsigned int id){ shipID_s = id; }
    8080    static bool isServer();
    81     static bool Chat(const std::string& message);
     81    static void Chat(const std::string& message);
    8282    static bool Broadcast(const std::string& message);
    8383    static bool incomingChat(const std::string& message, unsigned int playerID);
     
    8585    bool isActive(){ return bIsActive_; }
    8686  private:
    87     ConsoleCommand* printRTTCC_;
    8887    static uint32_t clientID_s;
    8988    static uint32_t shipID_s;
  • code/trunk/src/libraries/network/LANDiscovery.cc

    r7163 r7284  
    3232#include <cstring>
    3333
     34#include "util/ScopedSingletonManager.h"
    3435#include "core/CoreIncludes.h"
    35 #include "core/ScopedSingletonManager.h"
    3636
    3737
    3838namespace orxonox
    39 { 
     39{
    4040  ManageScopedSingleton(LANDiscovery, ScopeID::Root, true);
    41  
     41
    4242  LANDiscovery::LANDiscovery()
    4343  {
     
    4949    enet_host_destroy(this->host_);
    5050  }
    51  
     51
    5252  void LANDiscovery::discover()
    5353  {
     
    5656    enet_address_set_host(&address, "255.255.255.255");
    5757    address.port = LAN_DISCOVERY_PORT;
    58    
     58
    5959    ENetPeer* peer;
    6060    peer = enet_host_connect(this->host_, &address, 0);
    61    
     61
    6262    ENetEvent event;
    6363    while( enet_host_service(this->host_, &event, 1000 ) )
     
    9393    }
    9494  }
    95  
     95
    9696  std::string LANDiscovery::getServerListItemName(unsigned int index)
    9797  {
     
    101101      return this->servers_[index].getServerName();
    102102  }
    103  
     103
    104104  std::string LANDiscovery::getServerListItemIP(unsigned int index)
    105105  {
     
    109109      return this->servers_[index].getServerIP();
    110110  }
    111  
    112  
     111
     112
    113113} // namespace orxonox
  • code/trunk/src/libraries/network/NetworkFunction.cc

    r6417 r7284  
    6868
    6969
    70   NetworkFunctionStatic::NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p):
     70  NetworkFunctionStatic::NetworkFunctionStatic(const FunctorStaticPtr& functor, const std::string& name, const NetworkFunctionPointer& p):
    7171    NetworkFunctionBase(name)
    7272  {
     
    7676    NetworkFunctionStatic::getFunctorMap()[p] = this;
    7777    NetworkFunctionStatic::getIdMap()[ this->getNetworkID() ] = this;
    78   }
    79 
    80   NetworkFunctionStatic::~NetworkFunctionStatic()
    81   {
    82     delete this->functor_;
    8378  }
    8479
  • code/trunk/src/libraries/network/NetworkFunction.h

    r6417 r7284  
    3939#include <boost/static_assert.hpp>
    4040
    41 #include "core/Functor.h"
    4241#include "core/Identifier.h"
     42#include "core/command/Functor.h"
    4343#include "FunctionCallManager.h"
    4444#include "synchronisable/Synchronisable.h"
     
    102102class _NetworkExport NetworkFunctionStatic: public NetworkFunctionBase {
    103103  public:
    104     NetworkFunctionStatic(FunctorStatic* functor, const std::string& name, const NetworkFunctionPointer& p);
    105     ~NetworkFunctionStatic();
     104    NetworkFunctionStatic(const FunctorStaticPtr& functor, const std::string& name, const NetworkFunctionPointer& p);
    106105
    107106    inline void call(){ (*this->functor_)(); }
     
    124123    static std::map<NetworkFunctionPointer, NetworkFunctionStatic*>& getFunctorMap();
    125124    static std::map<uint32_t, NetworkFunctionStatic*>& getIdMap();
    126     FunctorStatic* functor_;
     125    FunctorStaticPtr functor_;
    127126
    128127};
     
    155154template <class T> class NetworkMemberFunction: public NetworkMemberFunctionBase {
    156155  public:
    157     NetworkMemberFunction(FunctorMember<T>* functor, const std::string& name, const NetworkFunctionPointer& p);
    158     ~NetworkMemberFunction();
     156    NetworkMemberFunction(const FunctorMemberPtr<T>& functor, const std::string& name, const NetworkFunctionPointer& p);
    159157
    160158    inline void call(uint32_t objectID)
     
    190188
    191189  private:
    192     FunctorMember<T>* functor_;
    193 };
    194 
    195 template <class T> NetworkMemberFunction<T>::NetworkMemberFunction(FunctorMember<T>* functor, const std::string& name, const NetworkFunctionPointer& p):
     190    FunctorMemberPtr<T> functor_;
     191};
     192
     193template <class T> NetworkMemberFunction<T>::NetworkMemberFunction(const FunctorMemberPtr<T>& functor, const std::string& name, const NetworkFunctionPointer& p):
    196194    NetworkMemberFunctionBase(name, p), functor_(functor)
    197195{
    198 }
    199 template <class T> NetworkMemberFunction<T>::~NetworkMemberFunction()
    200 {
    201   delete this->functor_;
    202196}
    203197
  • code/trunk/src/libraries/network/Server.cc

    r7163 r7284  
    4949#include "util/Debug.h"
    5050#include "core/ObjectList.h"
    51 #include "core/Executor.h"
     51#include "core/command/Executor.h"
    5252#include "packet/Chat.h"
    5353#include "packet/ClassID.h"
  • code/trunk/src/libraries/network/synchronisable/Serialise.h

    r7266 r7284  
    4242#include "core/CorePrereqs.h"
    4343#include "core/CoreIncludes.h"
    44 #include "core/SmartPtr.h"
     44#include "core/BaseObject.h" // remove this if circular dependencies in BaseObject/SmartPtr are fixed
     45//#include "core/SmartPtr.h"
    4546
    4647namespace orxonox{
    47    
     48
    4849    // These functions implement loading / saving / etc. for pointer types
    49    
     50
    5051    /** @brief returns the size of the objectID needed to synchronise the pointer */
    5152    template <class T> inline uint32_t returnSize( T*& variable )
     
    5354      return sizeof(uint32_t);
    5455    }
    55    
     56
    5657    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    5758    template <class T> inline void loadAndIncrease( T*& variable, uint8_t*& mem )
     
    6061        mem += returnSize( variable );
    6162    }
    62    
     63
    6364    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    6465    template <class T> inline void saveAndIncrease( T*& variable, uint8_t*& mem )
     
    7071        mem += returnSize( variable );
    7172    }
    72    
     73
    7374    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    7475    template <class T> inline  bool checkEquality( T*& variable, uint8_t* mem )
     
    7980            return variable == variable->getSynchronisable(*(uint32_t*)(mem));
    8081    }
    81    
     82
    8283    // These functions implement loading / saving / etc. for SmartPtr<T>
    83    
     84
    8485    /** @brief returns the size of the objectID needed to synchronise the pointer */
    8586    template <class T> inline uint32_t returnSize( const SmartPtr<T>& variable )
     
    8788        return sizeof(uint32_t);
    8889    }
    89    
     90
    9091    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    9192    template <class T> inline void loadAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     
    9596        mem += returnSize( variable );
    9697    }
    97    
     98
    9899    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    99100    template <class T> inline void saveAndIncrease( const SmartPtr<T>& variable, uint8_t*& mem )
     
    105106        mem += returnSize( variable );
    106107    }
    107    
     108
    108109    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    109110    template <class T> inline  bool checkEquality( const SmartPtr<T>& variable, uint8_t* mem )
     
    114115            return *(uint32_t*)(mem) == OBJECTID_UNKNOWN;
    115116    }
    116    
     117
    117118    // These functions implement loading / saving / etc. for WeakPtr<T>
    118    
     119
    119120    /** @brief returns the size of the objectID needed to synchronise the pointer */
    120121    template <class T> inline uint32_t returnSize( const WeakPtr<T>& variable )
     
    122123        return sizeof(uint32_t);
    123124    }
    124    
     125
    125126    /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */
    126127    template <class T> inline void loadAndIncrease( const WeakPtr<T>& variable, uint8_t*& mem )
     
    130131        mem += returnSize( variable );
    131132    }
    132    
     133
    133134    /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */
    134135    template <class T> inline void saveAndIncrease( const WeakPtr<T>& variable, uint8_t*& mem )
     
    140141        mem += returnSize( variable );
    141142    }
    142    
     143
    143144    /** @brief checks whether the objectID of the variable is the same as in the bytestream */
    144145    template <class T> inline  bool checkEquality( const WeakPtr<T>& variable, uint8_t* mem )
  • code/trunk/src/libraries/tools/Timer.cc

    r6417 r7284  
    3333#include "util/Clock.h"
    3434#include "core/CoreIncludes.h"
    35 #include "core/ConsoleCommand.h"
    36 #include "core/CommandExecutor.h"
    37 #include "core/Functor.h"
     35#include "core/command/ConsoleCommand.h"
     36#include "core/command/CommandExecutor.h"
     37#include "core/command/Functor.h"
    3838
    3939namespace orxonox
    4040{
    41     SetConsoleCommandShortcutExtern(delay);
    42     SetConsoleCommandShortcutExtern(killdelays);
     41    SetConsoleCommand("delay", &delay).argumentCompleter(1, autocompletion::command());
     42    SetConsoleCommand("killdelays", &killdelays);
    4343
    4444    static std::set<Timer*> delaytimerset;
     
    5454        delaytimerset.insert(delaytimer);
    5555
    56         ExecutorStatic* delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
     56        const ExecutorStaticPtr& delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
    5757        delayexecutor->setDefaultValues(delaytimer, command);
    5858        delaytimer->setTimer(delay, false, delayexecutor);
     
    9797        @param exeuctor A executor of the function to call
    9898    */
    99     Timer::Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall)
     99    Timer::Timer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall)
    100100    {
    101101        this->init();
     
    103103
    104104        this->setTimer(interval, bLoop, executor, bKillAfterCall);
    105     }
    106 
    107     /**
    108         @brief Deletes the executor.
    109     */
    110     Timer::~Timer()
    111     {
    112         this->deleteExecutor();
    113105    }
    114106
     
    138130        if (temp)
    139131            this->destroy();
    140     }
    141 
    142     /**
    143         @brief Deletes the executor.
    144     */
    145     void Timer::deleteExecutor()
    146     {
    147       if (this->executor_)
    148           delete this->executor_;
    149132    }
    150133
  • code/trunk/src/libraries/tools/Timer.h

    r6417 r7284  
    4444
    4545    source.cc:
    46         include "core/Executor.h"
     46        #include "core/command/Executor.h"
    4747
    4848        ClassName::ClassName()
     
    6363#include "tools/ToolsPrereqs.h"
    6464
    65 #include "core/Executor.h"
    6665#include "core/OrxonoxClass.h"
     66#include "core/command/Executor.h"
    6767#include "tools/interfaces/TimeFactorListener.h"
    6868
     
    7878        public:
    7979            Timer();
    80             ~Timer();
    8180
    82             Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false);
     81            Timer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false);
    8382
    8483            /**
     
    8988                @param executor A executor of the function to call
    9089            */
    91             void setTimer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false)
     90            void setTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false)
    9291            {
    93                 this->deleteExecutor();
    94 
    9592                this->setInterval(interval);
    9693                this->bLoop_ = bLoop;
     
    103100
    104101            void run();
    105             void deleteExecutor();
    106102
    107103            /** @brief Starts the Timer: Function-call after 'interval' seconds. */
     
    141137            void init();
    142138
    143             Executor* executor_;  //!< The executor of the function that should be called when the time expires
     139            ExecutorPtr executor_;  //!< The executor of the function that should be called when the time expires
    144140
    145             long long interval_;  //!< The time-interval in micro seconds
    146             bool bLoop_;          //!< If true, the function gets called every 'interval' seconds
    147             bool bActive_;        //!< If true, the Timer ticks and calls the function if the time's up
    148             bool bKillAfterCall_; //!< If true the timer gets deleted after it called the function
     141            long long interval_;    //!< The time-interval in micro seconds
     142            bool bLoop_;            //!< If true, the function gets called every 'interval' seconds
     143            bool bActive_;          //!< If true, the Timer ticks and calls the function if the time's up
     144            bool bKillAfterCall_;   //!< If true the timer gets deleted after it called the function
    149145
    150             long long time_;      //!< Internal variable, counting the time till the next function-call
     146            long long time_;        //!< Internal variable, counting the time till the next function-call
    151147    };
    152148}
  • code/trunk/src/libraries/util/CMakeLists.txt

    r7226 r7284  
    3131  CRC32.cc
    3232  OutputHandler.cc
     33  ScopedSingletonManager.cc
     34  SharedPtr.cc
    3335  SignalHandler.cc
    3436  Sleep.cc
     37  SmallObjectAllocator.cc
    3538  SubString.cc
    3639COMPILATION_END
  • code/trunk/src/libraries/util/Convert.h

    r7266 r7284  
    109109        }
    110110    };
     111
     112    ////////////
     113    // upcast //
     114    ////////////
     115    namespace detail
     116    {
     117        // perform a static cast if ToType is a base of FromType
     118        template<class ToType, class FromType>
     119        FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<true>)
     120        {
     121            return static_cast<ToType>(input);
     122        }
     123
     124        // return zero if ToType is not a base of FromType
     125        template<class ToType, class FromType>
     126        FORCEINLINE ToType upcast(FromType input, Loki::Int2Type<false>)
     127        {
     128            return 0;
     129        }
     130    }
     131
     132    // performs an upcast if ToType is a base of FromType, returns zero otherwise
     133    template <class ToType, class FromType>
     134    FORCEINLINE ToType upcast(FromType input)
     135    {
     136        enum { probe = ImplicitConversion<FromType, ToType>::exists };
     137        return detail::upcast<ToType, FromType>(input, Loki::Int2Type<probe>());
     138    }
    111139}
    112140
  • code/trunk/src/libraries/util/Math.cc

    r7184 r7284  
    234234    bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
    235235    {
    236         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    237         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     236        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     237        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    238238            opening_parenthesis = 0;
    239239        else
     
    257257    bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
    258258    {
    259         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    260         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     259        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     260        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    261261            opening_parenthesis = 0;
    262262        else
     
    282282    bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
    283283    {
    284         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    285         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     284        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     285        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    286286            opening_parenthesis = 0;
    287287        else
     
    309309    bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
    310310    {
    311         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    312         if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     311        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     312        if ((opening_parenthesis = input.find('{')) == std::string::npos)
     313            opening_parenthesis = 0;
     314        else
     315            opening_parenthesis++;
    313316
    314317        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
     
    332335    bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
    333336    {
    334         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    335         if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     337        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     338        if ((opening_parenthesis = input.find('{')) == std::string::npos)
     339            opening_parenthesis = 0;
     340        else
     341            opening_parenthesis++;
    336342
    337343        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
  • code/trunk/src/libraries/util/MultiType.h

    r7268 r7284  
    7777#include <OgreColourValue.h>
    7878#include <loki/TypeTraits.h>
     79#include "mbool.h"
    7980
    8081namespace orxonox
     
    265266            inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
    266267            inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }           /** @brief Constructor: Assigns the given value and sets the type. */
     268            inline MultiType(const orxonox::mbool& value)       : value_(0) { this->assignValue((bool)value); }     /** @brief Constructor: Assigns the given mbool and converts it to bool. */
    267269            inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); } /** @brief Constructor: Converts the char array to a std::string, assigns the value and sets the type. */
    268270            inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }              /** @brief Copyconstructor: Assigns value and type of the other MultiType. */
     
    318320            inline void                       copy(const MultiType& other)    { if (this == &other) { return; } if (this->value_) { delete this->value_; } this->value_ = (other.value_) ? other.value_->clone() : 0; }
    319321
    320             template <typename T> inline bool convert()                       { return this->setValue<T>((T)(*this));  } /** @brief Converts the current value to type T. */
     322            template <typename T> inline bool convert()                       { return this->setValue<T>((typename Loki::TypeTraits<T>::UnqualifiedReferredType)(*this));  } /** @brief Converts the current value to type T. */
    321323            inline bool                       convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
    322324            bool                              convert(MT_Type::Value type);
     
    350352
    351353            /** @brief Checks whether the value is a default one. */
    352             bool                              hasDefaultValue()         const { return this->value_->hasDefaultValue(); }
     354            bool                              hasDefaultValue() const { return this->value_->hasDefaultValue(); }
     355
     356            /** @brief Checks if the MT contains no value. */
     357            bool                              null() const { return (!this->value_); }
    353358
    354359            operator char()                  const;
     
    487492    template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_Type::Degree);           } /** @brief Returns true if the current type equals the given type. */
    488493
     494    template <> inline bool MultiType::convert<void>()                 { this->reset(); return true; } /** @brief Deletes the content, type becomes MT_Type::Null. */
     495
    489496    // Specialization to avoid ambiguities with the conversion operator
    490497    template <> inline bool MultiType::convert<std::string>()          { return this->setValue<std::string>         (this->operator std::string());          } /** @brief Converts the current value to the given type. */
  • code/trunk/src/libraries/util/OutputHandler.h

    r6105 r7284  
    104104
    105105            //! Writes to all output devices
    106             static inline const std::string& log(const std::string& text)
    107                 { OutputHandler::getOutStream(0).output(text) << std::endl; return text; }
     106            static inline void log(const std::string& text)
     107                { OutputHandler::getOutStream(0).output(text) << std::endl; }
    108108
    109109            //! Writes an error message to the output
    110             static inline const std::string& error(const std::string& text)
    111                 { OutputHandler::getOutStream(1).output(text) << std::endl; return text; }
     110            static inline void error(const std::string& text)
     111                { OutputHandler::getOutStream(1).output(text) << std::endl; }
    112112
    113113            //! Writes a warning message to the output
    114             static inline const std::string& warning(const std::string& text)
    115                 { OutputHandler::getOutStream(2).output(text) << std::endl; return text; }
     114            static inline void warning(const std::string& text)
     115                { OutputHandler::getOutStream(2).output(text) << std::endl; }
    116116
    117117            //! Writes an informational message to the output
    118             static inline const std::string& info(const std::string& text)
    119                 { OutputHandler::getOutStream(3).output(text) << std::endl; return text; }
     118            static inline void info(const std::string& text)
     119                { OutputHandler::getOutStream(3).output(text) << std::endl; }
    120120
    121121            //! Writes a debug message to the output
    122             static inline const std::string& debug(const std::string& text)
    123                 { OutputHandler::getOutStream(4).output(text) << std::endl; return text; }
     122            static inline void debug(const std::string& text)
     123                { OutputHandler::getOutStream(4).output(text) << std::endl; }
    124124
    125125            //! Registers an object that receives output via a provided std::ostream
  • code/trunk/src/libraries/util/StringUtils.cc

    r6424 r7284  
    3535
    3636#include <cctype>
     37#include <boost/scoped_array.hpp>
    3738#include "Convert.h"
    3839#include "Math.h"
     
    514515        @return Number of replacements
    515516    */
    516     _UtilExport size_t replaceCharacters(std::string& str, char target, char replacement)
     517    size_t replaceCharacters(std::string& str, char target, char replacement)
    517518    {
    518519        size_t j = 0;
     
    527528        return j;
    528529    }
     530
     531    /**
     532        @brief Calculates the Levenshtein distance between two strings.
     533
     534        The Levenshtein distance is defined by the number of transformations needed to convert str1
     535        into str2. Possible transformations are substituted, added, or removed characters.
     536    */
     537    unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2)
     538    {
     539        size_t cols = str1.size() + 1;
     540        size_t rows = str2.size() + 1;
     541        boost::scoped_array<int> matrix(new int[rows * cols]);
     542
     543        for (size_t r = 0; r < rows; ++r)
     544            for (size_t c = 0; c < cols; ++c)
     545                matrix[r*cols + c] = 0;
     546
     547        for (size_t i = 1; i < cols; ++i)
     548            matrix[0*cols + i] = i;
     549        for (size_t i = 1; i < rows; ++i)
     550            matrix[i*cols + 0] = i;
     551
     552        for (size_t r = 1; r < rows; ++r)
     553            for (size_t c = 1; c < cols; ++c)
     554                matrix[r*cols + c] = (str1[c-1] != str2[r-1]);
     555
     556        for (size_t r = 1; r < rows; ++r)
     557            for (size_t c = 1; c < cols; ++c)
     558                matrix[r*cols + c] = std::min(std::min(matrix[(r-1)*cols + c] + 1,
     559                                                       matrix[r*cols + c-1] + 1),
     560                                              matrix[(r-1)*cols + c-1] + (str1[c-1] != str2[r-1]));
     561
     562        return matrix[(rows-1)*cols + cols-1];
     563    }
    529564}
  • code/trunk/src/libraries/util/StringUtils.h

    r5738 r7284  
    4343    _UtilExport std::string getUniqueNumberString();
    4444
    45     _UtilExport void        strip(std::string* str);
    46     _UtilExport std::string getStripped(const std::string& str);
     45    _UtilExport void         strip(std::string* str);
     46    _UtilExport std::string  getStripped(const std::string& str);
    4747
    48     _UtilExport std::string removeTrailingWhitespaces(const std::string& str);
     48    _UtilExport std::string  removeTrailingWhitespaces(const std::string& str);
    4949
    50     _UtilExport size_t      getNextQuote(const std::string& str, size_t start);
    51     _UtilExport bool        isBetweenQuotes(const std::string& str, size_t pos);
     50    _UtilExport size_t       getNextQuote(const std::string& str, size_t start);
     51    _UtilExport bool         isBetweenQuotes(const std::string& str, size_t pos);
    5252
    53     _UtilExport bool        hasStringBetweenQuotes(const std::string& str);
    54     _UtilExport std::string getStringBetweenQuotes(const std::string& str);
     53    _UtilExport bool         hasStringBetweenQuotes(const std::string& str);
     54    _UtilExport std::string  getStringBetweenQuotes(const std::string& str);
    5555
    56     _UtilExport std::string stripEnclosingQuotes(const std::string& str);
    57     _UtilExport std::string stripEnclosingBraces(const std::string& str);
     56    _UtilExport std::string  stripEnclosingQuotes(const std::string& str);
     57    _UtilExport std::string  stripEnclosingBraces(const std::string& str);
    5858
    59     _UtilExport bool        isEmpty(const std::string& str);
    60     _UtilExport bool        isComment(const std::string& str);
    61     _UtilExport bool        isNumeric(const std::string& str);
     59    _UtilExport bool         isEmpty(const std::string& str);
     60    _UtilExport bool         isComment(const std::string& str);
     61    _UtilExport bool         isNumeric(const std::string& str);
    6262
    63     _UtilExport std::string addSlashes(const std::string& str);
    64     _UtilExport std::string removeSlashes(const std::string& str);
     63    _UtilExport std::string  addSlashes(const std::string& str);
     64    _UtilExport std::string  removeSlashes(const std::string& str);
    6565
    66     _UtilExport void        lowercase(std::string* str);
    67     _UtilExport std::string getLowercase(const std::string& str);
     66    _UtilExport void         lowercase(std::string* str);
     67    _UtilExport std::string  getLowercase(const std::string& str);
    6868
    69     _UtilExport void        uppercase(std::string* str);
    70     _UtilExport std::string getUppercase(const std::string& str);
     69    _UtilExport void         uppercase(std::string* str);
     70    _UtilExport std::string  getUppercase(const std::string& str);
    7171
    72     _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
    73     _UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
     72    _UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2);
     73    _UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2, size_t len);
    7474
    75     _UtilExport bool        hasComment(const std::string& str);
    76     _UtilExport std::string getComment(const std::string& str);
    77     _UtilExport size_t      getCommentPosition(const std::string& str);
    78     _UtilExport size_t      getNextCommentPosition(const std::string& str, size_t start = 0);
     75    _UtilExport bool         hasComment(const std::string& str);
     76    _UtilExport std::string  getComment(const std::string& str);
     77    _UtilExport size_t       getCommentPosition(const std::string& str);
     78    _UtilExport size_t       getNextCommentPosition(const std::string& str, size_t start = 0);
    7979
    80     _UtilExport size_t      replaceCharacters(std::string& str, char target, char replacement);
     80    _UtilExport size_t       replaceCharacters(std::string& str, char target, char replacement);
     81
     82    _UtilExport unsigned int getLevenshteinDistance(const std::string& str1, const std::string& str2);
    8183}
    8284
  • code/trunk/src/libraries/util/SubString.cc

    r7165 r7284  
    309309     * @param line the inputLine to split
    310310     * @param delimiters a String of Delimiters (here the input will be splitted)
    311      * @param delimiterNeighbours Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter.
     311     * @param delimiterNeighbours Neighbours to the Delimiter, that will be removed if they are to the left or the right of a Delimiter.
    312312     * @param emptyEntries: if empty Strings are added to the List of Strings.
    313313     * @param escape_char: Escape carater (escapes splitters)
  • code/trunk/src/libraries/util/SubString.h

    r5738 r7284  
    8181            SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
    8282            SL_COMMENT,           //!< In Comment mode.
    83             SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
     83            SL_PARENTHESES,       //!< Between parentheses (usually '{' and '}')
    8484            SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
    8585        } SPLIT_LINE_STATE;
     
    9292                  const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
    9393                  char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
    94                   char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
     94                  char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
    9595        SubString(unsigned int argc, const char** argv);
    9696        /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
     
    116116                           const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
    117117                           char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
    118                            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
     118                           char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
    119119        std::string join(const std::string& delimiter = " ") const;
    120120        ////////////////////////////////////////
     
    155155                                          char safemode_char = '"',
    156156                                          bool removeSafemodeChar = true,
    157                                           char openparenthesis_char = '(',
    158                                           char closeparenthesis_char = ')',
     157                                          char openparenthesis_char = '{',
     158                                          char closeparenthesis_char = '}',
    159159                                          bool removeParenthesisChars = true,
    160160                                          char comment_char = '\0',
  • code/trunk/src/modules/designtools/ScreenshotManager.cc

    r7163 r7284  
    99#include <OgreRoot.h>
    1010
     11#include "util/ScopedSingletonManager.h"
    1112#include "core/GraphicsManager.h"
    1213#include "core/PathConfig.h"
    13 #include "core/ScopedSingletonManager.h"
    14 #include "core/ConsoleCommand.h"
     14#include "core/command/ConsoleCommand.h"
    1515
    1616#include "CameraManager.h"
     
    2020{
    2121    ManageScopedSingleton(ScreenshotManager, ScopeID::Graphics, false);
    22     SetConsoleCommandAlias(ScreenshotManager, makeScreenshot_s, "printScreenHD", true);
     22    SetConsoleCommand("printScreenHD", &ScreenshotManager::makeScreenshot_s);
    2323
    2424    ScreenshotManager::ScreenshotManager()
  • code/trunk/src/modules/designtools/SkyboxGenerator.cc

    r7163 r7284  
    3434#include <OgreCamera.h>
    3535
    36 #include "core/ConsoleCommand.h"
     36#include "util/ScopedSingletonManager.h"
    3737#include "core/CoreIncludes.h"
    3838#include "core/ConfigValueIncludes.h"
    39 #include "core/ScopedSingletonManager.h"
     39#include "core/GraphicsManager.h"
     40#include "core/command/ConsoleCommand.h"
     41#include "core/command/CommandExecutor.h"
    4042#include "controllers/HumanController.h"
    4143#include "worldentities/CameraPosition.h"
    4244#include "worldentities/ControllableEntity.h"
    43 #include "core/GraphicsManager.h"
    44 #include "core/CommandExecutor.h"
    4545#include "graphics/Camera.h"
    4646
     
    5050{
    5151
    52     SetConsoleCommand(SkyboxGenerator, createSkybox, true);
     52    SetConsoleCommand("SkyboxGenerator", "createSkybox", &SkyboxGenerator::createSkybox).addShortcut();
    5353
    5454    ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false);
     
    7979            if(!this->captionsRemoved_)
    8080            {
    81                 CommandExecutor::execute("setGametypeStatus false");
     81                CommandExecutor::execute("GametypeStatus displayCaption false");
    8282                this->captionsRemoved_ = true;
    8383                return;
     
    145145                takeScreenshot_ = false;
    146146                CommandExecutor::execute("pause");
    147                 CommandExecutor::execute("setGametypeStatus true");
     147                CommandExecutor::execute("GametypeStatus displayCaption true");
    148148                this->captionsRemoved_ = false;
    149149            }
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r7163 r7284  
    3636#include <set>
    3737
     38#include "util/ScopedSingletonManager.h"
    3839#include "core/CoreIncludes.h"
    39 #include "core/ScopedSingletonManager.h"
    4040#include "Notification.h"
    4141#include "interfaces/NotificationListener.h"
  • code/trunk/src/modules/objects/triggers/Trigger.cc

    r6417 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConsoleCommand.h"
    3332#include "core/GameMode.h"
    3433#include "core/XMLPort.h"
     34#include "core/command/ConsoleCommand.h"
    3535#include "Scene.h"
    3636
     
    3838{
    3939
    40   SetConsoleCommand(Trigger, debugFlares, false).defaultValues(false);
     40  SetConsoleCommand("Trigger", "debugFlares", &Trigger::debugFlares).defaultValues(false);
    4141
    4242  CreateFactory(Trigger);
  • code/trunk/src/modules/overlays/OverlaysPrecompiledHeaders.h

    r5781 r7284  
    5858///////////////////////////////////////////
    5959
    60 #include "core/Executor.h"     // 13
     60#include "core/command/Executor.h"     // 13
    6161//#include "network/synchronisable/Synchronisable.h" // 13
    6262//#include "core/XMLPort.h"    // 9
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r6417 r7284  
    3636#include "core/CoreIncludes.h"
    3737#include "core/ConfigValueIncludes.h"
    38 #include "core/Executor.h"
     38#include "core/command/Executor.h"
    3939
    4040#include "tools/Timer.h"
     
    9191        Timer* timer = new Timer();
    9292        this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor
    93         Executor* executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
     93        const ExecutorPtr& executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
    9494        executor->setDefaultValues(timer);
    9595        timer->setTimer(this->displayTime_, false, executor, true);
  • code/trunk/src/modules/overlays/hud/GametypeStatus.cc

    r7163 r7284  
    3030
    3131#include "util/Convert.h"
    32 #include "core/ConsoleCommand.h"
    3332#include "core/CoreIncludes.h"
     33#include "core/command/ConsoleCommand.h"
    3434#include "infos/GametypeInfo.h"
    3535#include "infos/PlayerInfo.h"
     
    4141    CreateFactory(GametypeStatus);
    4242
    43     /*static*/ bool GametypeStatus::noCaption_s = false;
    44     SetConsoleCommand(GametypeStatus, setGametypeStatus, true);
     43    static const std::string __CC_GametypeStatus_name = "GametypeStatus";
     44    static const std::string __CC_displayCaption_name = "displayCaption";
     45
     46    SetConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name, &GametypeStatus::setDisplayCaption);
    4547
    4648    GametypeStatus::GametypeStatus(BaseObject* creator) : OverlayText(creator)
     
    4951
    5052        this->owner_ = 0;
     53        this->bNoCaption_ = false;
     54
     55        ModifyConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name).setObject(this);
    5156    }
    5257
    5358    GametypeStatus::~GametypeStatus()
    5459    {
     60        ModifyConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name).setObject(0);
    5561    }
    5662
     
    6470            ControllableEntity* ce = this->owner_->getControllableEntity();
    6571
    66             if(GametypeStatus::noCaption_s) // No captions are displayed.
     72            if (this->bNoCaption_) // No captions are displayed.
    6773            {
    6874                this->setCaption("");
     
    105111        If true captions are displayed, if false, not.
    106112    */
    107     /*static*/ void GametypeStatus::setGametypeStatus(bool bValue)
     113    void GametypeStatus::setDisplayCaption(bool bValue)
    108114    {
    109         GametypeStatus::noCaption_s = !bValue;
     115        this->bNoCaption_ = !bValue;
    110116    }
    111117
  • code/trunk/src/modules/overlays/hud/GametypeStatus.h

    r7163 r7284  
    4646            virtual void changedOwner();
    4747
    48             static void setGametypeStatus(bool bValue); //!< Toggles whether the gametype status is displayed.
     48            void setDisplayCaption(bool bValue); //!< Toggles whether the gametype status is displayed.
    4949
    5050        private:
    5151            PlayerInfo* owner_;
    52             static bool noCaption_s;
     52            bool bNoCaption_;
    5353
    5454    };
  • code/trunk/src/modules/pickup/PickupManager.cc

    r7209 r7284  
    3434#include "PickupManager.h"
    3535
     36#include "util/Convert.h"
     37#include "util/ScopedSingletonManager.h"
    3638#include "core/CoreIncludes.h"
    3739#include "core/LuaState.h"
    3840#include "core/GUIManager.h"
    39 #include "core/ScopedSingletonManager.h"
    4041#include "core/Identifier.h"
    41 #include "util/Convert.h"
    4242#include "interfaces/PickupCarrier.h"
    4343#include "infos/PlayerInfo.h"
  • code/trunk/src/modules/pong/Pong.cc

    r6417 r7284  
    3131#include "core/CoreIncludes.h"
    3232#include "core/EventIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434#include "PongCenterpoint.h"
    3535#include "PongBall.h"
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r7163 r7284  
    3737
    3838#include "util/Exception.h"
     39#include "util/ScopedSingletonManager.h"
    3940#include "core/CoreIncludes.h"
    4041#include "core/GUIManager.h"
    41 #include "core/ConsoleCommand.h"
    4242#include "core/LuaState.h"
    43 #include "core/ScopedSingletonManager.h"
     43#include "core/command/ConsoleCommand.h"
    4444#include "infos/PlayerInfo.h"
    4545#include "overlays/GUIOverlay.h"
  • code/trunk/src/modules/questsystem/QuestsystemPrecompiledHeaders.h

    r5929 r7284  
    6565///////////////////////////////////////////
    6666
    67 #include "core/Executor.h"     // 15
     67#include "core/command/Executor.h"     // 15
    6868//#include "core/XMLPort.h"    // 14
    6969
  • code/trunk/src/modules/weapons/MuzzleFlash.cc

    r5929 r7284  
    3131
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434
    3535namespace orxonox
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r6540 r7284  
    3131#include "core/CoreIncludes.h"
    3232#include "core/ConfigValueIncludes.h"
    33 #include "core/Executor.h"
    3433#include "core/GameMode.h"
     34#include "core/command/Executor.h"
    3535#include "objects/collisionshapes/SphereCollisionShape.h"
    3636#include "worldentities/pawns/Pawn.h"
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r6732 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/XMLPort.h"
     33#include "core/command/Executor.h"
    3434#include "graphics/Model.h"
    3535
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r6732 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/XMLPort.h"
     33#include "core/command/Executor.h"
    3434#include "graphics/Model.h"
    3535
  • code/trunk/src/orxonox/CameraManager.cc

    r6417 r7284  
    3434
    3535#include "util/StringUtils.h"
     36#include "util/ScopedSingletonManager.h"
    3637#include "core/GameMode.h"
    3738#include "core/GraphicsManager.h"
    3839#include "core/GUIManager.h"
    3940#include "core/ObjectList.h"
    40 #include "core/ScopedSingletonManager.h"
    4141#include "tools/Shader.h"
    4242#include "graphics/Camera.h"
  • code/trunk/src/orxonox/ChatHistory.cc

    r7163 r7284  
    2828
    2929#include "ChatHistory.h"
    30 #include <core/ScopedSingletonManager.h>
     30#include "util/ScopedSingletonManager.h"
    3131
    3232#ifndef CHATTEST
  • code/trunk/src/orxonox/ChatInputHandler.cc

    r7183 r7284  
    2828
    2929#include "ChatInputHandler.h"
    30 #include <core/ScopedSingletonManager.h>
    31 #include "core/ConsoleCommand.h"
     30#include "util/ScopedSingletonManager.h"
    3231#include "core/CoreIncludes.h"
    3332#include "core/GUIManager.h"
    3433#include "core/CorePrereqs.h"
     34#include "core/command/ConsoleCommand.h"
    3535#include <CEGUIWindow.h>
    3636#include <elements/CEGUIListbox.h>
     
    4646
    4747  /* add commands to console */
    48   SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
    49     true );
    50   SetConsoleCommandAlias( ChatInputHandler, activate_small_static,
    51     "startchat_small", true );
     48  SetConsoleCommand( "startchat", &ChatInputHandler::activate_static );
     49  SetConsoleCommand( "startchat_small", &ChatInputHandler::activate_small_static );
    5250
    5351  /* constructor */
  • code/trunk/src/orxonox/LevelManager.cc

    r7163 r7284  
    3131#include <map>
    3232
     33#include "util/ScopedSingletonManager.h"
    3334#include "core/CommandLineParser.h"
    3435#include "core/ConfigValueIncludes.h"
     
    3637#include "core/Loader.h"
    3738#include "core/Resource.h"
    38 #include "core/ScopedSingletonManager.h"
    3939#include "PlayerManager.h"
    4040#include "Level.h"
  • code/trunk/src/orxonox/MoodManager.cc

    r7163 r7284  
    2929#include "MoodManager.h"
    3030
     31#include "util/ScopedSingletonManager.h"
    3132#include "core/ConfigValueIncludes.h"
    3233#include "core/CoreIncludes.h"
    33 #include "core/ScopedSingletonManager.h"
    3434#include "core/Resource.h"
    3535
     
    4848        // Need to use a variable to store old data because ResetConfigValues() doesn't seem to work.
    4949        oldMood_ = MoodManager::defaultMood_;
    50        
     50
    5151        // Checking for the existence of the folder for the default mood
    5252        const std::string& path = "ambient/" + MoodManager::defaultMood_ + "/.";
  • code/trunk/src/orxonox/OrxonoxPrecompiledHeaders.h

    r5781 r7284  
    8989#include "network/synchronisable/Synchronisable.h" // 70
    9090#include "util/MultiType.h"    // 65
    91 #include "core/Executor.h"     // 55
     91#include "core/command/Executor.h"     // 55
    9292//#include "core/XMLPort.h"     // 41
    9393
  • code/trunk/src/orxonox/PlayerManager.cc

    r6746 r7284  
    2929#include "PlayerManager.h"
    3030
     31#include "util/ScopedSingletonManager.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/GameMode.h"
    33 #include "core/ScopedSingletonManager.h"
    3434#include "Level.h"
    3535#include "infos/HumanPlayer.h"
  • code/trunk/src/orxonox/Radar.cc

    r7163 r7284  
    3737
    3838//#include "util/Math.h"
    39 #include "core/ConsoleCommand.h"
    4039#include "core/ObjectList.h"
     40#include "core/command/ConsoleCommand.h"
    4141#include "interfaces/RadarListener.h"
    4242#include "controllers/HumanController.h"
  • code/trunk/src/orxonox/Test.cc

    r7163 r7284  
    2929#include "core/CoreIncludes.h"
    3030#include "core/ConfigValueIncludes.h"
    31 #include "core/ConsoleCommand.h"
     31#include "core/command/ConsoleCommand.h"
    3232#include "network/NetworkFunction.h"
    3333#include "Test.h"
     
    3737{
    3838    CreateFactory ( Test );
    39  
    40     SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User);
    41     SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User);
    42     SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
    43     SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
    44     SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User);
    45     SetConsoleCommand(Test, call2, true).accessLevel(AccessLevel::User);
    46  
    47  
     39
     40    SetConsoleCommand("Test", "printV1", &Test::printV1).addShortcut();
     41    SetConsoleCommand("Test", "printV2", &Test::printV2).addShortcut();
     42    SetConsoleCommand("Test", "printV3", &Test::printV3).addShortcut();
     43    SetConsoleCommand("Test", "printV4", &Test::printV4).addShortcut();
     44    SetConsoleCommand("Test", "call",    &Test::call).addShortcut();
     45    SetConsoleCommand("Test", "call2",   &Test::call2).addShortcut();
     46
     47
    4848  //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 );
    4949  //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a));
    5050//   NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER );
    51  
     51
    5252    registerStaticNetworkFunction( &Test::printV1 );
    5353    registerMemberNetworkFunction( Test, checkU1 );
    5454    registerMemberNetworkFunction( Test, printBlaBla );
    55  
     55
    5656    Test* Test::instance_ = 0;
    5757
     
    7878        SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/;
    7979        SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/;
    80    
     80
    8181        SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/;
    8282        SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/;
     
    8989    {
    9090        registerVariable ( this->mySet_, VariableDirection::ToClient );
    91      
     91
    9292//         registerVariable ( u1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
    9393//         registerVariable ( u2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkU2 ));
    9494//         registerVariable ( u3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
    9595//         registerVariable ( u4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
    96    
     96
    9797//         registerVariable ( s1, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::checkS1 ));
    9898//         registerVariable ( s2, VariableDirection::ToServer, new NetworkCallback<Test> ( this, &Test::checkS2 ));
    9999//         registerVariable ( s3, Bidirectionality::ServerMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
    100100//         registerVariable ( s4, Bidirectionality::ClientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
    101    
     101
    102102//         registerVariable ( pointer_, VariableDirection::ToClient, new NetworkCallback<Test> ( this, &Test::printPointer ) );
    103103    }
    104  
     104
    105105  void Test::call(unsigned int clientID)
    106106    {
     
    108108        callStaticNetworkFunction( &Test::printV1, clientID );
    109109    }
    110  
     110
    111111    void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4)
    112112    {
    113113        callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );
    114114    }
    115  
     115
    116116    void Test::tick(float dt)
    117117    {
     
    132132    //       callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 );
    133133    }
    134    
     134
    135135    void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5)
    136136    {
    137137        COUT(0) << s1 << s2 << s3 << s4 << s5 << endl;
    138138    }
    139    
     139
    140140    void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
    141141    void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
     
    147147    void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
    148148    void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
    149    
     149
    150150    void Test::printPointer(){ CCOUT(1) << "pointer: " << this->pointer_ << endl; }
    151151
  • code/trunk/src/orxonox/controllers/AIController.cc

    r7184 r7284  
    3131#include "util/Math.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434#include "worldentities/ControllableEntity.h"
    3535#include "worldentities/pawns/Pawn.h"
  • code/trunk/src/orxonox/controllers/ArtificialController.cc

    r7184 r7284  
    3333
    3434#include "util/Math.h"
    35 #include "core/ConsoleCommand.h"
    3635#include "core/CoreIncludes.h"
    3736#include "core/XMLPort.h"
     37#include "core/command/ConsoleCommand.h"
    3838#include "worldentities/ControllableEntity.h"
    3939#include "worldentities/pawns/Pawn.h"
     
    4747namespace orxonox
    4848{
    49     SetConsoleCommand(ArtificialController, formationflight, true);
    50     SetConsoleCommand(ArtificialController, masteraction, true);
    51     SetConsoleCommand(ArtificialController, followme, true);
    52     SetConsoleCommand(ArtificialController, passivebehaviour, true);
    53     SetConsoleCommand(ArtificialController, formationsize, true);
     49    SetConsoleCommand("ArtificialController", "formationflight",  &ArtificialController::formationflight);
     50    SetConsoleCommand("ArtificialController", "masteraction",     &ArtificialController::masteraction);
     51    SetConsoleCommand("ArtificialController", "followme",         &ArtificialController::followme);
     52    SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);
     53    SetConsoleCommand("ArtificialController", "formationsize",    &ArtificialController::formationsize);
    5454
    5555    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7;
  • code/trunk/src/orxonox/controllers/DroneController.cc

    r7163 r7284  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "core/Executor.h"
     34#include "core/command/Executor.h"
    3535#include "worldentities/ControllableEntity.h"
    3636
  • code/trunk/src/orxonox/controllers/HumanController.cc

    r7163 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConsoleCommand.h"
     32#include "core/command/ConsoleCommand.h"
    3333#include "worldentities/ControllableEntity.h"
    3434#include "worldentities/pawns/Pawn.h"
     
    4040namespace orxonox
    4141{
    42     SetConsoleCommand(HumanController, moveFrontBack, true).setAsInputCommand();
    43     SetConsoleCommand(HumanController, moveRightLeft, true).setAsInputCommand();
    44     SetConsoleCommand(HumanController, moveUpDown,    true).setAsInputCommand();
    45     SetConsoleCommand(HumanController, rotateYaw,     true).setAsInputCommand();
    46     SetConsoleCommand(HumanController, rotatePitch,   true).setAsInputCommand();
    47     SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
    48     SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
    49     SetConsoleCommand(HumanController, reload,        true);
    50     SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
    51     SetConsoleCommand(HumanController, greet,         true);
    52     SetConsoleCommand(HumanController, switchCamera,  true);
    53     SetConsoleCommand(HumanController, mouseLook,     true);
    54     SetConsoleCommand(HumanController, suicide,       true);
    55     SetConsoleCommand(HumanController, toggleGodMode, true);
    56     SetConsoleCommand(HumanController, addBots,       true).defaultValues(1);
    57     SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
    58     SetConsoleCommand(HumanController, dropItems,     true);
    59     SetConsoleCommand(HumanController, useItem,       true);
    60     SetConsoleCommand(HumanController, cycleNavigationFocus,   true);
    61     SetConsoleCommand(HumanController, releaseNavigationFocus, true);
     42    SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
     43    SetConsoleCommand("HumanController", "moveRightLeft",          &HumanController::moveRightLeft ).addShortcut().setAsInputCommand();
     44    SetConsoleCommand("HumanController", "moveUpDown",             &HumanController::moveUpDown    ).addShortcut().setAsInputCommand();
     45    SetConsoleCommand("HumanController", "rotateYaw",              &HumanController::rotateYaw     ).addShortcut().setAsInputCommand();
     46    SetConsoleCommand("HumanController", "rotatePitch",            &HumanController::rotatePitch   ).addShortcut().setAsInputCommand();
     47    SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
     48    SetConsoleCommand("HumanController", "fire",                   &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     49    SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
     50    SetConsoleCommand("HumanController", "boost",                  &HumanController::boost         ).addShortcut().keybindMode(KeybindMode::OnHold);
     51    SetConsoleCommand("HumanController", "greet",                  &HumanController::greet         ).addShortcut();
     52    SetConsoleCommand("HumanController", "switchCamera",           &HumanController::switchCamera  ).addShortcut();
     53    SetConsoleCommand("HumanController", "mouseLook",              &HumanController::mouseLook     ).addShortcut();
     54    SetConsoleCommand("HumanController", "suicide",                &HumanController::suicide       ).addShortcut();
     55    SetConsoleCommand("HumanController", "toggleGodMode",          &HumanController::toggleGodMode ).addShortcut();
     56    SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
     57    SetConsoleCommand("HumanController", "killBots",               &HumanController::killBots      ).addShortcut().defaultValues(0);
     58    SetConsoleCommand("HumanController", "dropItems",              &HumanController::dropItems     ).addShortcut();
     59    SetConsoleCommand("HumanController", "useItem",                &HumanController::useItem       ).addShortcut();
     60    SetConsoleCommand("HumanController", "cycleNavigationFocus",   &HumanController::cycleNavigationFocus).addShortcut();
     61    SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut();
    6262
    6363    CreateUnloadableFactory(HumanController);
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r7184 r7284  
    3737
    3838#include "core/CoreIncludes.h"
    39 #include "core/ConsoleCommand.h"
     39#include "core/command/ConsoleCommand.h"
    4040#include "worldentities/ControllableEntity.h"
    4141#include "worldentities/pawns/Pawn.h"
     
    4949namespace orxonox
    5050{
    51     SetConsoleCommand(NewHumanController, changeMode, false).keybindMode(KeybindMode::OnPress);
    52     SetConsoleCommand(NewHumanController, accelerate, false).keybindMode(KeybindMode::OnPress);
    53     SetConsoleCommand(NewHumanController, decelerate, false).keybindMode(KeybindMode::OnPress);
    54     SetConsoleCommand(NewHumanController, unfire,      true).keybindMode(KeybindMode::OnRelease);
     51    SetConsoleCommand("NewHumanController", "changeMode", &NewHumanController::changeMode).keybindMode(KeybindMode::OnPress);
     52    SetConsoleCommand("NewHumanController", "accelerate", &NewHumanController::accelerate).keybindMode(KeybindMode::OnPress);
     53    SetConsoleCommand("NewHumanController", "decelerate", &NewHumanController::decelerate).keybindMode(KeybindMode::OnPress);
     54    SetConsoleCommand("NewHumanController", "unfire",     &NewHumanController::unfire    ).keybindMode(KeybindMode::OnRelease).addShortcut();
    5555
    5656    CreateUnloadableFactory(NewHumanController);
  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r7163 r7284  
    3535#include "GSGraphics.h"
    3636
    37 #include "core/CommandExecutor.h"
    38 #include "core/ConsoleCommand.h"
    3937#include "core/Game.h"
    4038#include "core/GUIManager.h"
     39#include "core/command/ConsoleCommand.h"
     40#include "core/command/CommandExecutor.h"
    4141
    4242namespace orxonox
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r6746 r7284  
    3636#include "core/input/InputState.h"
    3737#include "core/input/KeyBinderManager.h"
    38 #include "core/ConsoleCommand.h"
    3938#include "core/Game.h"
    4039#include "core/GameMode.h"
     
    4241#include "core/Loader.h"
    4342#include "core/XMLFile.h"
     43#include "core/command/ConsoleCommand.h"
    4444
    4545#include "LevelManager.h"
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r6746 r7284  
    3333#include "core/input/KeyBinderManager.h"
    3434#include "core/Game.h"
    35 #include "core/ConsoleCommand.h"
    3635#include "core/ConfigValueIncludes.h"
    3736#include "core/CoreIncludes.h"
    3837#include "core/GraphicsManager.h"
    3938#include "core/GUIManager.h"
     39#include "core/command/ConsoleCommand.h"
    4040#include "Scene.h"
    4141#include "sound/AmbientSound.h"
     
    4848    DeclareGameState(GSMainMenu, "mainMenu", false, true);
    4949
     50    static const std::string __CC_startStandalone_name      = "startGame";
     51    static const std::string __CC_startServer_name          = "startServer";
     52    static const std::string __CC_startClient_name          = "startClient";
     53    static const std::string __CC_startDedicated_name       = "startDedicated";
     54    static const std::string __CC_startMainMenu_name        = "startMainMenu";
     55    static const std::string __CC_setMainMenuSoundPath_name = "setMMSoundPath";
     56
     57    SetConsoleCommand(__CC_startStandalone_name,      &GSMainMenu::startStandalone).deactivate();
     58    SetConsoleCommand(__CC_startServer_name,          &GSMainMenu::startServer    ).deactivate();
     59    SetConsoleCommand(__CC_startClient_name,          &GSMainMenu::startClient    ).deactivate();
     60    SetConsoleCommand(__CC_startDedicated_name,       &GSMainMenu::startDedicated ).deactivate();
     61    SetConsoleCommand(__CC_startMainMenu_name,        &GSMainMenu::startMainMenu  ).deactivate();
     62    SetConsoleCommand(__CC_setMainMenuSoundPath_name, &GSMainMenu::setMainMenuSoundPath).hide();
     63
    5064    GSMainMenu::GSMainMenu(const GameStateInfo& info)
    5165        : GameState(info)
     
    89103        InputManager::getInstance().enterState("MainMenuHackery");
    90104
    91         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startStandalone), "startGame"));
    92         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startServer), "startServer"));
    93         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient), "startClient"));
    94         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated), "startDedicated"));
    95         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu"));
    96 
    97         // create command to change sound path
    98         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::setMainMenuSoundPath, this), "setMMSoundPath"));
     105        ModifyConsoleCommand(__CC_startStandalone_name).activate();
     106        ModifyConsoleCommand(__CC_startServer_name    ).activate();
     107        ModifyConsoleCommand(__CC_startClient_name    ).activate();
     108        ModifyConsoleCommand(__CC_startDedicated_name ).activate();
     109        ModifyConsoleCommand(__CC_startMainMenu_name  ).activate();
     110        ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject(this);
    99111
    100112        KeyBinderManager::getInstance().setToDefault();
     
    122134        GUIManager::hideGUI("MainMenu");
    123135        GraphicsManager::getInstance().setCamera(0);
     136
     137        ModifyConsoleCommand(__CC_startStandalone_name).deactivate();
     138        ModifyConsoleCommand(__CC_startServer_name    ).deactivate();
     139        ModifyConsoleCommand(__CC_startClient_name    ).deactivate();
     140        ModifyConsoleCommand(__CC_startDedicated_name ).deactivate();
     141        ModifyConsoleCommand(__CC_startMainMenu_name  ).deactivate();
     142        ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject(0);
    124143    }
    125144
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r7172 r7284  
    3131#include "util/Clock.h"
    3232#include "core/BaseObject.h"
    33 #include "core/ConsoleCommand.h"
    3433#include "core/Game.h"
    3534#include "core/GameMode.h"
     35#include "core/command/ConsoleCommand.h"
    3636#include "network/NetworkFunction.h"
    3737#include "tools/Timer.h"
     
    4141{
    4242    DeclareGameState(GSRoot, "root", false, false);
    43     SetConsoleCommandShortcut(GSRoot, printObjects);
     43
     44    static const std::string __CC_setTimeFactor_name = "setTimeFactor";
     45    static const std::string __CC_pause_name = "pause";
     46
     47    SetConsoleCommand("printObjects", &GSRoot::printObjects).hide();
     48    SetConsoleCommand(__CC_setTimeFactor_name, &GSRoot::setTimeFactor).accessLevel(AccessLevel::Master).defaultValues(1.0);
     49    SetConsoleCommand(__CC_pause_name,         &GSRoot::pause        ).accessLevel(AccessLevel::Master);
    4450
    4551    registerStaticNetworkFunction(&TimeFactorListener::setTimeFactor);
     
    7682        TimeFactorListener::setTimeFactor(1.0f);
    7783
    78         // time factor console command
    79         ConsoleCommand* command = createConsoleCommand(createFunctor(&GSRoot::setTimeFactor, this), "setTimeFactor");
    80         CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
    81 
    82         // time factor console command
    83         command = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause");
    84         CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline);
     84        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(this);
     85        ModifyConsoleCommand(__CC_pause_name).setObject(this);
    8586    }
    8687
    8788    void GSRoot::deactivate()
    8889    {
     90        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0);
     91        ModifyConsoleCommand(__CC_pause_name).setObject(0);
    8992    }
    9093
  • code/trunk/src/orxonox/gametypes/Dynamicmatch.cc

    r7163 r7284  
    155155                    spaceship->getEngine()->setSpeedFactor(5);
    156156                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
    157                     new Timer(10, false, &createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this))->setDefaultValue(0, ptr), true);
     157                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
     158                    executor->setDefaultValue(0, ptr);
     159                    new Timer(10, false, executor, true);
    158160                }
    159161            }
     
    254256                    spaceship->getEngine()->setSpeedFactor(5);
    255257                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
    256                     new Timer(10, false, &createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this))->setDefaultValue(0, ptr), true);
     258                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
     259                    executor->setDefaultValue(0, ptr);
     260                    new Timer(10, false, executor, true);
    257261                }
    258262
  • code/trunk/src/orxonox/gametypes/Gametype.cc

    r7163 r7284  
    3333#include "core/ConfigValueIncludes.h"
    3434#include "core/GameMode.h"
    35 #include "core/ConsoleCommand.h"
     35#include "core/command/ConsoleCommand.h"
    3636
    3737#include "infos/PlayerInfo.h"
     
    7979        else
    8080            this->scoreboard_ = 0;
    81 
    82         /* HACK HACK HACK */
    83         this->hackAddBots_ = createConsoleCommand( createFunctor(&Gametype::addBots, this), "hackAddBots");
    84         this->hackKillBots_ = createConsoleCommand( createFunctor(&Gametype::killBots, this), "hackKillBots");
    85         CommandExecutor::addConsoleCommandShortcut( this->hackAddBots_ );
    86         CommandExecutor::addConsoleCommandShortcut( this->hackKillBots_ );
    87         /* HACK HACK HACK */
    8881    }
    8982
     
    9386        {
    9487            this->gtinfo_->destroy();
    95             if( this->hackAddBots_ )
    96                 delete this->hackAddBots_;
    97             if( this->hackKillBots_ )
    98                 delete this->hackKillBots_;
    9988        }
    10089    }
  • code/trunk/src/orxonox/gametypes/Gametype.h

    r6417 r7284  
    184184            // Config Values
    185185            std::string scoreboardTemplate_;
    186 
    187             /* HACK HACK HACK */
    188             ConsoleCommand* hackAddBots_;
    189             ConsoleCommand* hackKillBots_;
    190             /* HACK HACK HACK */
    191186    };
    192187}
  • code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc

    r5929 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
     32#include "core/command/Executor.h"
    3333#include "worldentities/pawns/TeamBaseMatchBase.h"
    3434#include "infos/PlayerInfo.h"
  • code/trunk/src/orxonox/graphics/ParticleSpawner.cc

    r5929 r7284  
    3131#include "core/CoreIncludes.h"
    3232#include "core/EventIncludes.h"
    33 #include "core/Executor.h"
    3433#include "core/XMLPort.h"
     34#include "core/command/Executor.h"
    3535#include "tools/ParticleInterface.h"
    3636
  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r6502 r7284  
    4545#include "util/Math.h"
    4646#include "util/DisplayStringConversions.h"
     47#include "util/ScopedSingletonManager.h"
    4748#include "core/CoreIncludes.h"
    4849#include "core/ConfigValueIncludes.h"
    49 #include "core/ConsoleCommand.h"
    50 #include "core/ScopedSingletonManager.h"
     50#include "core/command/ConsoleCommand.h"
    5151#include "core/input/InputManager.h"
    5252#include "core/input/InputState.h"
     
    5858    const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
    5959
    60     SetConsoleCommand(InGameConsole, openConsole, true);
    61     SetConsoleCommand(InGameConsole, closeConsole, true);
     60    SetConsoleCommand("InGameConsole", "openConsole", &InGameConsole::openConsole).addShortcut();
     61    SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole).addShortcut();
    6262
    6363    ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
  • code/trunk/src/orxonox/overlays/InGameConsole.h

    r6417 r7284  
    3737#include "util/OgreForwardRefs.h"
    3838#include "util/Singleton.h"
    39 #include "core/Shell.h"
    4039#include "core/WindowEventListener.h"
     40#include "core/command/Shell.h"
    4141
    4242namespace orxonox
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r7184 r7284  
    4848#include "core/CoreIncludes.h"
    4949#include "core/XMLPort.h"
    50 #include "core/ConsoleCommand.h"
     50#include "core/command/ConsoleCommand.h"
    5151
    5252#include "OverlayGroup.h"
     
    5757    std::map<std::string, OrxonoxOverlay*> OrxonoxOverlay::overlays_s;
    5858
    59     SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User);
    60     SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User);
    61     SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User);
    62     SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User);
     59    SetConsoleCommand("OrxonoxOverlay", "scaleOverlay",     &OrxonoxOverlay::scaleOverlay);
     60    SetConsoleCommand("OrxonoxOverlay", "scrollOverlay",    &OrxonoxOverlay::scrollOverlay);
     61    SetConsoleCommand("OrxonoxOverlay", "toggleVisibility", &OrxonoxOverlay::toggleVisibility);
     62    SetConsoleCommand("OrxonoxOverlay", "rotateOverlay",    &OrxonoxOverlay::rotateOverlay);
    6363
    6464    OrxonoxOverlay::OrxonoxOverlay(BaseObject* creator)
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r6417 r7284  
    3434#include "OverlayGroup.h"
    3535
    36 #include "core/ConsoleCommand.h"
    3736#include "core/CoreIncludes.h"
    3837#include "core/XMLPort.h"
     38#include "core/command/ConsoleCommand.h"
    3939#include "OrxonoxOverlay.h"
    4040
     
    4343    CreateFactory(OverlayGroup);
    4444
    45     SetConsoleCommand(OverlayGroup, toggleVisibility, false).accessLevel(AccessLevel::User);
    46     SetConsoleCommand(OverlayGroup, scaleGroup, false).accessLevel(AccessLevel::User);
    47     SetConsoleCommand(OverlayGroup, scrollGroup, false).accessLevel(AccessLevel::User);
     45    SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
     46    SetConsoleCommand("OverlayGroup", "scaleGroup",       &OverlayGroup::scaleGroup);
     47    SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup);
    4848
    4949    OverlayGroup::OverlayGroup(BaseObject* creator)
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r7266 r7284  
    3838#include "util/Math.h"
    3939#include "util/Clock.h"
     40#include "util/ScopedSingletonManager.h"
    4041#include "core/ConfigValueIncludes.h"
    4142#include "core/CoreIncludes.h"
    4243#include "core/GameMode.h"
    43 #include "core/ScopedSingletonManager.h"
    4444#include "core/Resource.h"
    4545#include "SoundBuffer.h"
  • code/trunk/src/orxonox/sound/WorldSound.cc

    r7163 r7284  
    3737#include "Scene.h"
    3838#include "SoundManager.h"
    39 #include <core/ConsoleCommandCompilation.h>
    4039
    4140namespace orxonox
  • code/trunk/src/orxonox/weaponsystem/Munition.cc

    r5929 r7284  
    461461        if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
    462462        {
    463             Executor* executor = createExecutor(createFunctor(&Magazine::loaded, this));
     463            const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this));
    464464            executor->setDefaultValues(munition);
    465465
  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r7176 r7284  
    3131#include "util/Exception.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
    3433#include "core/GameMode.h"
     34#include "core/command/Executor.h"
    3535#include "tools/ParticleInterface.h"
    3636#include "Scene.h"
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.cc

    r7174 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/GameMode.h"
     33#include "core/command/Executor.h"
    3434#include "util/Exception.h"
    3535#include "Scene.h"
  • code/trunk/src/orxonox/worldentities/MovableEntity.cc

    r6417 r7284  
    3131
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
    3433#include "core/GameMode.h"
    3534#include "core/XMLPort.h"
     35#include "core/command/Executor.h"
    3636#include "worldentities/pawns/Pawn.h"
    3737
Note: See TracChangeset for help on using the changeset viewer.