def restore_room_join

bendvy-ecs-core@0.1.0.3 · entity_allocator.bend:162

import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as EntityAllocator
import Base
import entity_key.bend as K

162def restore_room_join(+floor:U32,needed:Nat,observed:Allocator & List<&2,K.Key>) -> Allocator & Bool:
163  match observed:
164    case (Allocator{+next,+high,slots,+capacity,+depth,+free,+order},live):
165      (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)

Used by (1)