IndexExtensions.GetAllLinkedEntities_TComponent_(thisEntityStore).md

December 3, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS.IndexExtensions

IndexExtensions.GetAllLinkedEntities(this EntityStore) Method

Obsolete: Use Values
Returns all entities linked by the specified ILinkComponent type.
Executes in O(1). Each entity in the returned list is unique. See remarks for additional infos.

public static System.Collections.Generic.IReadOnlyCollection<Friflo.Engine.ECS.Entity> GetAllLinkedEntities<TComponent>(this Friflo.Engine.ECS.EntityStore store)
    where TComponent : struct, Friflo.Engine.ECS.ILinkComponent, System.ValueType, System.ValueType;

Type parameters

TComponent

Parameters

store EntityStore

Returns

System.Collections.Generic.IReadOnlyCollection<Entity>

Remarks

  • The returned collection changes when component link values are updated, removed or added.
  • To get the entities linking a specific entity use GetIncomingLinks<TComponent>(this Entity).
  • The method is a specialized version of Values
    using TIndexedComponent = ILinkComponent and TValue = Entity.