#include <sc2_interfaces.h>
The QueryInterface provides additional data not contained in the observation.
Performance note:
- Always try and batch things up. These queries are effectively synchronous and will block until returned.
virtual AvailableAbilities sc2::QueryInterface::GetAbilitiesForUnit |
( |
const Unit * |
unit, |
|
|
bool |
ignore_resource_requirements = false |
|
) |
| |
|
pure virtual |
Returns a list of abilities represented as a uint32_t see the ABILITY_ID enum for their corresponding, named, representations.
- Parameters
-
tag | Tag of unit. |
ignore_resource_requirements | Ignores food, mineral and gas costs, as well as cooldowns. |
- Returns
- Abilities for the unit.
virtual std::vector<AvailableAbilities> sc2::QueryInterface::GetAbilitiesForUnits |
( |
const Units & |
units, |
|
|
bool |
ignore_resource_requirements = false |
|
) |
| |
|
pure virtual |
Issues multiple available abilities queries. Batch version.
- Parameters
-
tag | Tags of units. |
ignore_resource_requirements | Ignores food, mineral and gas costs, as well as cooldowns. |
- Returns
- Abilities for the units.
virtual float sc2::QueryInterface::PathingDistance |
( |
const Point2D & |
start, |
|
|
const Point2D & |
end |
|
) |
| |
|
pure virtual |
Returns pathing distance between two locations. Takes into account unit movement properties (e.g. Flying).
- Parameters
-
start | Starting point. |
end | End point. |
- Returns
- Distance between the two points.
virtual float sc2::QueryInterface::PathingDistance |
( |
const Unit * |
start, |
|
|
const Point2D & |
end |
|
) |
| |
|
pure virtual |
Returns pathing distance between a unit and a target location. Takes into account unit movement properties (e.g. Flying). Batch version.
- Parameters
-
start | Starting points. |
end | End points. |
- Returns
- Distances between the two points.
virtual bool sc2::QueryInterface::Placement |
( |
const AbilityID & |
ability, |
|
|
const Point2D & |
target_pos, |
|
|
const Unit * |
unit = nullptr |
|
) |
| |
|
pure virtual |
Returns whether a building can be placed at a location. The placing unit field is optional. This is only used for cases where the placing unit plays a role in the placement grid test (e.g. A flying barracks building an add-on requires room for both the barracks and add-on).
- Parameters
-
ability | Ability for building or moving a structure. |
end | target_pos Position to attempt placement on. |
placing_unit_tag_ | (Optional) The unit that is moving, if moving a structure. |
- Returns
- If placement is possible.
virtual std::vector<bool> sc2::QueryInterface::Placement |
( |
const std::vector< PlacementQuery > & |
queries | ) |
|
|
pure virtual |
A batch version of the above Placement query. Takes an array of abilities, positions and optional unit tags and returns a matching array of bools indicating if placement is possible.
- Parameters
-
queries | Placement queries. |
- Returns
- Array of bools indicating if placement is possible.
The documentation for this class was generated from the following file: