00001 00002 #include "timer.hpp" 00003 00004 Timer::Timer(NodePtr owner, EventPtr eventOnFire) 00005 { 00006 assert(owner.get() != 0); 00007 assert(eventOnFire.get() != 0); 00008 00009 m_eventOnFire = eventOnFire; 00010 m_owner = owner; 00011 00012 } 00013 00014 void Timer::setEvent(EventPtr eventOnFire) 00015 { 00016 assert(eventOnFire != 0); 00017 // If the timer is currently running, 00018 // we need to stop it so that the old event 00019 // is removed from the event queue. 00020 if(isRunning()) { 00021 stop(); 00022 } 00023 m_eventOnFire = eventOnFire; 00024 } 00025