var Index = {
X_OFFSET: 1,
Y_OFFSET: 2,
Z_OFFSET: 3,
};
var options = [
{name: "X Offset", min:0, max:100, value:0},
{name: "Y Offset", min:0, max:100, value:0},
{name: "Z Offset", min:0, max:100, value:0}
]
var currentYOffset = options[Index.Y_OFFSET];
[options] is structured so it can be easily saved as an XML file. But to get the value of an option without an index, I'd need to loop through the entire array each time, which just feels inefficient. A simple enum that is identical to the 'name' property would suffice.
EnumMap sounds like it would be appropriate, but doesnt help with XML element name which needs to be a string.
Are there any other data structures appropriate for this, ideally getting rid of the predefined enum entirely.