IEntityWorld.ForEachWithComponents Method
Definition
Namespace: Brine2D.ECS
| Overloads | |
|---|---|
| ForEachWithComponents<T1,T2,T3,T4,T5>\(Action<Entity,T1,T2,T3,T4,T5>\) | Invokes action for every active entity that has all five component types, passing the entity and all five resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe. |
| ForEachWithComponents<T1,T2,T3,T4>\(Action<Entity,T1,T2,T3,T4>\) | Invokes action for every active entity that has all four component types, passing the entity and all four resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe. |
| ForEachWithComponents<T1,T2,T3>\(Action<Entity,T1,T2,T3>\) | Invokes action for every active entity that has all three component types, passing the entity and all three resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe. |
| ForEachWithComponents<T1,T2>\(Action<Entity,T1,T2>\) | Invokes action for every active entity that has both T1 and T2, passing the entity and both resolved components. Iterates the smaller pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe. |
IEntityWorld.ForEachWithComponents\<T1,T2,T3,T4,T5>\(Action\<Entity,T1,T2,T3,T4,T5\>\) Method
Invokes action for every active entity that has all five component types, passing the entity and all five resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe.
void ForEachWithComponents<T1,T2,T3,T4,T5>(System.Action<Brine2D.ECS.Entity,T1,T2,T3,T4,T5> action)
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
Parameters
action System.Action<Entity,T1,T2,T3,T4,T5>
Remarks
Prefer this over GetEntitiesWithComponents<T1,T2,T3,T4,T5>() in per-frame loops to avoid allocating a new list each call. For systems that query the same set every frame, Brine2D.ECS.IEntityWorld.CreateCachedQuery<> is more efficient still.
IEntityWorld.ForEachWithComponents\<T1,T2,T3,T4>\(Action\<Entity,T1,T2,T3,T4\>\) Method
Invokes action for every active entity that has all four component types, passing the entity and all four resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe.
void ForEachWithComponents<T1,T2,T3,T4>(System.Action<Brine2D.ECS.Entity,T1,T2,T3,T4> action)
where T1 : Brine2D.ECS.Component
where T2 : Brine2D.ECS.Component
where T3 : Brine2D.ECS.Component
where T4 : Brine2D.ECS.Component;
Type parameters
T1
T2
T3
T4
Parameters
action System.Action<Entity,T1,T2,T3,T4>
Remarks
Prefer this over GetEntitiesWithComponents<T1,T2,T3,T4>() in per-frame loops to avoid allocating a new list each call. For systems that query the same set every frame, Brine2D.ECS.IEntityWorld.CreateCachedQuery<> is more efficient still.
IEntityWorld.ForEachWithComponents\<T1,T2,T3>\(Action\<Entity,T1,T2,T3\>\) Method
Invokes action for every active entity that has all three component types, passing the entity and all three resolved components. Iterates the smallest pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe.
void ForEachWithComponents<T1,T2,T3>(System.Action<Brine2D.ECS.Entity,T1,T2,T3> action)
where T1 : Brine2D.ECS.Component
where T2 : Brine2D.ECS.Component
where T3 : Brine2D.ECS.Component;
Type parameters
T1
T2
T3
Parameters
action System.Action<Entity,T1,T2,T3>
Remarks
Prefer this over GetEntitiesWithComponents<T1,T2,T3>() in per-frame loops to avoid allocating a new list each call. For systems that query the same set every frame, Brine2D.ECS.IEntityWorld.CreateCachedQuery<> is more efficient still.
IEntityWorld.ForEachWithComponents\<T1,T2>\(Action\<Entity,T1,T2\>\) Method
Invokes action for every active entity that has both T1 and T2, passing the entity and both resolved components. Iterates the smaller pool internally for efficiency. Uses an System.Buffers.ArrayPool<> snapshot so structural changes made inside the callback are safe.
void ForEachWithComponents<T1,T2>(System.Action<Brine2D.ECS.Entity,T1,T2> action)
where T1 : Brine2D.ECS.Component
where T2 : Brine2D.ECS.Component;
Type parameters
T1
T2
Parameters
action System.Action<Entity,T1,T2>
Remarks
Prefer this over GetEntitiesWithComponents<T1,T2>() in per-frame loops to avoid allocating a new list each call. For systems that query the same set every frame, Brine2D.ECS.IEntityWorld.CreateCachedQuery<> is more efficient still.