IEntityWorld.GetEntityByName Method
Definition
Namespace: Brine2D.ECS
| Overloads | |
|---|---|
| GetEntityByName\(string\) | Gets an entity by name \(returns first match\). |
| GetEntityByName\(string, bool\) | Gets an entity by name \(returns first match\), optionally including inactive entities. |
IEntityWorld.GetEntityByName\(string\) Method
Gets an entity by name \(returns first match\).
Parameters
name System.String
Returns
Remarks
Only active entities are returned. To include inactive entities use the
includeInactive overload.
This is O\(n\); prefer ID-based lookup via GetEntityById\(long\) on hot paths.
Entities created in the same frame but not yet committed by Flush()
are also searched, so this method returns a newly-created entity immediately
without requiring a Flush() call first.
IEntityWorld.GetEntityByName\(string, bool\) Method
Gets an entity by name \(returns first match\), optionally including inactive entities.
Parameters
name System.String
The name to search for.
includeInactive System.Boolean
When true, inactive entities are also searched. Defaults to false to match the no-arg overload.
Returns
Remarks
This is O\(n\); prefer ID-based lookup via GetEntityById\(long\) on hot paths. Entities created in the same frame but not yet committed by Flush() are also searched, so this method returns a newly-created entity immediately without requiring a Flush() call first.