Skip to content

CachedEntityQuery Class

Definition

Namespace: Brine2D.ECS.Query

Cached query for entities with five components. Iterates the smallest pool and cross-resolves the remaining four.

C#
public class CachedEntityQuery<T1,T2,T3,T4,T5> : Brine2D.ECS.Query.CachedEntityQueryBase
    where T1 : Brine2D.ECS.Component
    where T2 : Brine2D.ECS.Component
    where T3 : Brine2D.ECS.Component
    where T4 : Brine2D.ECS.Component
    where T5 : Brine2D.ECS.Component

Type parameters

T1

T2

T3

T4

T5

Inheritance System.ObjectCachedEntityQueryBase → CachedEntityQuery\<T1,T2,T3,T4,T5>

Methods
Execute() Executes the query and returns matching entities. The returned list is cached; no allocation occurs per call.
ForEach\(Action<Entity,T1,T2,T3,T4,T5>\) Executes an action for each cached entity and its components. Automatically parallelizes when entity count exceeds ECSOptions.ParallelEntityThreshold.
GetEnumerator() Returns a struct enumerator over the cached \(Entity, C1, C2, C3, C4, C5\) tuples. Use with foreach for zero-allocation iteration; no delegate or closure is created.