Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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:
34 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • 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.