def write_owner
bendvy-ecs-core@0.1.0.3 · execution_machine_component.bend:22
import bendvy-ecs-core@0.1.0.3/execution_machine_component.bend as ExecutionMachineComponent
import Base
import bendvy-ecs-core@0.1.0.3/state.bend as State
22def write_owner(~S:Data,~H:Type,~P:Type,~V:Data,~update:V -> P -> P & V,owner:MoveOwner<S,H,P,V>,value:V) -> MoveOwner<S,H,P,V> & State.WriteStatus<Unit>:
23 match owner:
24 case MoveOwner{scope,handle,None{}}:(MoveOwner{scope,handle,None{}},State.WriteRejected{Unit{}})
25 case MoveOwner{scope,+handle,Some{modify}}:write_result(~S,~H,~P,~V,handle,modify(update(value),scope,handle))