ComponentDelegate

class ComponentDelegate<T : Component>(mapper: ComponentMapper<T>)

Property delegate for an Entity wrapping around a ComponentMapper. Allows accessing components assigned to entities with the property syntax. Designed for non-nullable components that are available for all entities without the risk of a NullPointerException.

See also

Constructors

Link copied to clipboard
constructor(mapper: ComponentMapper<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)