RelationExtensions.md

December 3, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS

RelationExtensions Class

public static class RelationExtensions

Inheritance System.Object ๐Ÿก’ RelationExtensions

Methods
AddRelation<TRelation>(this Entity, TRelation)Add the relation with the specified TRelation type to the entity.
Executes in O(1)
EntityRelations<TRelation>(this EntityStore)Return the storage for all entity relations of the specified TRelation type.
ForAllEntityRelations<TRelation>(this EntityStore, ForEachEntity<TRelation>)Obsolete: Use For(ForEachEntity<TRelation>)
Iterates all entity relations of the specified TRelation type.
Executes in O(N) N: number of all entity relations.
GetAllEntitiesWithRelations<TRelation>(this EntityStore)Obsolete: Use Entities
Returns a collection of entities having one or more relations of the specified TRelation type.
Executes in O(1).
GetAllEntityRelations<TRelation>(this EntityStore)Obsolete: Use Pairs
Return all entity relations of the specified TRelation type.
Executes in O(1). Most efficient way to iterate all entity relations.
GetIncomingLinks<TRelation>(this Entity)Return the entities with a link relation referencing the target entity of the passed IRelation type.
Executes in O(1).
GetRelation<TRelation,TKey>(this Entity, TKey)Returns the relation of the entity with the given key.
Executes in O(N) N: number of entity relations.
GetRelations<TRelation>(this Entity)Returns all unique relations of the passed entity.
Executes in O(1). In case TRelation is a ILinkRelation it returns all linked entities.
RemoveRelation<TRelation,TKey>(this Entity, TKey)Removes the relation with the specified key from an entity.
Executes in O(N) N: number of relations of the specific entity.
RemoveRelation<TRelation>(this Entity, Entity)Removes the specified link relation target from an entity.
Executes in O(N) N: number of link relations of the specified entity.
TryGetRelation<TRelation,TKey>(this Entity, TKey, TRelation)Returns the relation of the entity with the given key.
Executes in O(N) N: number of entity relations.