EntityData.md
July 31, 2024 ยท View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS
EntityData Struct
An EntityData is used to optimize access of entity components and tags.
An instance can be returned by Data.
public readonly ref struct EntityData
Remarks
It should be used if reading or updating multiple components of the same entity to optimize component access.
| Fields | |
|---|---|
| Id | Entity id |
| Properties | |
|---|---|
| Archetype | Returns the archetype the entity belongs to. |
| Components | Return the IComponent's added to the entity. |
| IsNull | Returns true is the entity is deleted. |
| Tags | Return the Tags added to an entity. |
| Methods | |
|---|---|
| Get<T>() | Return the component of the given type as a reference. |
| Has<T>() | Returns true if the entity contains a component of the specified type. |
| ToString() | |
| TryGet<T>(T) | Gets the component of the specififed type. Returns true if the entity contains a component of specified type. Otherwise false. |