def replace_resource
import bendvy-ecs-core@0.1.0.4/world.bend as Worldimport Base
244# Immediate whole-resource swap returning the displaced actual R owner. This raw
245# administrative operation supplies neither projection restrictions nor undo.
246def replace_resource(~S: Data,~C: Type,~R: Type,~E: Data,world: World<S,C,R,E>,replacement: R) -> World<S,C,R,E> & R:
247 match world:
248 case World{+namespace,allocator,store,resource,+events,pending,+registrations,+nextSystemId,+clock}: (World{namespace,allocator,store,replacement,events,pending,registrations,nextSystemId,clock},resource)