def reserve_id

bendvy-ecs-core@0.1.0.4 · world.bend:134

import bendvy-ecs-core@0.1.0.4/world.bend as World
import Base
import entity_allocator.bend as A

134# Reserve a full allocator key, returning World in both success and refusal.
135# Reservation consumes allocator progress and is not yet visible as a live entity.
136def reserve_id(~S:Data,~C:Type,~R:Type,~E:Data,world:World<S,C,R,E>) -> World<S,C,R,E> & Reservation<S>:
137  match world:
138    case World{namespace,allocator,store,resource,events,pending,registrations,nextSystemId,clock}:reserve_join(~S,~C,~R,~E,namespace,store,resource,events,pending,registrations,nextSystemId,clock,A.reserve(allocator))

Uses (5)

Used by (4)