def component_inverse
bendvy-ecs-core@0.1.0.4 · ordinary_recoverable_component_capture.bend:44
import bendvy-ecs-core@0.1.0.4/ordinary_recoverable_component_capture.bend as OrdinaryRecoverableComponentCapture
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/column.bend as Col
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/recoverable_array.bend as A
import bendvy-ecs-core@0.1.0.4/recoverable_component.bend as RC
44def component_inverse(~S:Data,~P:Type,~Q:Type,~R:Type,~E:Data,old:RC.Record<S,P>,success:Bool,state:Product.Owner<W.World<S,Col.Column<S,P>,R,E>,Array<Q>>,recovery:Product.Owner<List<RC.Record<S,P>>,List<A.Record<Q>>>) -> Product.Owner<W.World<S,Col.Column<S,P>,R,E>,Array<Q>> & Product.Owner<List<RC.Record<S,P>>,List<A.Record<Q>>>:
45 match success state recovery:
46 case True{} state Product.Owner{components,captures}:(state,Product.Owner{old <> components,captures})
47 case False{} Product.Owner{world,capture} recovery:component_released(~S,~P,~Q,~R,~E,capture,recovery,RC.undo(~S,~P,~R,~E,old,world))