def with_world

bendvy-ecs-core@0.1.0.4 · event_runtime.bend:176

import bendvy-ecs-core@0.1.0.4/event_runtime.bend as EventRuntime
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W

176# Advanced action bridge: consume/return actual World and Out, advance runtime
177# tick, then synchronize newly appended World events by the existing retained-log
178# prefix length. Action must respect that synchronization invariant; this is not
179# a read-only guarantee, transaction wrapper or implicit structural barrier.
180def with_world(~S: Data,~C: Type,~R: Type,~E: Data,~O: Type,effect: W.World<S,C,R,E> -> W.World<S,C,R,E> & O,runtime: Runtime<S,C,R,E>) -> Runtime<S,C,R,E> & O:
181  match runtime:
182    case Runtime{world,+namespace,+batches,+positions,+nextReader,+tick,+frameStart,+boundary,+capacity,+dropped}: with_world_result(~S,~C,~R,~E,~O,effect(world),namespace,batches,positions,nextReader,1n+tick,frameStart,boundary,capacity,dropped)

Uses (5)

Used by (2)