def despawn_command

bendvy-ecs-core@0.1.0.4 · commands.bend:89

import bendvy-ecs-core@0.1.0.4/commands.bend as Commands
import Base
import bendvy-ecs-core@0.1.0.4/deferred_command.bend as Deferred
import bendvy-ecs-core@0.1.0.4/world.bend as W

89# Construct the liveness-only deferred command, optionally recording application
90# status as an execution fact. Construction alone does not change liveness.
91def despawn_command(~S:Data,~C:Type,~R:Type,~E:Data,enabled:Bool,+handle:W.Handle<S>) -> Deferred.Command<W.World<S,C,R,E>>:
92  match enabled:
93    case False{}:Deferred.Raw{world=>despawn_apply(~S,~C,~R,~E,world,handle)}
94    case True{}:Deferred.Observed{trace=>world=>despawn_applied_traced(~S,~C,~R,~E,trace,handle,W.deactivate(~S,~C,~R,~E,world,handle))}

Uses (7)

Used by (1)