Skip to content

EntityWorld.GetEntityByName Method

Definition

Namespace: Brine2D.ECS

Overloads
GetEntityByName\(string\)
GetEntityByName\(string, bool\)

EntityWorld.GetEntityByName\(string\) Method

C#
public Brine2D.ECS.Entity? GetEntityByName(string name);

Parameters

name System.String

Implements GetEntityByName\(string\)

Returns

Entity

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

C#
public Brine2D.ECS.Entity? GetEntityByName(string name, bool includeInactive);

Parameters

name System.String

includeInactive System.Boolean

Implements GetEntityByName\(string, bool\)

Returns

Entity

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.