def undo_checked

bendvy-ecs-core@0.1.0.4 · bundle_component_install.bend:21

import bendvy-ecs-core@0.1.0.4/bundle_component_install.bend as BundleComponentInstall
import Base
import world.bend as W
import component.bend as C
import column.bend as Col
import lifecycle.bend as L
import bundle_install.bend as F

21def undo_checked(~S:Data,~Store:Type,~R:Type,~E:Data,~Rest:Type,~C:Type,~V:Data,~Token:Data,~take:Store -> Rest & Col.Column<S,C>,~put:Rest -> Col.Column<S,C> -> Store,~project:C -> C & V,+handle:W.Handle<S>,+id:U32,stamp:L.Stamp,previous:Maybe<&1,C>,observed:W.World<S,Store,R,E> & Bool) -> F.Restore<W.World<S,Store,R,E>,Entry<S,C>,Recovery<S,C>>:
22  match observed:
23    case (world,False{}): F.Pending{world,Recovery{Entry{handle,previous},stamp},W.MissingEntity{}}
24    case (world,True{}): undo_present(~S,~Store,~R,~E,~Rest,~C,~V,~Token,~take,~put,~project,handle,id,stamp,world,C.owner_present(~C,previous))

Uses (15)

Used by (1)