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/modules
Files:
22 edited

Legend:

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