ComponentIndex_TIndexedComponent,TValue_.md

December 3, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS

ComponentIndex<TIndexedComponent,TValue> Struct

The index for IIndexedComponent<TValue> struct's to search entities with a specific component value in O(1).
An instance is returned via ComponentIndex<TIndexedComponent,TValue>(this EntityStore).

public readonly struct ComponentIndex<TIndexedComponent,TValue>
    where TIndexedComponent : struct, Friflo.Engine.ECS.IIndexedComponent<TValue>, System.ValueType, System.ValueType

Type parameters

TIndexedComponent

TValue

Properties
this[TValue]Return the entities having a component with the passed component value.
Executes in O(1) with default index.
ValuesReturns all indexed component values of the passed TIndexedComponent type.
Executes in O(1). Each value in the returned list is unique. See remarks for additional infos.
Methods
ToString()