枚举
Lua的不可变枚举类型。
用法
local Enum = require " enum "
-- Enums can be created like so:
local Number = Enum ( " Zero " , " One " , " Two " , " Three " )
-- To control the starting value of an enum, the first value can be set.
local States = Enum ({
[ " Paused " ] = - 1 , -- Our enum will now start at -1 instead of 0.
" Active " , -- > 0
" Win " , -- > 1
" Lose " ,
1