def replace_world
bendvy-ecs-core@0.1.0.3 · resource_field.bend:18
import bendvy-ecs-core@0.1.0.3/resource_field.bend as ResourceField
import Base
import bendvy-ecs-core@0.1.0.3/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.3/world.bend as W
18
19
20def replace_world(~S:Data,~C:Type,~R:Type,~E:Data,~P:Type,~Rest:Type,~lens:Product.Lens<R,P,Rest>,replacement:P,world:W.World<S,C,R,E>) -> W.World<S,C,R,E> & P:
21 match world:
22 case W.World{+namespace,allocator,store,resource,+events,pending,+registrations,+nextSystemId,+clock,lifecycle}:W.observe_resource_finish(~S,~C,~R,~E,~P,replace(~R,~P,~Rest,~lens,replacement,resource),namespace,allocator,store,events,pending,registrations,nextSystemId,clock,lifecycle)