def allocator

bendvy-ecs-core@0.1.0.4 · snapshot_data.bend:33

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

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

Uses (5)

Used by (1)