OptionalComponentDelegate

class OptionalComponentDelegate<T : Component>(mapper: ComponentMapper<T>, componentClass: Class<T>)

Property delegate for an Entity wrapping around a ComponentMapper. Designed for components that might not be defined for each entity and can be null. Attempting to assign a null value to the property will remove the component from the entity.

See also

Constructors

Link copied to clipboard
constructor(mapper: ComponentMapper<T>, componentClass: Class<T>)

Functions

Link copied to clipboard
operator fun getValue(thisRef: Entity, property: KProperty<*>): T?
Link copied to clipboard
operator fun setValue(thisRef: Entity, property: KProperty<*>, value: T?)