Class LocatableEntityQueryResult<T extends LocatableEntity>

java.lang.Object
com.epicbot.api.shared.query.result.QueryResult<T>
com.epicbot.api.shared.query.result.LocatableEntityQueryResult<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>

public class LocatableEntityQueryResult<T extends LocatableEntity> extends QueryResult<T>
  • Constructor Details

  • Method Details

    • chebyshev

      public LocatableEntityQueryResult<T> chebyshev()
      Sets the distance function to Chebyshev, which is the same as tile distance.
      Returns:
      this
      See Also:
    • euclidean

      public LocatableEntityQueryResult<T> euclidean()
      Sets the distance function to Euclidean, which is the straight-line distance between two points.
      Returns:
      this
      See Also:
    • nearest

      public T nearest()
    • nearest

      public T nearest(double near, double diff)
      Get the nearest entity with allowed variation.
      Parameters:
      near - the minimum distance before variation is considered (e.g. when near is 5 and diff is 1, an object with distance 6 is allowed)
      diff - the allowed difference between closest and current object being considered
      Returns:
    • nearestTo

      public T nearestTo(Locatable locatable)
    • nearestTo

      public T nearestTo(Locatable locatable, double near, double diff)
      Gets the nearest entity with allowed variation.
      Parameters:
      near - the minimum distance before variation is considered (e.g. when near is 5 and diff is 1, an object with distance 6 is allowed)
      diff - the allowed difference between closest and current object being considered
      Returns:
      the nearest entity with allowed variation
    • nearestList

      public List<T> nearestList()
    • sort

      public LocatableEntityQueryResult<T> sort(Tile tile)