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

Legend:

Unmodified
Added
Removed
  • code/trunk

  • 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
Note: See TracChangeset for help on using the changeset viewer.