improvement(actors): use the new timers modules
This commit is contained in:
parent
ab3d9abf9f
commit
8290fbb8d2
1 changed files with 4 additions and 5 deletions
|
@ -229,17 +229,16 @@ end
|
||||||
-- Control the integrated timers of the actor
|
-- Control the integrated timers of the actor
|
||||||
|
|
||||||
function BaseActor:initTimers()
|
function BaseActor:initTimers()
|
||||||
self.timers = {}
|
self.timers = core.modules.Timers(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BaseActor:addTimer(name, t)
|
function BaseActor:addTimer(name, t)
|
||||||
self.timers[name] = Timer(self, name, t)
|
core.debug:warning("actor", "function actor:addTimer is deprecated, prefer actor.timers:newTimer")
|
||||||
|
self.timers:newTimer(t, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BaseActor:updateTimers(dt)
|
function BaseActor:updateTimers(dt)
|
||||||
for k,v in pairs(self.timers) do
|
self.timers:update(dt)
|
||||||
v:update(dt)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BaseActor:timerResponse(name)
|
function BaseActor:timerResponse(name)
|
||||||
|
|
Loading…
Reference in a new issue