AreaFloor()

IF you absolutely need to iterate over a floor in a tight (nested) loop you should use the low/high properties like so.

const floor = area.map.get(2);
for (let x = floor.lowX; x <= floor.highX; x++) {
 for (let y = floor.lowY; y <= floor.highY; y++) {
   const room = floor.getRoom(x, y);

   if (!room) {
     continue;
   }
 }
}

Note the <= to avoid fenceposting the loop

new AreaFloor()

Properties:
Name Type Description
lowX number

The lowest x value

highX number

The highest x value

lowY number

The lowest y value

highY number

The highest y value

z number

This floor's z index

Methods

getRoom() → {Room|boolean}

Returns:
Room | boolean