Module relationship

Source
Expand description

This module provides functionality to link entities to each other using specialized components called “relationships”. See the Relationship trait for more info.

Structs§

AncestorIter
An Iterator of Entitys over the ancestors of an Entity.
DescendantDepthFirstIter
An Iterator of Entitys over the descendants of an Entity.
DescendantIter
An Iterator of Entitys over the descendants of an Entity.
RelatedSpawner
Directly spawns related “source” entities with the given Relationship, targeting a specific entity.
RelatedSpawnerCommands
Uses commands to spawn related “source” entities with the given Relationship, targeting a specific entity.

Enums§

RelationshipHookMode
Configures the conditions under which the Relationship insert/replace hooks will be run.

Traits§

OrderedRelationshipSourceCollection
This trait signals that a RelationshipSourceCollection is ordered.
Relationship
A Component on a “source” Entity that references another target Entity, creating a “relationship” between them. Every Relationship has a corresponding RelationshipTarget type (and vice-versa), which exists on the “target” entity of a relationship and contains the list of all “source” entities that relate to the given “target”
RelationshipSourceCollection
The internal Entity collection used by a RelationshipTarget component. This is not intended to be modified directly by users, as it could invalidate the correctness of relationships.
RelationshipTarget
A Component containing the collection of entities that relate to this Entity via the associated Relationship type. See the Relationship documentation for more information.

Functions§

clone_relationship_target
The “clone behavior” for RelationshipTarget. This actually creates an empty RelationshipTarget instance with space reserved for the number of targets in the original instance. The RelationshipTarget will then be populated with the proper components when the corresponding Relationship sources of truth are inserted. Cloning the actual entities in the original RelationshipTarget would result in duplicates, so we don’t do that!

Type Aliases§

SourceIter
The iterator type for the source entities in a RelationshipTarget collection, as defined in the RelationshipSourceCollection trait.