public interface QueryInterface
Performance note: - Always try and batch things up. These queries are effectively synchronous and will block until returned.
Modifier and Type | Method | Description |
---|---|---|
default java.util.List<Point> |
calculateExpansionLocations(ObservationInterface observation) |
|
default java.util.List<Point> |
calculateExpansionLocations(ObservationInterface observation,
DebugInterface debug) |
|
default java.util.List<Point> |
calculateExpansionLocations(ObservationInterface observation,
DebugInterface debug,
ExpansionParameters parameters) |
Calculates expansion locations, this call can take on the order of 100ms since it makes blocking queries to SC2
so call it once and cache the results.
|
static java.util.Map<Point,java.util.List<UnitInPool>> |
cluster(java.util.List<UnitInPool> units,
double distanceApart) |
Clusters units within some distance of each other and returns a list of them and their center of mass.
|
AvailableAbilities |
getAbilitiesForUnit(Unit unit,
boolean ignoreResourceRequirements) |
Returns a list of abilities represented as a AvailableAbilities see the Abilities enum for their corresponding,
named, representations.
|
java.util.List<AvailableAbilities> |
getAbilitiesForUnits(java.util.List<Unit> units,
boolean ignoreResourceRequirements) |
Issues multiple available abilities queries.
|
float |
pathingDistance(Point2d start,
Point2d end) |
Returns pathing distance between two locations.
|
float |
pathingDistance(Unit start,
Point2d end) |
Returns pathing distance between a unit and a target location.
|
java.util.List<java.lang.Float> |
pathingDistance(java.util.List<QueryPathing> queries) |
Issues multiple pathing queries.
|
boolean |
placement(Ability ability,
Point2d target) |
|
boolean |
placement(Ability ability,
Point2d target,
Unit unit) |
Returns whether a building can be placed at a location.
|
java.util.List<java.lang.Boolean> |
placement(java.util.List<QueryBuildingPlacement> queries) |
A batch version of the above Placement query.
|
AvailableAbilities getAbilitiesForUnit(Unit unit, boolean ignoreResourceRequirements)
unit
- Unit.ignoreResourceRequirements
- Ignores food, mineral and gas costs, as well as cooldowns.java.util.List<AvailableAbilities> getAbilitiesForUnits(java.util.List<Unit> units, boolean ignoreResourceRequirements)
units
- Units.ignoreResourceRequirements
- Ignores food, mineral and gas costs, as well as cooldowns.float pathingDistance(Point2d start, Point2d end)
start
- Starting point.end
- End point.float pathingDistance(Unit start, Point2d end)
start
- Starting points.end
- End points.java.util.List<java.lang.Float> pathingDistance(java.util.List<QueryPathing> queries)
boolean placement(Ability ability, Point2d target)
placement(Ability, Point2d, Unit)
boolean placement(Ability ability, Point2d target, Unit unit)
ability
- Ability for building or moving a structure.target
- Position to attempt placement on.unit
- (Optional) The unit that is moving, if moving a structure.java.util.List<java.lang.Boolean> placement(java.util.List<QueryBuildingPlacement> queries)
queries
- Placement queries.default java.util.List<Point> calculateExpansionLocations(ObservationInterface observation, DebugInterface debug, ExpansionParameters parameters)
debug
- If filled out CalculateExpansionLocations will render spheres to show what it calculated.default java.util.List<Point> calculateExpansionLocations(ObservationInterface observation)
default java.util.List<Point> calculateExpansionLocations(ObservationInterface observation, DebugInterface debug)
static java.util.Map<Point,java.util.List<UnitInPool>> cluster(java.util.List<UnitInPool> units, double distanceApart)
Copyright © 2017–2018 Ocraft Project. All rights reserved.