index.js
// get list of all adjacent but unconnected rooms
get list of all adjacent but unconnected rooms
get list of all adjacent but unconnected rooms
_getAdjacentRooms(room) {
    const results = []
    if (room.prefab) {
      return results
    }
    const rooms = this.objects.filter(o => o.type === 'room')
    for (let next of Array.from(rooms)) {
      if (!next.prefab) {
        if (next.id !== room.id) {
          if (!this._roomsAreConnected(room, next)) {
            const doorPosition = this._getAdjacentRoomDoorPosition(room, next)
            if (doorPosition) {
              results.push({room: next, doorPosition })
            }
          }
        }
      }
    }
    return results
  }
_getAdjacentRooms ( room ) { const results = [ ] if ( room . prefab ) { return results } const rooms = this . objects . filter ( o => o . type === 'room' ) for ( let next of Array . from ( rooms ) ) { if ( ! next . prefab ) { if ( next . id !== room . id ) { if ( ! this . _roomsAreConnected ( room , next ) ) { const doorPosition = this . _getAdjacentRoomDoorPosition ( room , next ) if ( doorPosition ) { results . push ( { room : next , doorPosition } ) } } } } } return results }
get list of all adjacent but unconnected rooms
get list of all adjacent but unconnected rooms
// don't connect from prefab rooms // don't connect to prefab rooms