public interface ObservationInterface
Modifier and Type | Method | Description |
---|---|---|
java.util.Map<Ability,AbilityData> |
getAbilityData(boolean forceRefresh) |
Gets metadata of abilities.
|
int |
getArmyCount() |
The number of army units.
|
java.util.Map<Buff,BuffData> |
getBuffData(boolean forceRefresh) |
Gets metadata of buffs.
|
Point |
getCameraPos() |
Position of the center of the camera.
|
java.util.List<ChatReceived> |
getChatMessages() |
Gets new chat messages.
|
java.util.Map<Effect,EffectData> |
getEffectData(boolean forceRefresh) |
Gets metadata of effects.
|
java.util.List<EffectLocations> |
getEffects() |
Gets all active effects in vision of the current player.
|
java.util.List<ActionSpatial> |
getFeatureLayerActions() |
Gets a list of actions performed.
|
int |
getFoodArmy() |
The total supply consumed by army units alone.
|
int |
getFoodCap() |
The total supply cap given the players max possible supply.
|
int |
getFoodUsed() |
The total supply used by the player as defined: getFoodArmy() + getFoodWorkers().
|
int |
getFoodWorkers() |
The total supply consumed by workers units alone.
|
ResponseGameInfo |
getGameInfo() |
Gets the GameInfo struct for the current map.
|
long |
getGameLoop() |
Get the current game loop for this observation.
|
int |
getIdleWorkerCount() |
The number of workers that currently have no orders.
|
int |
getMinerals() |
The mineral count of the player.
|
int |
getPlayerId() |
Gets a unique ID that represents the player.
|
java.util.List<PowerSource> |
getPowerSources() |
Gets all power sources associated with the current player.
|
java.util.List<ActionRaw> |
getRawActions() |
Gets a list of actions performed as abilities applied to units.
|
Observation |
getRawObservation() |
A pointer to the low-level protocol data for the current observation.
|
java.util.List<ActionSpatial> |
getRenderedActions() |
Gets a list of actions performed.
|
java.util.List<PlayerResult> |
getResults() |
Gets the results of the game.
|
Score |
getScore() |
Gets the detailed current set of scores.
|
Point |
getStartLocation() |
Gets the initial start location of the player.
|
UnitInPool |
getUnit(Tag tag) |
Get the unit state as represented by the last call to getObservation.
|
java.util.List<UnitInPool> |
getUnits() |
Get a list of all known units in the game.
|
java.util.List<UnitInPool> |
getUnits(Alliance alliance) |
|
java.util.List<UnitInPool> |
getUnits(Alliance alliance,
java.util.function.Predicate<UnitInPool> filter) |
Get all units belonging to a certain alliance and meet the conditions provided by the filter.
|
java.util.List<UnitInPool> |
getUnits(java.util.function.Predicate<UnitInPool> filter) |
Get all units belonging to self that meet the conditions provided by the filter.
|
java.util.Map<UnitType,UnitTypeData> |
getUnitTypeData(boolean forceRefresh) |
Gets metadata of units.
|
java.util.Map<Upgrade,UpgradeData> |
getUpgradeData(boolean forceRefresh) |
Gets metadata of upgrades.
|
java.util.List<Upgrade> |
getUpgrades() |
Gets all upgrades.
|
int |
getVespene() |
The vespene count of the player.
|
Visibility |
getVisibility(Point2d point) |
Returns visibility value of the given point for the current player.
|
int |
getWarpGateCount() |
Number of warp gates owned by the player.
|
boolean |
hasCreep(Point2d point) |
Returns 'true' if the given point has creep.
|
boolean |
isPathable(Point2d point) |
Returns 'true' if the given point on the terrain is pathable.
|
boolean |
isPlacable(Point2d point) |
Returns 'true' if the given point on the terrain is buildable.
|
float |
terrainHeight(Point2d point) |
Returns terrain height of the given point.
|
int getPlayerId()
long getGameLoop()
java.util.List<UnitInPool> getUnits()
java.util.List<UnitInPool> getUnits(Alliance alliance, java.util.function.Predicate<UnitInPool> filter)
alliance
- The faction the units belong to.filter
- A functor or lambda used to filter out any unneeded units in the list.java.util.List<UnitInPool> getUnits(Alliance alliance)
getUnits(Alliance, Predicate)
java.util.List<UnitInPool> getUnits(java.util.function.Predicate<UnitInPool> filter)
filter
- A functor or lambda used to filter out any unneeded units in the list.UnitInPool getUnit(Tag tag)
tag
- Unique tag of the unit.java.util.List<ActionRaw> getRawActions()
java.util.List<ActionSpatial> getFeatureLayerActions()
java.util.List<ActionSpatial> getRenderedActions()
java.util.List<ChatReceived> getChatMessages()
java.util.List<PowerSource> getPowerSources()
java.util.List<EffectLocations> getEffects()
java.util.List<Upgrade> getUpgrades()
Score getScore()
java.util.Map<Ability,AbilityData> getAbilityData(boolean forceRefresh)
forceRefresh
- forces a full query from the game, may otherwise cache data from a previous call.java.util.Map<UnitType,UnitTypeData> getUnitTypeData(boolean forceRefresh)
forceRefresh
- forces a full query from the game, may otherwise cache data from a previous call.java.util.Map<Upgrade,UpgradeData> getUpgradeData(boolean forceRefresh)
forceRefresh
- forces a full query from the game, may otherwise cache data from a previous call.java.util.Map<Buff,BuffData> getBuffData(boolean forceRefresh)
forceRefresh
- forces a full query from the game, may otherwise cache data from a previous call.java.util.Map<Effect,EffectData> getEffectData(boolean forceRefresh)
forceRefresh
- forces a full query from the game, may otherwise cache data from a previous call.ResponseGameInfo getGameInfo()
int getMinerals()
int getVespene()
int getFoodCap()
getFoodUsed()
,
getFoodArmy()
,
getFoodWorkers()
int getFoodUsed()
getFoodArmy()
,
getFoodWorkers()
int getFoodArmy()
getFoodUsed()
,
getFoodWorkers()
int getFoodWorkers()
getFoodArmy()
,
getFoodUsed()
int getIdleWorkerCount()
int getArmyCount()
int getWarpGateCount()
Point getCameraPos()
Point getStartLocation()
java.util.List<PlayerResult> getResults()
boolean hasCreep(Point2d point)
point
- Position to sample.Visibility getVisibility(Point2d point)
point
- Position to sample.boolean isPathable(Point2d point)
point
- Position to sample.boolean isPlacable(Point2d point)
point
- Position to sample.float terrainHeight(Point2d point)
point
- Position to sample.Observation getRawObservation()
ControlInterface.getObservation()
Copyright © 2017–2018 Ocraft Project. All rights reserved.