IEntityWorld.GetEntitiesWithBehavior() Method
Definition
Namespace: Brine2D.ECS
Gets all active entities that have a behavior of type T.
C#
System.Collections.Generic.IEnumerable<Brine2D.ECS.Entity> GetEntitiesWithBehavior<T>()
where T : Brine2D.ECS.Behavior;
Type parameters
T
Returns
System.Collections.Generic.IEnumerable<Entity>
Remarks
Returns a materialized list. Iterates the internal behavior list in O\(total behaviors\).
For per-frame use, prefer ForEachWithBehavior<T>\(Action<Entity,T>\) to avoid
allocating a new list each call, or a cached query with .WithBehavior<T>().