def allocator

bendvy-ecs-core@0.1.0.3 · snapshot_data.bend:34

import bendvy-ecs-core@0.1.0.3/snapshot_data.bend as SnapshotData
import Base
import entity_allocator.bend as Alloc
import bendvy-ecs-core@0.1.0.3/world.bend as W

34# Internal experimental accessor: exact actual allocator, no inferred live count.
35# Rebuild the SAME owner with every field returned unchanged.
36def allocator(~S:Data,~C:Type,~R:Type,~E:Data,world:W.World<S,C,R,E>) -> W.World<S,C,R,E> & U32:
37  match world:
38    case W.World{+namespace,Alloc.Allocator{+nextId,+high,slots,+capacity,+depth,+free,+order},store,resource,+events,pending,+registrations,+nextSystemId,+clock,lifecycle}:
39      (W.World{namespace,Alloc.Allocator{nextId,high,slots,capacity,depth,free,order},store,resource,events,pending,registrations,nextSystemId,clock,lifecycle},nextId)

Uses (5)

Used by (1)