mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-05 15:05:57 +02:00
23 lines
450 B
Lua
23 lines
450 B
Lua
local Public = {}
|
|
Public.__index = Public
|
|
|
|
function Public.new(player)
|
|
return setmetatable({player = player, _steps = {}}, Public)
|
|
end
|
|
|
|
function Public.timeout(self, delay, func)
|
|
local steps = self._steps
|
|
steps[#steps + 1] = {func = func, delay = delay or 1}
|
|
return self
|
|
end
|
|
|
|
function Public.next(self, func)
|
|
return self:timeout(1, func)
|
|
end
|
|
|
|
function Public.get_step(self, index)
|
|
return self._steps[index]
|
|
end
|
|
|
|
return Public
|