An enumeration, similar to Enums in C#. Each value is created as an EnumValue on the Enum, referenced as a property with the same name as the EnumValue. Examples:
var myEnum = new springroll.Enum(
"valueOf0",
"valueOf1",
"valueOf2");
var myOtherEnum = new springroll.Enum(
{name: "one", value:"1", toString:"I am the One!"},
"two",
{name:"screwSequentialNumbers", value:42});
myEnum.valueOf0 != 0;//enum values are not integers
myEnum.valueOf1 != myOtherEnum.one;//enum values are not the same as other enums
myEnum.valueOf2.asInt == 2;//enum values can be explicitly compared to integers
myOtherEnum.screwSequentialNumbers == myOtherEnum.valueFromInt(42);//can use ints to get values
console.log(myOtherEnum.one.toString());//outputs "I am the One!"
for (var i in myEnum) console.log(i); //outputs "valueOf0","valueOf1","valueOf2"
next
input
Retrieves the next EnumValue in the Enum (loops to first value at end).
input
EnumValue
An EnumValue to retrieve the value that follows.
valueFromInt
input
Gets an enum value by integer value. If you have multiple enum values with the same integer value, this will always retrieve the first enum value.
input
Int
The integer value to get an enum value for.
The EnumValue that represents the input integer.
rawEnumValues
The values that this Enum was initialized with. We save this so that we can potentially pass this via Bellhop and re-initialize.