[Orxonox-commit 1110] r5831 - in code/branches/core5/src: libraries/tools modules/gamestates modules/overlays modules/overlays/hud modules/pong modules/weapons modules/weapons/munitions modules/weapons/projectiles modules/weapons/weaponmodes orxonox/controllers orxonox/gametypes orxonox/graphics orxonox/pickup orxonox/weaponsystem orxonox/worldentities
landauf at orxonox.net
landauf at orxonox.net
Mon Sep 28 22:48:48 CEST 2009
Author: landauf
Date: 2009-09-28 22:48:47 +0200 (Mon, 28 Sep 2009)
New Revision: 5831
Modified:
code/branches/core5/src/libraries/tools/Timer.cc
code/branches/core5/src/libraries/tools/Timer.h
code/branches/core5/src/libraries/tools/ToolsPrereqs.h
code/branches/core5/src/modules/gamestates/GSRoot.cc
code/branches/core5/src/modules/overlays/FadeoutText.cc
code/branches/core5/src/modules/overlays/FadeoutText.h
code/branches/core5/src/modules/overlays/hud/ChatOverlay.cc
code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc
code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.h
code/branches/core5/src/modules/pong/Pong.cc
code/branches/core5/src/modules/pong/Pong.h
code/branches/core5/src/modules/pong/PongAI.cc
code/branches/core5/src/modules/pong/PongAI.h
code/branches/core5/src/modules/weapons/MuzzleFlash.cc
code/branches/core5/src/modules/weapons/MuzzleFlash.h
code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.cc
code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.h
code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.cc
code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.h
code/branches/core5/src/modules/weapons/projectiles/Projectile.cc
code/branches/core5/src/modules/weapons/projectiles/Projectile.h
code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.cc
code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.h
code/branches/core5/src/modules/weapons/weaponmodes/HsW01.cc
code/branches/core5/src/modules/weapons/weaponmodes/HsW01.h
code/branches/core5/src/orxonox/controllers/AIController.cc
code/branches/core5/src/orxonox/controllers/AIController.h
code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc
code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h
code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc
code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h
code/branches/core5/src/orxonox/graphics/FadingBillboard.cc
code/branches/core5/src/orxonox/graphics/FadingBillboard.h
code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc
code/branches/core5/src/orxonox/graphics/ParticleSpawner.h
code/branches/core5/src/orxonox/pickup/DroppedItem.cc
code/branches/core5/src/orxonox/pickup/DroppedItem.h
code/branches/core5/src/orxonox/pickup/ModifierPickup.cc
code/branches/core5/src/orxonox/pickup/ModifierPickup.h
code/branches/core5/src/orxonox/pickup/PickupSpawner.cc
code/branches/core5/src/orxonox/pickup/PickupSpawner.h
code/branches/core5/src/orxonox/weaponsystem/Munition.cc
code/branches/core5/src/orxonox/weaponsystem/Munition.h
code/branches/core5/src/orxonox/weaponsystem/Weapon.cc
code/branches/core5/src/orxonox/weaponsystem/Weapon.h
code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc
code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h
code/branches/core5/src/orxonox/worldentities/BigExplosion.cc
code/branches/core5/src/orxonox/worldentities/BigExplosion.h
code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc
code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h
code/branches/core5/src/orxonox/worldentities/MovableEntity.cc
code/branches/core5/src/orxonox/worldentities/MovableEntity.h
Log:
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.
Modified: code/branches/core5/src/libraries/tools/Timer.cc
===================================================================
--- code/branches/core5/src/libraries/tools/Timer.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/libraries/tools/Timer.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -41,7 +41,7 @@
SetConsoleCommandShortcutExtern(delay);
SetConsoleCommandShortcutExtern(killdelays);
- static std::set<StaticTimer*> delaytimerset;
+ static std::set<Timer*> delaytimerset;
/**
@brief Calls a console command after 'delay' seconds.
@@ -50,7 +50,7 @@
*/
void delay(float delay, const std::string& command)
{
- StaticTimer *delaytimer = new StaticTimer();
+ Timer* delaytimer = new Timer();
delaytimerset.insert(delaytimer);
ExecutorStatic* delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
@@ -63,7 +63,7 @@
@param timer The timer to destroy after the command-execution
@param command The command to execute
*/
- void executeDelayedCommand(StaticTimer* timer, const std::string& command)
+ void executeDelayedCommand(Timer* timer, const std::string& command)
{
CommandExecutor::execute(command);
timer->destroy();
@@ -75,7 +75,7 @@
*/
void killdelays()
{
- for (std::set<StaticTimer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
+ for (std::set<Timer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
(*it)->destroy();
delaytimerset.clear();
@@ -84,31 +84,52 @@
/**
@brief Constructor: Sets the default-values.
*/
- TimerBase::TimerBase()
+ Timer::Timer()
{
- this->executor_ = 0;
- this->interval_ = 0;
- this->bLoop_ = false;
- this->bActive_ = false;
- this->bKillAfterCall_ = false;
+ this->init();
+ RegisterObject(Timer);
+ }
- this->time_ = 0;
+ /**
+ @brief Constructor: Initializes the Timer with given values.
+ @param interval The timer-interval in seconds
+ @param bLoop If true, the function gets called every 'interval' seconds
+ @param exeuctor A executor of the function to call
+ */
+ Timer::Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall)
+ {
+ this->init();
+ RegisterObject(Timer);
- RegisterObject(TimerBase);
+ this->setTimer(interval, bLoop, executor, bKillAfterCall);
}
/**
@brief Deletes the executor.
*/
- TimerBase::~TimerBase()
+ Timer::~Timer()
{
this->deleteExecutor();
}
+
+ /**
+ @brief Initializes the Timer
+ */
+ void Timer::init()
+ {
+ this->executor_ = 0;
+ this->interval_ = 0;
+ this->bLoop_ = false;
+ this->bActive_ = false;
+ this->bKillAfterCall_ = false;
+ this->time_ = 0;
+ }
+
/**
@brief Executes the executor.
*/
- void TimerBase::run()
+ void Timer::run()
{
bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer
@@ -121,7 +142,7 @@
/**
@brief Deletes the executor.
*/
- void TimerBase::deleteExecutor()
+ void Timer::deleteExecutor()
{
if (this->executor_)
delete this->executor_;
@@ -130,7 +151,7 @@
/**
@brief Updates the timer before the frames are rendered.
*/
- void TimerBase::tick(const Clock& time)
+ void Timer::tick(const Clock& time)
{
if (this->bActive_)
{
Modified: code/branches/core5/src/libraries/tools/Timer.h
===================================================================
--- code/branches/core5/src/libraries/tools/Timer.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/libraries/tools/Timer.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -39,7 +39,7 @@
public:
ClassName();
void functionName();
- Timer<ClassName> myTimer;
+ Timer myTimer;
};
source.cc:
@@ -47,7 +47,7 @@
ClassName::ClassName()
{
- myTimer.setTimer(interval_in_seconds, bLoop, this, createExecutor(createFunctor(&ClassName::functionName)));
+ myTimer.setTimer(interval_in_seconds, bLoop, createExecutor(createFunctor(&ClassName::functionName, this)));
}
void ClassName::functionName()
@@ -68,17 +68,39 @@
namespace orxonox
{
- class StaticTimer;
void delay(float delay, const std::string& command);
void killdelays();
- void executeDelayedCommand(StaticTimer* timer, const std::string& command);
+ void executeDelayedCommand(Timer* timer, const std::string& command);
- //! TimerBase is the parent of the Timer class.
- class _ToolsExport TimerBase : public TimeFactorListener
+ //! The Timer is a callback-object, calling a given function after a given time-interval.
+ class _ToolsExport Timer : public TimeFactorListener
{
public:
- ~TimerBase();
+ Timer();
+ ~Timer();
+ Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false);
+
+ /**
+ @brief Initializes the Timer with given values.
+ @param interval The timer-interval in seconds
+ @param bLoop If true, the function gets called every 'interval' seconds
+ @param object The object owning the timer and the function
+ @param executor A executor of the function to call
+ */
+ void setTimer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false)
+ {
+ this->deleteExecutor();
+
+ this->setInterval(interval);
+ this->bLoop_ = bLoop;
+ this->executor_ = executor;
+ this->bActive_ = true;
+
+ this->time_ = this->interval_;
+ this->bKillAfterCall_ = bKillAfterCall;
+ }
+
void run();
void deleteExecutor();
@@ -115,9 +137,9 @@
void tick(const Clock& time);
- protected:
- TimerBase();
-
+ private:
+ void init();
+
Executor* executor_; //!< The executor of the function that should be called when the time expires
long long interval_; //!< The time-interval in micro seconds
@@ -127,88 +149,6 @@
long long time_; //!< Internal variable, counting the time till the next function-call
};
-
- //! The Timer is a callback-object, calling a given function after a given time-interval.
- template <class T = BaseObject>
- class Timer : public TimerBase
- {
- public:
- Timer() {}
-
- /**
- @brief Constructor: Initializes the Timer with given values.
- @param interval The timer-interval in seconds
- @param bLoop If true, the function gets called every 'interval' seconds
- @param object The object owning the timer and the function
- @param exeuctor A executor of the function to call
- */
- template <class O>
- Timer(float interval, bool bLoop, T* object, ExecutorMember<O>* exeuctor, bool bKillAfterCall = false)
- {
- this->setTimer(interval, bLoop, object, exeuctor, bKillAfterCall);
- }
-
- /**
- @brief Initializes the Timer with given values.
- @param interval The timer-interval in seconds
- @param bLoop If true, the function gets called every 'interval' seconds
- @param object The object owning the timer and the function
- @param exeuctor A executor of the function to call
- */
- template <class O>
- void setTimer(float interval, bool bLoop, T* object, ExecutorMember<O>* executor, bool bKillAfterCall = false)
- {
- this->deleteExecutor();
-
- this->setInterval(interval);
- this->bLoop_ = bLoop;
- executor->setObject(object);
- this->executor_ = static_cast<Executor*>(executor);
- this->bActive_ = true;
-
- this->time_ = this->interval_;
- this->bKillAfterCall_ = bKillAfterCall;
- }
- };
-
- //! The StaticTimer is a callback-object, calling a static function after a given time-interval.
- class _ToolsExport StaticTimer : public TimerBase
- {
- public:
- StaticTimer() {}
-
- /**
- @brief Constructor: Initializes the Timer with given values.
- @param interval The timer-interval in seconds
- @param bLoop If true, the function gets called every 'interval' seconds
- @param exeuctor A executor of the function to call
- */
- StaticTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
- {
- this->setTimer(interval, bLoop, executor, bKillAfterCall);
- }
-
- /**
- @brief Initializes the Timer with given values.
- @param interval The timer-interval in seconds
- @param bLoop If true, the function gets called every 'interval' seconds
- @param object The object owning the timer and the function
- @param executor A executor of the function to call
- */
- void setTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
- {
- this->deleteExecutor();
-
- this->setInterval(interval);
- this->bLoop_ = bLoop;
- this->executor_ = executor;
- this->bActive_ = true;
-
- this->time_ = this->interval_;
- this->bKillAfterCall_ = bKillAfterCall;
- }
- };
-
}
#endif /* _Timer_H__ */
Modified: code/branches/core5/src/libraries/tools/ToolsPrereqs.h
===================================================================
--- code/branches/core5/src/libraries/tools/ToolsPrereqs.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/libraries/tools/ToolsPrereqs.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -76,9 +76,7 @@
class Mesh;
class ParticleInterface;
class Shader;
- template <class T>
class Timer;
- class StaticTimer;
}
namespace Ogre
Modified: code/branches/core5/src/modules/gamestates/GSRoot.cc
===================================================================
--- code/branches/core5/src/modules/gamestates/GSRoot.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/gamestates/GSRoot.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -102,7 +102,7 @@
Game::getInstance().requestState("ioConsole");
}
- for (ObjectList<TimerBase>::iterator it = ObjectList<TimerBase>::begin(); it; )
+ for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
(it++)->tick(time);
/*** HACK *** HACK ***/
Modified: code/branches/core5/src/modules/overlays/FadeoutText.cc
===================================================================
--- code/branches/core5/src/modules/overlays/FadeoutText.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/overlays/FadeoutText.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -45,7 +45,7 @@
this->fadeouttime_ = 1.0f;
this->bFadingOut_ = false;
- this->fadeouttimer_.setTimer(3.0f, false, this, createExecutor(createFunctor(&FadeoutText::fadeout)));
+ this->fadeouttimer_.setTimer(3.0f, false, createExecutor(createFunctor(&FadeoutText::fadeout, this)));
this->fadeouttimer_.stopTimer();
this->initialAlpha_ = 1.0f;
Modified: code/branches/core5/src/modules/overlays/FadeoutText.h
===================================================================
--- code/branches/core5/src/modules/overlays/FadeoutText.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/overlays/FadeoutText.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -67,7 +67,7 @@
float fadeouttime_;
bool bFadingOut_;
- Timer<FadeoutText> fadeouttimer_;
+ Timer fadeouttimer_;
float initialAlpha_;
};
Modified: code/branches/core5/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- code/branches/core5/src/modules/overlays/hud/ChatOverlay.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/overlays/hud/ChatOverlay.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -86,7 +86,7 @@
this->messages_.push_back(multi_cast<Ogre::UTFString>(text));
COUT(0) << "Chat: " << text << std::endl;
- new Timer<ChatOverlay>(this->displayTime_, false, this, createExecutor(createFunctor(&ChatOverlay::dropMessage)), true);
+ new Timer(this->displayTime_, false, createExecutor(createFunctor(&ChatOverlay::dropMessage, this)), true);
this->updateOverlayText();
}
Modified: code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc
===================================================================
--- code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -51,7 +51,7 @@
this->text_->setColour(ColourValue::White);
this->text_->setPickPoint(Vector2(0.5, 0));
- this->inittimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&UnderAttackHealthBar::init)));
+ this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this)));
}
UnderAttackHealthBar::~UnderAttackHealthBar()
Modified: code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.h
===================================================================
--- code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -61,7 +61,7 @@
PlayerInfo* owner_;
OverlayText* text_;
- Timer<UnderAttackHealthBar> inittimer_;
+ Timer inittimer_;
};
}
#endif /* _UnderAttackHealthBar_H__ */
Modified: code/branches/core5/src/modules/pong/Pong.cc
===================================================================
--- code/branches/core5/src/modules/pong/Pong.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/pong/Pong.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -51,7 +51,7 @@
this->setHUDTemplate("PongHUD");
- this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall)));
+ this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Pong::startBall, this)));
this->starttimer_.stopTimer();
this->botclass_ = Class(PongBot);
Modified: code/branches/core5/src/modules/pong/Pong.h
===================================================================
--- code/branches/core5/src/modules/pong/Pong.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/pong/Pong.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -61,7 +61,7 @@
PongCenterpoint* center_;
PongBall* ball_;
PongBat* bat_[2];
- Timer<Pong> starttimer_;
+ Timer starttimer_;
};
}
Modified: code/branches/core5/src/modules/pong/PongAI.cc
===================================================================
--- code/branches/core5/src/modules/pong/PongAI.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/pong/PongAI.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -59,7 +59,7 @@
PongAI::~PongAI()
{
- for (std::list<std::pair<Timer<PongAI>*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
+ for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
(*it).first->destroy();
}
@@ -230,8 +230,8 @@
float delay = MAX_REACTION_TIME * (1 - this->strength_);
// Add a new Timer
- Timer<PongAI>* timer = new Timer<PongAI>(delay, false, this, createExecutor(createFunctor(&PongAI::delayedMove)));
- this->reactionTimers_.push_back(std::pair<Timer<PongAI>*, char>(timer, direction));
+ Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this)));
+ this->reactionTimers_.push_back(std::pair<Timer*, char>(timer, direction));
}
else
{
@@ -245,7 +245,7 @@
this->movement_ = this->reactionTimers_.front().second;
// Destroy the timer and remove it from the list
- Timer<PongAI>* timer = this->reactionTimers_.front().first;
+ Timer* timer = this->reactionTimers_.front().first;
timer->destroy();
this->reactionTimers_.pop_front();
Modified: code/branches/core5/src/modules/pong/PongAI.h
===================================================================
--- code/branches/core5/src/modules/pong/PongAI.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/pong/PongAI.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -64,7 +64,7 @@
float relHysteresisOffset_;
float strength_;
- std::list<std::pair<Timer<PongAI>*, char> > reactionTimers_;
+ std::list<std::pair<Timer*, char> > reactionTimers_;
char movement_;
char oldMove_;
bool bOscillationAvoidanceActive_;
Modified: code/branches/core5/src/modules/weapons/MuzzleFlash.cc
===================================================================
--- code/branches/core5/src/modules/weapons/MuzzleFlash.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/MuzzleFlash.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -41,6 +41,6 @@
RegisterObject(MuzzleFlash);
this->setScale(0.1f);
- this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
+ this->delayTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&MuzzleFlash::destroy, this)));
}
}
Modified: code/branches/core5/src/modules/weapons/MuzzleFlash.h
===================================================================
--- code/branches/core5/src/modules/weapons/MuzzleFlash.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/MuzzleFlash.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -43,7 +43,7 @@
virtual ~MuzzleFlash() {}
private:
- Timer<MuzzleFlash> delayTimer_;
+ Timer delayTimer_;
};
}
Modified: code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.cc
===================================================================
--- code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -43,13 +43,13 @@
// Use the timer to initialize itself after the first tick (because the real values for
// replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
// inheriting class, which comes after this constructor)
- this->replenishingTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer)));
+ this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
}
void ReplenishingMunition::initializeTimer()
{
// Initialize the timer
- this->replenishingTimer_.setTimer(this->replenishIntervall_, true, this, createExecutor(createFunctor(&ReplenishingMunition::replenish)));
+ this->replenishingTimer_.setTimer(this->replenishIntervall_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
}
void ReplenishingMunition::replenish()
Modified: code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.h
===================================================================
--- code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/munitions/ReplenishingMunition.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -50,7 +50,7 @@
void replenish();
void initializeTimer();
- Timer<ReplenishingMunition> replenishingTimer_;
+ Timer replenishingTimer_;
};
}
Modified: code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.cc
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -41,7 +41,7 @@
this->textureIndex_ = 1;
this->maxTextureIndex_ = 8;
- this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
+ this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
registerVariables();
}
Modified: code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.h
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/projectiles/LightningGunProjectile.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -49,7 +49,7 @@
void changeTexture();
unsigned int textureIndex_;
unsigned int maxTextureIndex_;
- Timer<LightningGunProjectile> textureTimer_;
+ Timer textureTimer_;
std::string materialBase_;
private:
void registerVariables();
Modified: code/branches/core5/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/Projectile.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/projectiles/Projectile.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -60,7 +60,7 @@
shape->setRadius(20);
this->attachCollisionShape(shape);
- this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
+ this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Projectile::destroyObject, this)));
}
}
Modified: code/branches/core5/src/modules/weapons/projectiles/Projectile.h
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/Projectile.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/projectiles/Projectile.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -65,7 +65,7 @@
float lifetime_;
float damage_;
bool bDestroy_;
- Timer<Projectile> destroyTimer_;
+ Timer destroyTimer_;
};
}
Modified: code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.cc
===================================================================
--- code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -53,7 +53,7 @@
this->delay_ = 0;
this->setMunitionName("FusionMunition");
- this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));
+ this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
this->delayTimer_.stopTimer();
}
Modified: code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.h
===================================================================
--- code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/weaponmodes/EnergyDrink.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -58,7 +58,7 @@
std::string material_;
float speed_;
float delay_;
- Timer<EnergyDrink> delayTimer_;
+ Timer delayTimer_;
};
}
Modified: code/branches/core5/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/branches/core5/src/modules/weapons/weaponmodes/HsW01.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/weaponmodes/HsW01.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -53,7 +53,7 @@
this->delay_ = 0;
this->setMunitionName("LaserMunition");
- this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));
+ this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
this->delayTimer_.stopTimer();
}
Modified: code/branches/core5/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/core5/src/modules/weapons/weaponmodes/HsW01.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/modules/weapons/weaponmodes/HsW01.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -56,7 +56,7 @@
std::string material_;
float speed_;
float delay_;
- Timer<HsW01> delayTimer_;
+ Timer delayTimer_;
};
}
Modified: code/branches/core5/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/core5/src/orxonox/controllers/AIController.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/controllers/AIController.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -43,7 +43,7 @@
{
RegisterObject(AIController);
- this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
+ this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&AIController::action, this)));
}
AIController::~AIController()
Modified: code/branches/core5/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/core5/src/orxonox/controllers/AIController.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/controllers/AIController.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -49,7 +49,7 @@
virtual void action();
private:
- Timer<AIController> actionTimer_;
+ Timer actionTimer_;
};
}
Modified: code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -44,7 +44,7 @@
this->team_ = 0;
this->alertnessradius_ = 500;
- this->patrolTimer_.setTimer(rnd(), true, this, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy)));
+ this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this)));
}
void WaypointPatrolController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -60,7 +60,7 @@
int team_;
float alertnessradius_;
- Timer<WaypointPatrolController> patrolTimer_;
+ Timer patrolTimer_;
};
}
Modified: code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -41,8 +41,8 @@
{
RegisterObject(TeamBaseMatch);
- this->scoreTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::winPoints)));
- this->outputTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::showPoints)));
+ this->scoreTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::winPoints, this)));
+ this->outputTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::showPoints, this)));
this->pointsTeam1_ = 0;
this->pointsTeam2_ = 0;
Modified: code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h
===================================================================
--- code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -64,8 +64,8 @@
using TeamDeathmatch::pawnsAreInTheSameTeam;
std::set<TeamBaseMatchBase*> bases_;
- Timer<TeamBaseMatch> scoreTimer_;
- Timer<TeamBaseMatch> outputTimer_;
+ Timer scoreTimer_;
+ Timer outputTimer_;
//points for each team
int pointsTeam1_;
Modified: code/branches/core5/src/orxonox/graphics/FadingBillboard.cc
===================================================================
--- code/branches/core5/src/orxonox/graphics/FadingBillboard.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/graphics/FadingBillboard.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -102,7 +102,7 @@
if (this->isActive())
{
this->changedirection_ = 1;
- this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+ this->turnonofftimer_.setTimer(this->turnontime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
if (this->isVisible())
this->getBillboardSet().setVisible(true);
@@ -110,7 +110,7 @@
else
{
this->changedirection_ = -1;
- this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+ this->turnonofftimer_.setTimer(this->turnofftime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
}
}
@@ -125,7 +125,7 @@
{
this->fadedColour_ = ColourValue::ZERO;
this->getBillboardSet().setColour(this->fadedColour_);
- this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));
+ this->turnonofftimer_.setTimer(this->postprocessingtime_, false, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff, this)));
}
this->changedirection_ = 0;
}
Modified: code/branches/core5/src/orxonox/graphics/FadingBillboard.h
===================================================================
--- code/branches/core5/src/orxonox/graphics/FadingBillboard.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/graphics/FadingBillboard.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -73,7 +73,7 @@
float turnontime_;
float turnofftime_;
float postprocessingtime_;
- Timer<FadingBillboard> turnonofftimer_;
+ Timer turnonofftimer_;
char changedirection_;
ColourValue fadedColour_;
};
Modified: code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc
===================================================================
--- code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -95,14 +95,14 @@
if (this->bForceDestroy_ || this->bSuppressStart_)
return;
- this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
+ this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
}
void ParticleSpawner::fireParticleSpawner()
{
this->setActive(true);
if (this->lifetime_ != 0)
- this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));
+ this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this)));
}
void ParticleSpawner::stopParticleSpawner()
@@ -115,11 +115,11 @@
this->detachFromParent();
if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
- this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
+ this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this)));
}
else if (this->bLoop_)
{
- this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
+ this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
}
}
Modified: code/branches/core5/src/orxonox/graphics/ParticleSpawner.h
===================================================================
--- code/branches/core5/src/orxonox/graphics/ParticleSpawner.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/graphics/ParticleSpawner.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -88,7 +88,7 @@
void stopParticleSpawner();
void destroyParticleSpawner();
- Timer<ParticleSpawner> timer_;
+ Timer timer_;
bool bSuppressStart_;
bool bAutostart_;
Modified: code/branches/core5/src/orxonox/pickup/DroppedItem.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/DroppedItem.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/DroppedItem.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -75,8 +75,7 @@
{
if (this->timeToLive_ > 0)
{
- ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback));
- this->timer_.setTimer(this->timeToLive_, false, this, exec, false);
+ this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false);
}
}
void DroppedItem::timerCallback()
Modified: code/branches/core5/src/orxonox/pickup/DroppedItem.h
===================================================================
--- code/branches/core5/src/orxonox/pickup/DroppedItem.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/DroppedItem.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -76,7 +76,7 @@
float triggerDistance_;
BaseItem* item_;
- Timer<DroppedItem> timer_;
+ Timer timer_;
};
}
Modified: code/branches/core5/src/orxonox/pickup/ModifierPickup.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/ModifierPickup.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/ModifierPickup.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -100,9 +100,9 @@
if (this->duration_ > 0.0f)
{
- ExecutorMember<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));
+ Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this));
executor->setDefaultValues(pawn);
- this->timer_.setTimer(this->duration_, false, this, executor);
+ this->timer_.setTimer(this->duration_, false, executor);
}
return true;
Modified: code/branches/core5/src/orxonox/pickup/ModifierPickup.h
===================================================================
--- code/branches/core5/src/orxonox/pickup/ModifierPickup.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/ModifierPickup.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -128,6 +128,7 @@
{ this->setMultiplicativeModifier(ModifierType::Acceleration, value); }
void timerCallback(Pawn* pawn); //!< Method called when the timer runs out.
+
private:
float getAdditiveModifier(ModifierType::Value type) const; //!< Get the additive modifier for a given ModifierType.
float getMultiplicativeModifier(ModifierType::Value type) const; //!< Get the multiplicative modifier for a given ModifierType.
@@ -137,8 +138,8 @@
std::map<ModifierType::Value, float> additiveModifiers_; //!< Map of additive modifiers, indexed by ModifierType.
std::map<ModifierType::Value, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType.
- float duration_; //!< Duration of this pickup's effect (0 for unlimited).
- Timer<ModifierPickup> timer_; //!< Timer used if the pickup's effect has a time limit.
+ float duration_; //!< Duration of this pickup's effect (0 for unlimited).
+ Timer timer_; //!< Timer used if the pickup's effect has a time limit.
};
}
Modified: code/branches/core5/src/orxonox/pickup/PickupSpawner.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/PickupSpawner.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/PickupSpawner.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -165,8 +165,7 @@
if (this->respawnTime_ > 0.0f)
{
- ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback));
- this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor);
+ this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
this->setActive(false);
this->fireEvent();
Modified: code/branches/core5/src/orxonox/pickup/PickupSpawner.h
===================================================================
--- code/branches/core5/src/orxonox/pickup/PickupSpawner.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/pickup/PickupSpawner.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -113,7 +113,7 @@
static const float rotationSpeed_s; //!< Rotation speed of pickup
float respawnTime_; //!< Time after which this gets re-actived.
- Timer<PickupSpawner> respawnTimer_; //!< Timer used for re-activating.
+ Timer respawnTimer_; //!< Timer used for re-activating.
};
}
Modified: code/branches/core5/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/Munition.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/Munition.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -460,10 +460,10 @@
if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
{
- ExecutorMember<Magazine>* executor = createExecutor(createFunctor(&Magazine::loaded));
+ Executor* executor = createExecutor(createFunctor(&Magazine::loaded, this));
executor->setDefaultValues(munition);
- this->loadTimer_.setTimer(munition->reloadTime_, false, this, executor);
+ this->loadTimer_.setTimer(munition->reloadTime_, false, executor);
}
else
this->loaded(munition);
Modified: code/branches/core5/src/orxonox/weaponsystem/Munition.h
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/Munition.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/Munition.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -46,7 +46,7 @@
Magazine(Munition* munition, bool bUseReloadTime = true);
unsigned int munition_;
- Timer<Magazine> loadTimer_;
+ Timer loadTimer_;
bool bLoaded_;
private:
Modified: code/branches/core5/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/Weapon.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/Weapon.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -49,7 +49,7 @@
this->bReloading_ = false;
this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
- this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&Weapon::reloaded)));
+ this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&Weapon::reloaded, this)));
this->reloadTimer_.stopTimer();
}
Modified: code/branches/core5/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/Weapon.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/Weapon.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -70,7 +70,7 @@
WeaponSlot* weaponSlot_;
std::multimap<unsigned int, WeaponMode*> weaponmodes_;
- Timer<Weapon> reloadTimer_;
+ Timer reloadTimer_;
bool bReloading_;
unsigned int reloadingWeaponmode_;
};
Modified: code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -56,7 +56,7 @@
this->bAutoReload_ = true;
this->bParallelReload_ = true;
- this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&WeaponMode::reloaded)));
+ this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
this->reloadTimer_.stopTimer();
this->damage_ = 0;
Modified: code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -149,7 +149,7 @@
SubclassIdentifier<Munition> munitiontype_;
std::string munitionname_;
- Timer<WeaponMode> reloadTimer_;
+ Timer reloadTimer_;
bool bReloading_;
};
}
Modified: code/branches/core5/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/BigExplosion.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/BigExplosion.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -89,7 +89,7 @@
velocity *= rnd(20, 30);
this->setVelocity(velocity);
- this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));
+ this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
}
this->registerVariables();
}
@@ -328,7 +328,7 @@
if (GameMode::isMaster())
{
this->bStop_ = true;
- this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy)));
+ this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
}
}
Modified: code/branches/core5/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/branches/core5/src/orxonox/worldentities/BigExplosion.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/BigExplosion.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -97,7 +97,7 @@
ParticleInterface* explosionFire_;
LODParticle::Value LOD_;
- Timer<BigExplosion> destroyTimer_;
+ Timer destroyTimer_;
};
}
Modified: code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -78,7 +78,7 @@
velocity *= rnd(60, 80);
this->setVelocity(velocity);
- this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));
+ this->destroyTimer_.setTimer(rnd(1, 2), false, createExecutor(createFunctor(&ExplosionChunk::stop, this)));
}
this->registerVariables();
@@ -131,7 +131,7 @@
if (GameMode::isMaster())
{
this->bStop_ = true;
- this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
+ this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionChunk::destroy, this)));
}
}
Modified: code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -59,7 +59,7 @@
ParticleInterface* fire_;
ParticleInterface* smoke_;
LODParticle::Value LOD_;
- Timer<ExplosionChunk> destroyTimer_;
+ Timer destroyTimer_;
};
}
Modified: code/branches/core5/src/orxonox/worldentities/MovableEntity.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/MovableEntity.cc 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/MovableEntity.cc 2009-09-28 20:48:47 UTC (rev 5831)
@@ -97,7 +97,7 @@
void MovableEntity::clientConnected(unsigned int clientID)
{
- this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));
+ this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, createExecutor(createFunctor(&MovableEntity::resynchronize, this)));
}
void MovableEntity::clientDisconnected(unsigned int clientID)
@@ -109,8 +109,8 @@
if (GameMode::isMaster() && !this->continuousResynchroTimer_)
{
// Resynchronise every few seconds because we only work with velocities (no positions)
- continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
- true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);
+ continuousResynchroTimer_ = new Timer(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
+ true, createExecutor(createFunctor(&MovableEntity::resynchronize, this)), false);
}
this->overwrite_position_ = this->getPosition();
Modified: code/branches/core5/src/orxonox/worldentities/MovableEntity.h
===================================================================
--- code/branches/core5/src/orxonox/worldentities/MovableEntity.h 2009-09-28 20:05:08 UTC (rev 5830)
+++ code/branches/core5/src/orxonox/worldentities/MovableEntity.h 2009-09-28 20:48:47 UTC (rev 5831)
@@ -95,8 +95,8 @@
Vector3 overwrite_position_;
Quaternion overwrite_orientation_;
- Timer<MovableEntity> resynchronizeTimer_;
- Timer<MovableEntity>* continuousResynchroTimer_;
+ Timer resynchronizeTimer_;
+ Timer* continuousResynchroTimer_;
Pawn* owner_;
float collisionDamage_;
More information about the Orxonox-commit
mailing list