summaryrefslogtreecommitdiff
path: root/server/src/emmy/class.lua
blob: f1101e91800865ef3d30a2675fecc55d83bc0109 (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
local listMgr = require 'vm.list'

local mt = {}
mt.__index = mt
mt.type = 'emmy.class'

function mt:getType()
    return self.name
end

function mt:getName()
    return self.name
end

function mt:getSource()
    return listMgr.get(self.source)
end

return function (source)
    local self = setmetatable({
        name = source[1][1],
        source = source.id,
        extends = source[2] and source[2][1],
    }, mt)
    return self
end