with

inline fun <T : Component> EngineEntity.with(configure: T.() -> Unit = {}): T

Get or creates an instance of the component T and adds it to this entity.

Return

the created ƒComponent.

Parameters

T

the Component type to get or create.

configure

inlined function with T as the receiver to allow additional configuration of the Component.

See also

Throws

if the engine was unable to create the component