mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
Remove class utils
This commit is contained in:
parent
8f4b73e99d
commit
7f36221d45
25
class.lua
25
class.lua
@ -1,25 +0,0 @@
|
||||
classes = {}
|
||||
function define(name, def)
|
||||
if def.extends then
|
||||
setmetatable(def, get(def.extends))
|
||||
end
|
||||
classes[name] = def
|
||||
end
|
||||
function new(classname, ...)
|
||||
local obj = get(classname).new(...)
|
||||
obj = setmetatable(obj, {__index = classes[classname]})
|
||||
return obj
|
||||
end
|
||||
function get(classname)
|
||||
return classes[classname]
|
||||
end
|
||||
function call(classname, funcname, object, ...)
|
||||
if object then
|
||||
setfenv(1, object)
|
||||
get(classname)[funcname](object, ...)
|
||||
else
|
||||
setfenv(1, classes[classname])
|
||||
get(classname)[funcname](...)
|
||||
end
|
||||
setfenv(1, _G)
|
||||
end
|
1
init.lua
1
init.lua
@ -55,7 +55,6 @@ end
|
||||
|
||||
local components = {
|
||||
mod = {},
|
||||
class = {},
|
||||
conf = {},
|
||||
schema = {},
|
||||
data = {},
|
||||
|
Loading…
Reference in New Issue
Block a user