Skip to content

CachedEntityQuery.ForEach(Action) Method

Definition

Namespace: Brine2D.ECS.Query

Executes an action for each cached entity and its components. Automatically parallelizes when entity count exceeds ECSOptions.ParallelEntityThreshold.

public void ForEach(System.Action<Brine2D.ECS.Entity,T1,T2> action);

Parameters

action System.Action<Entity,T1,T2>

Remarks

\<b>Thread safety:\</b> When parallelized, the action delegate runs on multiple threads simultaneously. The caller is responsible for ensuring thread-safe access to any shared or mutable state, including component properties.