A relation enables adding multiple components of the same type to an entity.
The components added to a single entity build a set of components using the relation TKey as unique identifier.
public interface IRelation<out TKey> :
Friflo.Engine.ECS.IRelation
TKey
The key defining a unique relation.
Derived
↳ ILinkRelation
Implements IRelation
A relation enables:
- Add multiple relations to an entity using AddRelation<TRelation>(this Entity, TRelation).
- Return all relations of an entity using GetRelations<TRelation>(this Entity).
- Return a specific relation by key using GetRelation<TRelation,TKey>(this Entity, TKey)
or TryGetRelation<TRelation,TKey>(this Entity, TKey, TRelation). - Remove a specific relation by key using RemoveRelation<TRelation,TKey>(this Entity, TKey).
Methods | |
---|---|
GetRelationKey() | Returns the key of a unique relation. |