def unrelate_command

bendvy-ecs-core@0.1.0.4 · relation_commands.bend:84

import bendvy-ecs-core@0.1.0.4/relation_commands.bend as RelationCommands
import Base
import bendvy-ecs-core@0.1.0.4/trace_relation.bend as TraceRel
import bendvy-ecs-core@0.1.0.4/deferred_command.bend as Deferred
import bendvy-ecs-core@0.1.0.4/trace_facts.bend as TraceFacts
import relation_types.bend as G
import world.bend as W

84def unrelate_command(~S:Data,~C:Type,~R:Type,~E:Data,enabled:Bool,+descriptor:G.Descriptor<S>,+source:W.Handle<S>) -> Deferred.Command<W.World<S,Store<S,C>,R,Notice<S,E>>>:
85  match enabled:
86    case False{}:Deferred.Raw{world=>apply_unrelate(~S,~C,~R,~E,world,descriptor,source)}
87    case True{}:Deferred.Observed{trace=>world=>(apply_unrelate(~S,~C,~R,~E,world,descriptor,source),TraceRel.unrelate(~S,trace,descriptor,TraceFacts.ApplyOperation{},source,TraceFacts.Applied{}))}

Uses (12)

Used by (1)