summaryrefslogtreecommitdiff
path: root/server/src/emmy/class.lua
blob: 5e87181d8524aec288d4b60aa906364d59259e9e (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
32
33
34
35
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

function mt:setValue(value)
    self.value = value
end

function mt:getValue()
    return self.value
end

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