summaryrefslogtreecommitdiff
path: root/server/src/vm/list.lua
blob: f0f2bd3e7a37f37bfe01d444b26ece6a506ce708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local Id = 0
local List = {}

local function get(id)
    return List[id]
end

local function add(obj)
    Id = Id + 1
    List[Id] = obj
    return Id
end

local function clear(id)
    List[id] = nil
end

return {
    get = get,
    add = add,
    clear = clear,
    list = List,
}