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:
java.lang.Iterable<T>
,java.util.Collection<T>
public class LocatableEntityQueryResult<T extends LocatableEntity> extends QueryResult<T>
-
-
Field Summary
-
Fields inherited from class com.epicbot.api.shared.query.result.QueryResult
ctx
-
-
Constructor Summary
Constructors Constructor Description LocatableEntityQueryResult(java.util.List<T> objects, APIContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
nearest()
T
nearest(double near, double diff)
java.util.List<T>
nearestList()
T
nearestTo(Locatable locatable)
T
nearestTo(Locatable locatable, double near, double diff)
Gets the nearest entity with allowed variation.LocatableEntityQueryResult<T>
sort(Tile tile)
-
Methods inherited from class com.epicbot.api.shared.query.result.QueryResult
add, addAll, clear, contains, containsAll, first, isEmpty, iterator, last, limit, limit, random, remove, removeAll, retainAll, reverse, shuffle, size, sort, toArray, toArray, toList
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
LocatableEntityQueryResult
public LocatableEntityQueryResult(java.util.List<T> objects, APIContext ctx)
-
-
Method Detail
-
nearest
public T nearest()
-
nearest
public T nearest(double near, double diff)
-
nearestTo
public T nearestTo(Locatable locatable, double near, double diff)
Gets the nearest entity with allowed variation. The entity list is shuffled first.- 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 java.util.List<T> nearestList()
-
sort
public LocatableEntityQueryResult<T> sort(Tile tile)
-
-