def reserve_id

bendvy-ecs-core@0.1.0.3 · world.bend:136

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

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

Uses (5)

Used by (1)