CachedEntityQuery Class
Definition
Namespace: Brine2D.ECS.Query
Cached query for entities with three components. Iterates the smallest pool and cross-resolves the remaining two.
C#
public class CachedEntityQuery<T1,T2,T3> : Brine2D.ECS.Query.CachedEntityQueryBase
where T1 : Brine2D.ECS.Component
where T2 : Brine2D.ECS.Component
where T3 : Brine2D.ECS.Component
Type parameters
T1
T2
T3
Inheritance System.Object → CachedEntityQueryBase → CachedEntityQuery\<T1,T2,T3>
| 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>\) | 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\) tuples. Use with foreach for zero-allocation iteration; no delegate or closure is created. |