Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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/orxonox/pickup
Files:
6 edited

Legend:

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