Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2011, 12:01:33 AM (13 years ago)
Author:
rgrieder
Message:

Reduced some header file dependencies in tools:

  • moved Timer::setTimer() to source file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/unity_build/src/libraries/tools/Timer.cc

    r8079 r8674  
    4242#include "core/command/ConsoleCommand.h"
    4343#include "core/command/CommandExecutor.h"
     44#include "core/command/Executor.h"
    4445#include "core/command/Functor.h"
    4546#include "tools/interfaces/TimeFactorListener.h"
     
    175176    {
    176177        return TimeFactorListener::getTimeFactor();
     178    }
     179
     180    /**
     181        @brief Initializes and starts the timer, which will call an executor after some time.
     182        @param interval         The timer-interval in seconds
     183        @param bLoop            If true, the executor gets called every @a interval seconds
     184        @param executor         The executor that will be called
     185        @param bKillAfterCall   If true, the timer will be deleted after the executor was called
     186    */
     187    void Timer::setTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall)
     188    {
     189        this->setInterval(interval);
     190        this->bLoop_ = bLoop;
     191        this->executor_ = executor;
     192        this->bActive_ = true;
     193
     194        this->time_ = this->interval_;
     195        this->bKillAfterCall_ = bKillAfterCall;
     196
     197        executor->getFunctor()->setSafeMode(true);
    177198    }
    178199
Note: See TracChangeset for help on using the changeset viewer.