def apply

bendvy-ecs-core@0.1.0.3 · execution_relation_interpreter.bend:50

import bendvy-ecs-core@0.1.0.3/execution_relation_interpreter.bend as ExecutionRelationInterpreter
import Base
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as A
import bendvy-ecs-core@0.1.0.3/relation_types.bend as T
import bendvy-ecs-core@0.1.0.3/execution_relation_operation.bend as O

50# Bevy ad678262, relationship/mod.rs:28-36 makes the source relationship
51# authoritative and maintains its target collection. Existing Bend graph/reorder
52# algorithms implement that invariant; dispatch never accepts an inverse writer.
53def apply(~S:Data,~descriptor:T.Descriptor<S>,+namespace:U32,allocator:A.Allocator,graph:T.Graph<S>,operation:O.Operation<S>) -> A.Allocator & O.Outcome<S>:
54  match operation:
55    case O.Relate{+source,target}:relate_source(~S,namespace,graph,descriptor,source,target,live(~S,namespace,allocator,source))
56    case O.Unrelate{+source}:unrelate_checked(~S,graph,descriptor,source,live(~S,namespace,allocator,source))
57    case O.Reorder{parent,children}:reorder(~S,namespace,allocator,graph,descriptor,parent,children)

Uses (11)

Used by (1)