blob: 2ce7086539739e51f60da325c7cc418a55eab5b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
modules = setmetatable({}, {__call = function(this, path, names)
for i, name in pairs(names) do
require(path .. name .. ".lua")
end
end})
local modules, type = modules, type
local function call(func, ...)
if type(func) == "function" then
return func(...)
end
end
function init(...)
script.setUpdateDelta(1)
for i, module in pairs(modules) do
call(module.init, ...)
end
end
function update(...)
for i, module in pairs(modules) do
call(module.update, ...)
end
end
function uninit(...)
for i, module in pairs(modules) do
call(module.uninit, ...)
end
end
|