blob: 20a653de2338f38d6df56a4b33173216bc8abe07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
local createEnumTable = function(tbl, index)
assert(IsTable(tbl))
local enumtbl = {}
local enumindex = index or 0
for i, v in ipairs(tbl) do
enumtbl[v] = enumindex + i
end
return enumtbl
end
return createEnumTable
|