def replace_world

bendvy-ecs-core@0.1.0.4 · resource_field.bend:23

import bendvy-ecs-core@0.1.0.4/resource_field.bend as ResourceField
import Base
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/world.bend as W

23# Runtime replacement owners cannot be captured in an erased projector template.
24# Trusted engine boundary threads the same World fields through the core join.
25def 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:
26  match world:
27    case W.World{+namespace,allocator,store,resource,+events,pending,+registrations,+nextSystemId,+clock}:W.observe_resource_finish(~S,~C,~R,~E,~P,replace(~R,~P,~Rest,~lens,replacement,resource),namespace,allocator,store,events,pending,registrations,nextSystemId,clock)

Uses (5)

Used by (2)