codeable_models.CEnum¶
-
class
codeable_models.CEnum(name=None, **kwargs)¶ CEnumis used for defining enumerations.Superclasses:
CBundlable- Parameters
name (str) – An optional name.
**kwargs –
Pass in any kwargs acceptable to superclasses. In addition,
CEnumaccepts:values.The
valueskwarg accepts a list of string enumeration values in the form acceptable to theattributesproperty.
Example: The following defines an enumeration with 4 values and then prints all the values with the
valuesgetter:player_state = CEnum("Player State", values=["Walk", "Run", "Attack", "Roll"]) print(f"player states: {player_state.values!s}")
Another example is provided in the document Class attributes.
-
delete()¶ Deletes the enumeration. Calls
delete()on superclass.- Returns
None
-
property
values¶ Gets or sets the enumeration values.
- Type
list[str]