example/bundle.js
// determine if all prefabs are reachable from each other
determine if all prefabs are reachable from each other
determine if all prefabs are reachable from each other
_isFullyConnected() {
    const prefabs = []
    const rooms = this.objects.filter(o => o.type === 'room')
    for (let room of Array.from(rooms)) {
      if (room.prefab) {
        prefabs.push(room)
      }
    }
    if (!(prefabs.length > 1)) { return true }
    for (let prefabA of Array.from(prefabs)) {
      for (let prefabB of Array.from(prefabs)) {
        if (prefabA.id > prefabB.id) {
          if (!this._isConnected(prefabA, prefabB)) {
            return false
          }
        }
      }
    }
    return true
  }
_isFullyConnected ( ) { const prefabs = [ ] const rooms = this . objects . filter ( o => o . type === 'room' ) for ( let room of Array . from ( rooms ) ) { if ( room . prefab ) { prefabs . push ( room ) } } if ( ! ( prefabs . length > 1 ) ) { return true } for ( let prefabA of Array . from ( prefabs ) ) { for ( let prefabB of Array . from ( prefabs ) ) { if ( prefabA . id > prefabB . id ) { if ( ! this . _isConnected ( prefabA , prefabB ) ) { return false } } } } return true }
determine if all prefabs are reachable from each other
determine if all prefabs are reachable from each other