EntityAllocator.restore_room_join: def of bendvy-ecs-core@0.1.0.3 Import: import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as EntityAllocator Lines 162-165 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=162&end_line=165 import Base import entity_key.bend as K def restore_room_join(+floor:U32,needed:Nat,observed:Allocator & List<&2,K.Key>) -> Allocator & Bool: match observed: case (Allocator{+next,+high,slots,+capacity,+depth,+free,+order},live): (Allocator{next,high,slots,capacity,depth,free,order},Bool.and(Bool.and(U32.is_lt(0,floor),U32.is_le(floor,131073)),Nat.is_le(needed,Nat.add(Nat.add(count_keys(live),count_free(free)),U32.to_nat(U32.sub(131073,U32.max(next,floor))))))) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le 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.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat 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=count_free https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_allocator.bend&name=count_keys https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/entity_key.bend&name=Key