EntityWorld.GetEntityByName Method
Definition
Namespace: Brine2D.ECS
| Overloads | |
|---|---|
| GetEntityByName\(string\) | |
| GetEntityByName\(string, bool\) |
EntityWorld.GetEntityByName\(string\) Method
Parameters
name System.String
Implements GetEntityByName\(string\)
Returns
Remarks
O\(n\); avoid in hot paths. Prefer ID-based lookup via Brine2D.ECS.EntityWorld.GetEntityById\(System\.Int64\). Also searches entities that have been created but not yet committed by Brine2D.ECS.EntityWorld.Flush / Brine2D.ECS.EntityWorld.ProcessDeferredOperations, so a name lookup immediately after CreateEntity\(string\) returns the new entity. Only active entities are returned; pending adds are always considered active.
EntityWorld.GetEntityByName\(string, bool\) Method
Parameters
name System.String
includeInactive System.Boolean
Implements GetEntityByName\(string, bool\)
Returns
Remarks
O\(n\); avoid in hot paths. Prefer ID-based lookup via Brine2D.ECS.EntityWorld.GetEntityById\(System\.Int64\). Also searches entities that have been created but not yet committed by Brine2D.ECS.EntityWorld.Flush / Brine2D.ECS.EntityWorld.ProcessDeferredOperations, so a name lookup immediately after CreateEntity\(string\) returns the new entity. When includeInactive is false, only active entities \(and pending adds, which are always active\) are returned.