EntityReadOperations

Functions

Link copied to clipboard
abstract fun getComponentFor(entity: Entity, componentId: ComponentId): Component?

Gets a componentId's data from an entity or null if not present/the component doesn't hold any data.

Link copied to clipboard
abstract fun getComponentsFor(entity: Entity): Array<Component>

Gets a list of all the components entity has, as well as relations in the form of RelationComponent.

Link copied to clipboard
abstract fun getRelationsFor(entity: Entity, kind: ComponentId, target: EntityId): List<Relation>
Link copied to clipboard
abstract fun getRelationsWithDataFor(entity: Entity, kind: ComponentId, target: EntityId): List<RelationWithData<*, *>>

Gets relations in the same format as Archetype.getRelations, but when kind/target HOLDS_DATA, the appropriate data is written to a RelationWithData object.

Link copied to clipboard
abstract fun hasComponentFor(entity: Entity, componentId: ComponentId): Boolean

Checks whether an entity has a componentId