findTilesInDistanceOf (tile, radius, moveCosts) {
    let multipliers = moveCosts ? moveCosts : this.multipliers
    
    var heap = new Heap([],
      (a, b) => a.distance === b.distance,
      (a, b) => b.distance - a.distance)
    var found = new Set()
    var used = new Set()
    used.add(tile)

    heap.push(this.encapsule(tile, 0))

    while (heap.length > 0) {
      var capsule = heap.pop()

      if (capsule.distance === radius) continue

      var tiles = this.tilesNextTo(capsule.tile)
      for (let tile of tiles) {
        if (used.has(tile)) continue

        let distanceTo = capsule.distance + multipliers[tile.tileType.name]
        if (distanceTo <= radius) {
          var encapsuled = this.encapsule(tile, distanceTo)
          heap.push(encapsuled)
          found.add(encapsuled)
          used.add(tile)
        }
      }
    }

    return found
  }
/**
   * Finds tiles in distance radius of given tile. Gives them back as set of
   * capsules, which hold the tile and the distance to the tile
   *
   * @param {*} tile from which
   * @param {*} radius in distance
   */
Finds tiles in distance radius of given tile. Gives them back as set of
capsules, which hold the tile and the distance to the tile

@param {*} tile from which
@param {*} radius in distance
Finds tiles in distance radius of given tile . Gives them back as set of capsules which hold the tile and the distance to the tile @param { * } tile from which @param { * } radius in distance
findTilesInDistanceOf (tile, radius, moveCosts) {
    let multipliers = moveCosts ? moveCosts : this.multipliers
    var heap = new Heap([],
      (a, b) => a.distance === b.distance,
      (a, b) => b.distance - a.distance)
    var found = new Set()
    var used = new Set()
    used.add(tile)
    heap.push(this.encapsule(tile, 0))
    while (heap.length > 0) {
      var capsule = heap.pop()
      if (capsule.distance === radius) continue
      var tiles = this.tilesNextTo(capsule.tile)
      for (let tile of tiles) {
        if (used.has(tile)) continue
        let distanceTo = capsule.distance + multipliers[tile.tileType.name]
        if (distanceTo <= radius) {
          var encapsuled = this.encapsule(tile, distanceTo)
          heap.push(encapsuled)
          found.add(encapsuled)
          used.add(tile)
        }
      }
    }
    return found
  }
findTilesInDistanceOf ( tile , radius , moveCosts ) { let multipliers = moveCosts ? moveCosts : this . multipliers var heap = new Heap ( [ ] , ( a , b ) => a . distance === b . distance , ( a , b ) => b . distance - a . distance ) var found = new Set ( ) var used = new Set ( ) used . add ( tile ) heap . push ( this . encapsule ( tile , 0 ) ) while ( heap . length > 0 ) { var capsule = heap . pop ( ) if ( capsule . distance === radius ) continue var tiles = this . tilesNextTo ( capsule . tile ) for ( let tile of tiles ) { if ( used . has ( tile ) ) continue let distanceTo = capsule . distance + multipliers [ tile . tileType . name ] if ( distanceTo <= radius ) { var encapsuled = this . encapsule ( tile , distanceTo ) heap . push ( encapsuled ) found . add ( encapsuled ) used . add ( tile ) } } } return found }
Finds tiles in distance radius of given tile.
Finds tiles in distance radius of given tile .