Process or fold entities with a specific subset of component types. The subset is defined by the provided the component specs.
Note: For best performance use the spec with the least amount of components as the first argument, and after that use the spec that results in the least amount of intersections of component types.
Process every entity with a specific subset of component types. The provided callback receives the entity id, the requested components and the world. In the callback the entity will be active in the world, so you can directly query or modify it.
Ecs.EntityComponents.processFromLeft2
specs.velocity
specs.position
(\entityId velocity position currentWorld ->
Ecs.insertComponent specs.position
{ x = position.x + velocity.x * deltaSeconds
, y = position.y + velocity.y * deltaSeconds
}
currentWorld
)
worldProcess entities that contain at least the specified component type. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 2 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 2 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 3 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 3 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 4 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 4 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 5 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 5 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 6 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 6 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 7 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 7 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the 8 specified component types. Entities are provided from lowest entity id to highest entity id.
Process entities that contain at least the 8 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold every entity with a specific subset of component types. The provided callback receives the entity id, the requested components and the provided accumulator. If you want to query or modify the entity in the callback then you have to use Ecs.onEntity first to make it active.
Ecs.EntityComponents.foldFromRight2
specs.shape
specs.position
(\entityId shape position list ->
( entityId, shape, position ) :: list
)
[]
worldFold entities that contain at least the specified component type. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the specified component type. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 2 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 2 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 3 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 3 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 4 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 4 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 5 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 5 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 6 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 6 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 7 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 7 specified component types. Entities are provided from highest entity id to lowest entity id.
Fold entities that contain at least the 8 specified component types. Entities are provided from lowest entity id to highest entity id.
Fold entities that contain at least the 8 specified component types. Entities are provided from highest entity id to lowest entity id.
Process entities that contain at least the specified component type. Entities are provided from lowest entity id to highest entity id.