blob: df44005120fdbc49fca27f9cd774231c7db6af90 (
plain) (
tree)
|
|
-- because sometimes you need an enum
local function enum(tbl)
local length = #tbl
for i = 1, length do
local v = tbl[i]
tbl[v] = i
end
return tbl
end
local Game_Status = enum {
"MENU",
"PLAY",
"QUIT"
}
print(Game_Status.MENU) -- 1
print(Game_Status.PLAY) -- 2, .etc
|