API reference
API reference
Select your platform
No SDKs available
No versions available

EnumAttribute Class

Modifiers: final
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>>(keyString: String, key: Int, component: ComponentBase, enumClass: Class<T>, initialValue: T) : TypedAbstractAttribute<T> 

Constructors

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

Properties

[Get][Set]
Signature
var value: T

Functions

checkIfComponentIsOld ()
Signature
fun checkIfComponentIsOld()
checkIfComponentIsRecycled ()
Signature
fun checkIfComponentIsRecycled()
get () : Any
Signature
open override fun get(): Any
Returns
Any
getValue ( thisRef , property ) : EnumAttribute
Signature
operator fun getValue(thisRef: Any?, property: KProperty<*>): T
Parameters
thisRef: Any?
property: KProperty
keyName () : String
Signature
fun keyName(): String
Returns
String
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
Did you find this page helpful?
Thumbs up icon
Thumbs down icon