lib/roomie.js
// aspect ratio, and doesn't overlap existing level
aspect ratio, and doesn't overlap existing level
aspect ratio and doesn ' t overlap existing level
_getLargestBuildableRoom(minSize, maxSize, roomAspectRatio) {
    const largestRoom = this.level.findLargestRoom(this.doorPosition, this.direction, maxSize)
    if (!largestRoom) {
      return null
    }
    if ((largestRoom.width / largestRoom.height) < roomAspectRatio) {
      console.log('couldnt build the room with the given aspect ratio. try use a smaller aspect ratio in the design file')
      return null
    }
    if ((largestRoom.height * largestRoom.width) >= minSize) {
      return largestRoom
    }
    return null
  }
_getLargestBuildableRoom ( minSize , maxSize , roomAspectRatio ) { const largestRoom = this . level . findLargestRoom ( this . doorPosition , this . direction , maxSize ) if ( ! largestRoom ) { return null } if ( ( largestRoom . width / largestRoom . height ) < roomAspectRatio ) { console . log ( 'couldnt build the room with the given aspect ratio. try use a smaller aspect ratio in the design file' ) return null } if ( ( largestRoom . height * largestRoom . width ) >= minSize ) { return largestRoom } return null }
aspect ratio, and doesn't overlap existing level
aspect ratio and doesn ' t overlap existing level
// determine the largest room that fits at the given level position // we can build the room // room is too small