def checked

bendvy-ecs-core@0.1.0.4 · lifetime_scope_world_spawn.bend:28

import bendvy-ecs-core@0.1.0.4/lifetime_scope_world_spawn.bend as LifetimeScopeWorldSpawn
import Base
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 bendvy-ecs-core@0.1.0.4/lifetime_scope.bend as Sc
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/transaction.bend as T
import bendvy-ecs-core@0.1.0.4/relation_commands.bend as A

28def checked(~S:Data,~C:Type,~R:Type,~E:Data,~P:Type,~populate:W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>> -> W.Handle<S> -> P -> W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>>,same:Bool,world:W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>>,undo:List<(W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>> -> W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>>)>,commands:List<Deferred.Command<W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>>>>,events:List<&2,A.Notice<S,E>>,trace:TraceFacts.State,payload:P,name:String) -> T.Tx<W.World<S,A.Store<S,Sc.Store<S,C>>,R,A.Notice<S,E>>,A.Notice<S,E>> & Sc.SpawnResult<S,P>:
29  match same:
30    case False{}:(T.Tx{world,undo,commands,events,trace},Sc.SpawnRejected{payload,W.MissingEntity{}})
31    case True{}:reserved(~S,~C,~R,~E,~P,~populate,W.reserve_id(~S,~A.Store<S,Sc.Store<S,C>>,~R,~A.Notice<S,E>,world),undo,commands,events,trace,payload,name)

Uses (17)

Used by (1)