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
IdEntity id
Properties
ArchetypeReturns the archetype the entity belongs to.
ComponentsReturn the IComponent's added to the entity.
IsNullReturns true is the entity is deleted.
TagsReturn 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.