Originally Posted by ZOS_ChipHilseberg
These strings would not be localized and would probably look a lot like the enum values. The designers could fill them out and we would keep them as stable as possible so code could fetch ids using them, or use them for equality checks, etc. But we're open to other ideas.
|
Maybe let you inspire from the
Enum of C# (not necessarily copy 1:1): Create a ZO_Enum sub-class with some meta methods like :GetNames, :Parse :GetName :GetDisplayName.
Instead of creating millions of global constants, an Enum class like ITEM_STYLE, ITEM_TRAIT, ABILITY.
In Lua there is close to no difference reading a continous index based list and an ID based hash-table:
Lua Code:
for value,name in pairs(ITEM_STYLE) do
what ever
end
The Enum classes may get auto-generated from work-sheets of your designers.
You may allow us to override and/or extend these Enum instances for things like :GetNameWithQualityColor.