def undo_stamped

bendvy-ecs-core@0.1.0.4 · recoverable_component.bend:38

import bendvy-ecs-core@0.1.0.4/recoverable_component.bend as RecoverableComponent
import Base
import entity_key.bend as Key
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/lifecycle.bend as Life

38def undo_stamped(~S:Data,~P:Type,+handle:W.Handle<S>,stamp:Life.Stamp,payload:Maybe<P>,observed:Col.Column<S,P> & Life.Stamp) -> Col.Column<S,P> & Record<S,P>:
39  match handle observed:
40    case W.Handle{_,Key.EntityKey{+id,_}}, (column,released):restored(~S,~P,handle,stamp,released,Col.swap(~S,~P,Col.ensure(~S,~P,column,id),id,payload))

Uses (11)

Used by (1)