def constructed
bendvy-ecs-core@0.1.0.4 · bundle_insert_adapter.bend:22
import bendvy-ecs-core@0.1.0.4/bundle_insert_adapter.bend as BundleInsertAdapter
import Base
import bundle_batch.bend as BT
import bundle_construction.bend as CS
import world.bend as W
22def constructed(~S:Data,~Store:Type,~R:Type,~E:Data,~Packet:Type,~Context:Type,~Raw:Type,~Cooked:Type,~Error:Data,~pack:Cooked -> (Cooked -> Raw) -> Packet,~unpack:Packet -> Raw,batch:BT.Batch<S,Store,R,E,Packet>,target:W.Handle<S>,result:CS.Staged<Context,Raw,Cooked,Error>) -> Owner<S,Store,R,E,Packet,Context> & Output<Raw,Error>:
23 match result:
24 case CS.Failed{context,raw,positions}: (Owner{batch,context},Refused{raw,ConstructionRefused{positions}})
25 case CS.Valid{context,cooked,undo,positions}: inserted(~S,~Store,~R,~E,~Packet,~Context,~Raw,~Error,~unpack,context,BT.insert(~S,~Store,~R,~E,~Packet,batch,target,pack(cooked,undo)))