EntityAllocator.reserve_fresh: def of bendvy-ecs-core@0.1.0.3 Import: import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as EntityAllocator Lines 90-94 of bendvy-ecs-core@0.1.0.3/entity_allocator.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&start_line=90&end_line=94 import Base import entity_key.bend as K def reserve_fresh(available:Bool,grow:Bool,allocator:Allocator) -> Allocator & Reservation: match available grow allocator: case False{} _ allocator:(allocator,Exhausted{}) case True{} False{} Allocator{+next,_,slots,+capacity,+depth,free,order}:(Allocator{(next + 1 : U32),next,Array.set(Slot,slots,next,Slot{0,Consumed{}}),capacity,depth,free,List.append(&2,K.Key,order,[K.EntityKey{next,0}])},Reserved{K.EntityKey{next,0}}) case True{} True{} Allocator{+next,_,slots,+capacity,+depth,free,order}:(Allocator{(next + 1 : U32),next,Array.set(Slot,ANode{slots,Array.new(Slot,depth,Slot{0,Consumed{}})},next,Slot{0,Consumed{}}),(capacity * 2 : U32),1n+depth,free,List.append(&2,K.Key,order,[K.EntityKey{next,0}])},Reserved{K.EntityKey{next,0}}) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.new https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&name=Allocator https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&name=Phase https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&name=Reservation https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&name=Slot https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_key.bend&name=Key