Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5831 for code/branches/core5


Ignore:
Timestamp:
Sep 28, 2009, 10:48:47 PM (15 years ago)
Author:
landauf
Message:

Realized Timer doesn't have to be a template, hence merged TimerBase, Timer and StaticTimer.
Removed the object pointer from Timer for memberfunctions, use createFunctor(f, object) instead.

Location:
code/branches/core5/src
Files:
53 edited

Legend:

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

    r5798 r5831  
    4242    SetConsoleCommandShortcutExtern(killdelays);
    4343
    44     static std::set<StaticTimer*> delaytimerset;
     44    static std::set<Timer*> delaytimerset;
    4545
    4646    /**
     
    5151    void delay(float delay, const std::string& command)
    5252    {
    53         StaticTimer *delaytimer = new StaticTimer();
     53        Timer* delaytimer = new Timer();
    5454        delaytimerset.insert(delaytimer);
    5555
     
    6464        @param command The command to execute
    6565    */
    66     void executeDelayedCommand(StaticTimer* timer, const std::string& command)
     66    void executeDelayedCommand(Timer* timer, const std::string& command)
    6767    {
    6868        CommandExecutor::execute(command);
     
    7676    void killdelays()
    7777    {
    78         for (std::set<StaticTimer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
     78        for (std::set<Timer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
    7979            (*it)->destroy();
    8080
     
    8585        @brief Constructor: Sets the default-values.
    8686    */
    87     TimerBase::TimerBase()
     87    Timer::Timer()
     88    {
     89        this->init();
     90        RegisterObject(Timer);
     91    }
     92
     93    /**
     94        @brief Constructor: Initializes the Timer with given values.
     95        @param interval The timer-interval in seconds
     96        @param bLoop If true, the function gets called every 'interval' seconds
     97        @param exeuctor A executor of the function to call
     98    */
     99    Timer::Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall)
     100    {
     101        this->init();
     102        RegisterObject(Timer);
     103
     104        this->setTimer(interval, bLoop, executor, bKillAfterCall);
     105    }
     106
     107    /**
     108        @brief Deletes the executor.
     109    */
     110    Timer::~Timer()
     111    {
     112        this->deleteExecutor();
     113    }
     114   
     115    /**
     116        @brief Initializes the Timer
     117    */
     118    void Timer::init()
    88119    {
    89120        this->executor_ = 0;
     
    94125
    95126        this->time_ = 0;
    96 
    97         RegisterObject(TimerBase);
    98     }
    99 
    100     /**
    101         @brief Deletes the executor.
    102     */
    103     TimerBase::~TimerBase()
    104     {
    105         this->deleteExecutor();
    106127    }
    107128
     
    109130        @brief Executes the executor.
    110131    */
    111     void TimerBase::run()
     132    void Timer::run()
    112133    {
    113134        bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer
     
    122143        @brief Deletes the executor.
    123144    */
    124     void TimerBase::deleteExecutor()
     145    void Timer::deleteExecutor()
    125146    {
    126147      if (this->executor_)
     
    131152        @brief Updates the timer before the frames are rendered.
    132153    */
    133     void TimerBase::tick(const Clock& time)
     154    void Timer::tick(const Clock& time)
    134155    {
    135156        if (this->bActive_)
  • code/branches/core5/src/libraries/tools/Timer.h

    r5798 r5831  
    4040                ClassName();
    4141                void functionName();
    42                 Timer<ClassName> myTimer;
     42                Timer myTimer;
    4343        };
    4444
     
    4848        ClassName::ClassName()
    4949        {
    50             myTimer.setTimer(interval_in_seconds, bLoop, this, createExecutor(createFunctor(&ClassName::functionName)));
     50            myTimer.setTimer(interval_in_seconds, bLoop, createExecutor(createFunctor(&ClassName::functionName, this)));
    5151        }
    5252
     
    6969namespace orxonox
    7070{
    71     class StaticTimer;
    7271    void delay(float delay, const std::string& command);
    7372    void killdelays();
    74     void executeDelayedCommand(StaticTimer* timer, const std::string& command);
     73    void executeDelayedCommand(Timer* timer, const std::string& command);
    7574
    76     //! TimerBase is the parent of the Timer class.
    77     class _ToolsExport TimerBase : public TimeFactorListener
     75    //! The Timer is a callback-object, calling a given function after a given time-interval.
     76    class _ToolsExport Timer : public TimeFactorListener
    7877    {
    7978        public:
    80             ~TimerBase();
     79            Timer();
     80            ~Timer();
     81
     82            Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false);
     83
     84            /**
     85                @brief Initializes the Timer with given values.
     86                @param interval The timer-interval in seconds
     87                @param bLoop If true, the function gets called every 'interval' seconds
     88                @param object The object owning the timer and the function
     89                @param executor A executor of the function to call
     90            */
     91            void setTimer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false)
     92            {
     93                this->deleteExecutor();
     94
     95                this->setInterval(interval);
     96                this->bLoop_ = bLoop;
     97                this->executor_ = executor;
     98                this->bActive_ = true;
     99
     100                this->time_ = this->interval_;
     101                this->bKillAfterCall_ = bKillAfterCall;
     102            }
    81103
    82104            void run();
     
    116138            void tick(const Clock& time);
    117139
    118         protected:
    119             TimerBase();
    120 
     140        private:
     141            void init();
     142       
    121143            Executor* executor_;  //!< The executor of the function that should be called when the time expires
    122144
     
    128150            long long time_;      //!< Internal variable, counting the time till the next function-call
    129151    };
    130 
    131     //! The Timer is a callback-object, calling a given function after a given time-interval.
    132     template <class T = BaseObject>
    133     class Timer : public TimerBase
    134     {
    135         public:
    136             Timer() {}
    137 
    138             /**
    139                 @brief Constructor: Initializes the Timer with given values.
    140                 @param interval The timer-interval in seconds
    141                 @param bLoop If true, the function gets called every 'interval' seconds
    142                 @param object The object owning the timer and the function
    143                 @param exeuctor A executor of the function to call
    144             */
    145             template <class O>
    146             Timer(float interval, bool bLoop, T* object, ExecutorMember<O>* exeuctor, bool bKillAfterCall = false)
    147             {
    148                 this->setTimer(interval, bLoop, object, exeuctor, bKillAfterCall);
    149             }
    150 
    151             /**
    152                 @brief Initializes the Timer with given values.
    153                 @param interval The timer-interval in seconds
    154                 @param bLoop If true, the function gets called every 'interval' seconds
    155                 @param object The object owning the timer and the function
    156                 @param exeuctor A executor of the function to call
    157             */
    158             template <class O>
    159             void setTimer(float interval, bool bLoop, T* object, ExecutorMember<O>* executor, bool bKillAfterCall = false)
    160             {
    161                 this->deleteExecutor();
    162 
    163                 this->setInterval(interval);
    164                 this->bLoop_ = bLoop;
    165                 executor->setObject(object);
    166                 this->executor_ = static_cast<Executor*>(executor);
    167                 this->bActive_ = true;
    168 
    169                 this->time_ = this->interval_;
    170                 this->bKillAfterCall_ = bKillAfterCall;
    171             }
    172     };
    173 
    174     //! The StaticTimer is a callback-object, calling a static function after a given time-interval.
    175     class _ToolsExport StaticTimer : public TimerBase
    176     {
    177         public:
    178             StaticTimer() {}
    179 
    180             /**
    181                 @brief Constructor: Initializes the Timer with given values.
    182                 @param interval The timer-interval in seconds
    183                 @param bLoop If true, the function gets called every 'interval' seconds
    184                 @param exeuctor A executor of the function to call
    185             */
    186             StaticTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
    187             {
    188                 this->setTimer(interval, bLoop, executor, bKillAfterCall);
    189             }
    190 
    191             /**
    192                 @brief Initializes the Timer with given values.
    193                 @param interval The timer-interval in seconds
    194                 @param bLoop If true, the function gets called every 'interval' seconds
    195                 @param object The object owning the timer and the function
    196                 @param executor A executor of the function to call
    197             */
    198             void setTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
    199             {
    200                 this->deleteExecutor();
    201 
    202                 this->setInterval(interval);
    203                 this->bLoop_ = bLoop;
    204                 this->executor_ = executor;
    205                 this->bActive_ = true;
    206 
    207                 this->time_ = this->interval_;
    208                 this->bKillAfterCall_ = bKillAfterCall;
    209             }
    210     };
    211 
    212152}
    213153
  • code/branches/core5/src/libraries/tools/ToolsPrereqs.h

    r5738 r5831  
    7777    class ParticleInterface;
    7878    class Shader;
    79     template <class T>
    8079    class Timer;
    81     class StaticTimer;
    8280}
    8381
  • code/branches/core5/src/modules/gamestates/GSRoot.cc

    r5829 r5831  
    103103        }
    104104
    105         for (ObjectList<TimerBase>::iterator it = ObjectList<TimerBase>::begin(); it; )
     105        for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
    106106            (it++)->tick(time);
    107107
  • code/branches/core5/src/modules/overlays/FadeoutText.cc

    r5738 r5831  
    4646
    4747        this->bFadingOut_ = false;
    48         this->fadeouttimer_.setTimer(3.0f, false, this, createExecutor(createFunctor(&FadeoutText::fadeout)));
     48        this->fadeouttimer_.setTimer(3.0f, false, createExecutor(createFunctor(&FadeoutText::fadeout, this)));
    4949        this->fadeouttimer_.stopTimer();
    5050
  • code/branches/core5/src/modules/overlays/FadeoutText.h

    r5738 r5831  
    6868
    6969            bool bFadingOut_;
    70             Timer<FadeoutText> fadeouttimer_;
     70            Timer fadeouttimer_;
    7171
    7272            float initialAlpha_;
  • code/branches/core5/src/modules/overlays/hud/ChatOverlay.cc

    r5738 r5831  
    8787        COUT(0) << "Chat: " << text << std::endl;
    8888
    89         new Timer<ChatOverlay>(this->displayTime_, false, this, createExecutor(createFunctor(&ChatOverlay::dropMessage)), true);
     89        new Timer(this->displayTime_, false, createExecutor(createFunctor(&ChatOverlay::dropMessage, this)), true);
    9090
    9191        this->updateOverlayText();
  • code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc

    r5806 r5831  
    5252        this->text_->setPickPoint(Vector2(0.5, 0));
    5353
    54         this->inittimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&UnderAttackHealthBar::init)));
     54        this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this)));
    5555    }
    5656
  • code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.h

    r5738 r5831  
    6262            PlayerInfo* owner_;
    6363            OverlayText* text_;
    64             Timer<UnderAttackHealthBar> inittimer_;
     64            Timer inittimer_;
    6565    };
    6666}
  • code/branches/core5/src/modules/pong/Pong.cc

    r5806 r5831  
    5252        this->setHUDTemplate("PongHUD");
    5353
    54         this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall)));
     54        this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Pong::startBall, this)));
    5555        this->starttimer_.stopTimer();
    5656
  • code/branches/core5/src/modules/pong/Pong.h

    r5738 r5831  
    6262            PongBall* ball_;
    6363            PongBat* bat_[2];
    64             Timer<Pong> starttimer_;
     64            Timer starttimer_;
    6565    };
    6666}
  • code/branches/core5/src/modules/pong/PongAI.cc

    r5800 r5831  
    6060    PongAI::~PongAI()
    6161    {
    62         for (std::list<std::pair<Timer<PongAI>*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
     62        for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
    6363            (*it).first->destroy();
    6464    }
     
    231231
    232232            // Add a new Timer
    233             Timer<PongAI>* timer = new Timer<PongAI>(delay, false, this, createExecutor(createFunctor(&PongAI::delayedMove)));
    234             this->reactionTimers_.push_back(std::pair<Timer<PongAI>*, char>(timer, direction));
     233            Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this)));
     234            this->reactionTimers_.push_back(std::pair<Timer*, char>(timer, direction));
    235235        }
    236236        else
     
    246246
    247247        // Destroy the timer and remove it from the list
    248         Timer<PongAI>* timer = this->reactionTimers_.front().first;
     248        Timer* timer = this->reactionTimers_.front().first;
    249249        timer->destroy();
    250250
  • code/branches/core5/src/modules/pong/PongAI.h

    r5738 r5831  
    6565            float strength_;
    6666
    67             std::list<std::pair<Timer<PongAI>*, char> > reactionTimers_;
     67            std::list<std::pair<Timer*, char> > reactionTimers_;
    6868            char movement_;
    6969            char oldMove_;
  • code/branches/core5/src/modules/weapons/MuzzleFlash.cc

    r5791 r5831  
    4242        this->setScale(0.1f);
    4343
    44         this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
     44        this->delayTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&MuzzleFlash::destroy, this)));
    4545    }
    4646}
  • code/branches/core5/src/modules/weapons/MuzzleFlash.h

    r5791 r5831  
    4444
    4545        private:
    46             Timer<MuzzleFlash> delayTimer_;
     46            Timer delayTimer_;
    4747    };
    4848}
  • code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.cc

    r5738 r5831  
    4444        // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
    4545        // inheriting class, which comes after this constructor)
    46         this->replenishingTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer)));
     46        this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
    4747    }
    4848
     
    5050    {
    5151        // Initialize the timer
    52         this->replenishingTimer_.setTimer(this->replenishIntervall_, true, this, createExecutor(createFunctor(&ReplenishingMunition::replenish)));
     52        this->replenishingTimer_.setTimer(this->replenishIntervall_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
    5353    }
    5454
  • code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.h

    r5738 r5831  
    5151            void initializeTimer();
    5252
    53             Timer<ReplenishingMunition> replenishingTimer_;
     53            Timer replenishingTimer_;
    5454    };
    5555}
  • code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r5738 r5831  
    4242        this->textureIndex_ = 1;
    4343        this->maxTextureIndex_ = 8;
    44         this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
     44        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
    4545       
    4646        registerVariables();
  • code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.h

    r5738 r5831  
    5050            unsigned int textureIndex_;
    5151            unsigned int maxTextureIndex_;
    52             Timer<LightningGunProjectile> textureTimer_;
     52            Timer textureTimer_;
    5353            std::string materialBase_;
    5454      private:
  • code/branches/core5/src/modules/weapons/projectiles/Projectile.cc

    r5800 r5831  
    6161            this->attachCollisionShape(shape);
    6262
    63             this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
     63            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Projectile::destroyObject, this)));
    6464        }
    6565    }
  • code/branches/core5/src/modules/weapons/projectiles/Projectile.h

    r5738 r5831  
    6666            float damage_;
    6767            bool bDestroy_;
    68             Timer<Projectile> destroyTimer_;
     68            Timer destroyTimer_;
    6969    };
    7070}
  • code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r5738 r5831  
    5454        this->setMunitionName("FusionMunition");
    5555
    56         this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));
     56        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
    5757        this->delayTimer_.stopTimer();
    5858    }
  • code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.h

    r5738 r5831  
    5959            float speed_;
    6060            float delay_;
    61             Timer<EnergyDrink> delayTimer_;
     61            Timer delayTimer_;
    6262    };
    6363}
  • code/branches/core5/src/modules/weapons/weaponmodes/HsW01.cc

    r5738 r5831  
    5454        this->setMunitionName("LaserMunition");
    5555
    56         this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));
     56        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
    5757        this->delayTimer_.stopTimer();
    5858    }
  • code/branches/core5/src/modules/weapons/weaponmodes/HsW01.h

    r5738 r5831  
    5757            float speed_;
    5858            float delay_;
    59             Timer<HsW01> delayTimer_;
     59            Timer delayTimer_;
    6060    };
    6161}
  • code/branches/core5/src/orxonox/controllers/AIController.cc

    r5738 r5831  
    4444        RegisterObject(AIController);
    4545
    46         this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
     46        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&AIController::action, this)));
    4747    }
    4848
  • code/branches/core5/src/orxonox/controllers/AIController.h

    r5738 r5831  
    5050
    5151        private:
    52             Timer<AIController> actionTimer_;
     52            Timer actionTimer_;
    5353    };
    5454}
  • code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc

    r5738 r5831  
    4545        this->alertnessradius_ = 500;
    4646
    47         this->patrolTimer_.setTimer(rnd(), true, this, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy)));
     47        this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this)));
    4848    }
    4949
  • code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h

    r5738 r5831  
    6161            int team_;
    6262            float alertnessradius_;
    63             Timer<WaypointPatrolController> patrolTimer_;
     63            Timer patrolTimer_;
    6464    };
    6565}
  • code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc

    r5806 r5831  
    4242        RegisterObject(TeamBaseMatch);
    4343
    44         this->scoreTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::winPoints)));
    45         this->outputTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::showPoints)));
     44        this->scoreTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::winPoints, this)));
     45        this->outputTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::showPoints, this)));
    4646
    4747        this->pointsTeam1_ = 0;
  • code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h

    r5738 r5831  
    6565
    6666            std::set<TeamBaseMatchBase*> bases_;
    67             Timer<TeamBaseMatch> scoreTimer_;
    68             Timer<TeamBaseMatch> outputTimer_;
     67            Timer scoreTimer_;
     68            Timer outputTimer_;
    6969
    7070            //points for each team
  • code/branches/core5/src/orxonox/graphics/FadingBillboard.cc

    r5738 r5831  
    103103        {
    104104            this->changedirection_ = 1;
    105             this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
     105            this->turnonofftimer_.setTimer(this->turnontime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
    106106
    107107            if (this->isVisible())
     
    111111        {
    112112            this->changedirection_ = -1;
    113             this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
     113            this->turnonofftimer_.setTimer(this->turnofftime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
    114114        }
    115115    }
     
    126126            this->fadedColour_ = ColourValue::ZERO;
    127127            this->getBillboardSet().setColour(this->fadedColour_);
    128             this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));
     128            this->turnonofftimer_.setTimer(this->postprocessingtime_, false, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff, this)));
    129129        }
    130130        this->changedirection_ = 0;
  • code/branches/core5/src/orxonox/graphics/FadingBillboard.h

    r5738 r5831  
    7474            float turnofftime_;
    7575            float postprocessingtime_;
    76             Timer<FadingBillboard> turnonofftimer_;
     76            Timer turnonofftimer_;
    7777            char changedirection_;
    7878            ColourValue fadedColour_;
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc

    r5801 r5831  
    9696            return;
    9797
    98         this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
     98        this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
    9999    }
    100100
     
    103103        this->setActive(true);
    104104        if (this->lifetime_ != 0)
    105             this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));
     105            this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this)));
    106106    }
    107107
     
    116116
    117117            if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
    118                 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
     118                this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this)));
    119119        }
    120120        else if (this->bLoop_)
    121121        {
    122             this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
     122            this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
    123123        }
    124124    }
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.h

    r5791 r5831  
    8989            void destroyParticleSpawner();
    9090
    91             Timer<ParticleSpawner> timer_;
     91            Timer timer_;
    9292
    9393            bool  bSuppressStart_;
  • code/branches/core5/src/orxonox/pickup/DroppedItem.cc

    r5801 r5831  
    7676        if (this->timeToLive_ > 0)
    7777        {
    78             ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback));
    79             this->timer_.setTimer(this->timeToLive_, false, this, exec, false);
     78            this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false);
    8079        }
    8180    }
  • code/branches/core5/src/orxonox/pickup/DroppedItem.h

    r5738 r5831  
    7777        BaseItem* item_;
    7878
    79         Timer<DroppedItem> timer_;
     79        Timer timer_;
    8080    };
    8181}
  • code/branches/core5/src/orxonox/pickup/ModifierPickup.cc

    r5801 r5831  
    101101            if (this->duration_ > 0.0f)
    102102            {
    103                 ExecutorMember<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));
     103                Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this));
    104104                executor->setDefaultValues(pawn);
    105                 this->timer_.setTimer(this->duration_, false, this, executor);
     105                this->timer_.setTimer(this->duration_, false, executor);
    106106            }
    107107
  • code/branches/core5/src/orxonox/pickup/ModifierPickup.h

    r5738 r5831  
    129129
    130130        void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
     131       
    131132    private:
    132133        float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
     
    138139        std::map<ModifierType::Value, float> multiplicativeModifiers_;           //!< Map of multiplicative modifiers, indexed by ModifierType.
    139140
    140         float duration_;                                                        //!< Duration of this pickup's effect (0 for unlimited).
    141         Timer<ModifierPickup> timer_;                                           //!< Timer used if the pickup's effect has a time limit.
     141        float duration_;                                                         //!< Duration of this pickup's effect (0 for unlimited).
     142        Timer timer_;                                                            //!< Timer used if the pickup's effect has a time limit.
    142143    };
    143144}
  • code/branches/core5/src/orxonox/pickup/PickupSpawner.cc

    r5801 r5831  
    166166                    if (this->respawnTime_ > 0.0f)
    167167                    {
    168                         ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback));
    169                         this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor);
     168                        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
    170169
    171170                        this->setActive(false);
  • code/branches/core5/src/orxonox/pickup/PickupSpawner.h

    r5738 r5831  
    114114
    115115        float respawnTime_;                     //!< Time after which this gets re-actived.
    116         Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
     116        Timer respawnTimer_;                    //!< Timer used for re-activating.
    117117    };
    118118}
  • code/branches/core5/src/orxonox/weaponsystem/Munition.cc

    r5738 r5831  
    461461        if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
    462462        {
    463             ExecutorMember<Magazine>* executor = createExecutor(createFunctor(&Magazine::loaded));
     463            Executor* executor = createExecutor(createFunctor(&Magazine::loaded, this));
    464464            executor->setDefaultValues(munition);
    465465
    466             this->loadTimer_.setTimer(munition->reloadTime_, false, this, executor);
     466            this->loadTimer_.setTimer(munition->reloadTime_, false, executor);
    467467        }
    468468        else
  • code/branches/core5/src/orxonox/weaponsystem/Munition.h

    r5738 r5831  
    4747
    4848                unsigned int munition_;
    49                 Timer<Magazine> loadTimer_;
     49                Timer loadTimer_;
    5050                bool bLoaded_;
    5151
  • code/branches/core5/src/orxonox/weaponsystem/Weapon.cc

    r5801 r5831  
    5050        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
    5151
    52         this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&Weapon::reloaded)));
     52        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&Weapon::reloaded, this)));
    5353        this->reloadTimer_.stopTimer();
    5454    }
  • code/branches/core5/src/orxonox/weaponsystem/Weapon.h

    r5738 r5831  
    7171            std::multimap<unsigned int, WeaponMode*> weaponmodes_;
    7272
    73             Timer<Weapon> reloadTimer_;
     73            Timer reloadTimer_;
    7474            bool bReloading_;
    7575            unsigned int reloadingWeaponmode_;
  • code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc

    r5738 r5831  
    5757        this->bParallelReload_ = true;
    5858
    59         this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&WeaponMode::reloaded)));
     59        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
    6060        this->reloadTimer_.stopTimer();
    6161
  • code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h

    r5814 r5831  
    150150            std::string munitionname_;
    151151
    152             Timer<WeaponMode> reloadTimer_;
     152            Timer reloadTimer_;
    153153            bool bReloading_;
    154154    };
  • code/branches/core5/src/orxonox/worldentities/BigExplosion.cc

    r5801 r5831  
    9090            this->setVelocity(velocity);
    9191
    92             this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));
     92            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
    9393        }
    9494        this->registerVariables();
     
    329329        {
    330330            this->bStop_ = true;
    331             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy)));
     331            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
    332332        }
    333333    }
  • code/branches/core5/src/orxonox/worldentities/BigExplosion.h

    r5791 r5831  
    9898
    9999            LODParticle::Value    LOD_;
    100             Timer<BigExplosion>   destroyTimer_;
     100            Timer                 destroyTimer_;
    101101    };
    102102}
  • code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc

    r5801 r5831  
    7979            this->setVelocity(velocity);
    8080
    81             this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));
     81            this->destroyTimer_.setTimer(rnd(1, 2), false, createExecutor(createFunctor(&ExplosionChunk::stop, this)));
    8282        }
    8383
     
    132132        {
    133133            this->bStop_ = true;
    134             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
     134            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionChunk::destroy, this)));
    135135        }
    136136    }
  • code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h

    r5791 r5831  
    6060            ParticleInterface*    smoke_;
    6161            LODParticle::Value    LOD_;
    62             Timer<ExplosionChunk> destroyTimer_;
     62            Timer                destroyTimer_;
    6363    };
    6464}
  • code/branches/core5/src/orxonox/worldentities/MovableEntity.cc

    r5801 r5831  
    9898    void MovableEntity::clientConnected(unsigned int clientID)
    9999    {
    100         this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));
     100        this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, createExecutor(createFunctor(&MovableEntity::resynchronize, this)));
    101101    }
    102102
     
    110110        {
    111111            // Resynchronise every few seconds because we only work with velocities (no positions)
    112             continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
    113                 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);
     112            continuousResynchroTimer_ = new Timer(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
     113                true, createExecutor(createFunctor(&MovableEntity::resynchronize, this)), false);
    114114        }
    115115
  • code/branches/core5/src/orxonox/worldentities/MovableEntity.h

    r5738 r5831  
    9696            Quaternion overwrite_orientation_;
    9797
    98             Timer<MovableEntity> resynchronizeTimer_;
    99             Timer<MovableEntity>* continuousResynchroTimer_;
     98            Timer resynchronizeTimer_;
     99            Timer* continuousResynchroTimer_;
    100100
    101101            Pawn* owner_;
Note: See TracChangeset for help on using the changeset viewer.