sonic-bluestreak/sonic-bluestreak.love/birb/classes/time/func.lua

14 lines
322 B
Lua
Raw Permalink Normal View History

2021-11-25 10:46:15 +01:00
local Timer = require "birb.classes.time.timer"
local TimedFunction = Timer:extend()
function TimedFunction:new(actor, name, func, t)
TimedFunction.super.new(self, actor, name, t)
self.func = func
end
function TimedFunction:finish()
self.actor.funcs[self.name] = nil
self.func()
end
return TimedFunction