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§
- Ancestor
Iter - An
Iterator
ofEntity
s over the ancestors of anEntity
. - Descendant
Depth First Iter - An
Iterator
ofEntity
s over the descendants of anEntity
. - Descendant
Iter - An
Iterator
ofEntity
s over the descendants of anEntity
. - Related
Spawner - Directly spawns related “source” entities with the given
Relationship
, targeting a specific entity. - Related
Spawner Commands - Uses commands to spawn related “source” entities with the given
Relationship
, targeting a specific entity.
Enums§
- Relationship
Hook Mode - Configures the conditions under which the Relationship insert/replace hooks will be run.
Traits§
- Ordered
Relationship Source Collection - This trait signals that a
RelationshipSourceCollection
is ordered. - Relationship
- A
Component
on a “source”Entity
that references another targetEntity
, creating a “relationship” between them. EveryRelationship
has a correspondingRelationshipTarget
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” - Relationship
Source Collection - The internal
Entity
collection used by aRelationshipTarget
component. This is not intended to be modified directly by users, as it could invalidate the correctness of relationships. - Relationship
Target - A
Component
containing the collection of entities that relate to thisEntity
via the associatedRelationship
type. See theRelationship
documentation for more information.
Functions§
- clone_
relationship_ target - The “clone behavior” for
RelationshipTarget
. This actually creates an emptyRelationshipTarget
instance with space reserved for the number of targets in the original instance. TheRelationshipTarget
will then be populated with the proper components when the correspondingRelationship
sources of truth are inserted. Cloning the actual entities in the originalRelationshipTarget
would result in duplicates, so we don’t do that!
Type Aliases§
- Source
Iter - The iterator type for the source entities in a
RelationshipTarget
collection, as defined in theRelationshipSourceCollection
trait.