API reference

EnumAttribute Class

An attribute that stores an Enum value.
XML Usage Example:
<component name="Player">
  <EnumAttribute name="playerType" enumType="PlayerType" defaultValue="HUMAN" />
</component>

Enums should be defined like this:
<Enum name="MyEnum">
  <EnumValue value="ENUM_VALUE_1" />
  <EnumValue value="ENUM_VALUE_2" />
</Enum>

Signature

class EnumAttribute<T : Enum<T>>(
    key: Int,
    component: ComponentBase,
    attributeIndex: Int,
    enumClass: Class<T>,
    initialValue: T,
) : TypedAbstractAttribute<T>

Constructors

EnumAttribute ( key , component , attributeIndex , enumClass , initialValue )
Signature
constructor(
    key: Int,
    component: ComponentBase,
    attributeIndex: Int,
    enumClass: Class<T>,
    initialValue: T,
)
Parameters
key: Int  The integer key for this attribute
component: ComponentBase  The component this attribute belongs to
attributeIndex: Int
enumClass: Class<T>  The class object for the enum type
initialValue: EnumAttribute  The initial value for this attribute
Returns
EnumAttribute

Properties

[Get][Set]
Signature
var value: T
version : ULong
[Get][Set]
Signature
open override var version: ULong

Methods

checkIfComponentIsOld ()
Signature
fun checkIfComponentIsOld()
checkIfComponentIsRecycled ()
Signature
fun checkIfComponentIsRecycled()
get ()
Signature
open override fun get(): Any
Returns
Any
getValue ( thisRef , property )
Signature
operator fun getValue(thisRef: Any?, property: KProperty<*>): T
Parameters
thisRef: Any?
property: KProperty<*>
Returns
EnumAttribute
set ( value )
Signature
open override fun set(value: Any)
Parameters
value: Any
setValue ( thisRef , property , value )
Signature
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T)
Parameters
thisRef: Any?
property: KProperty<*>