![]() |
SC2API
An API for AI for StarCraft II
|
A unit. Could be a structure, a worker or a military unit. More...
#include <sc2_unit.h>
Public Types | |
| enum | DisplayType { Visible = 1, Snapshot = 2, Hidden = 3 } |
| If the unit is shown on screen or not. More... | |
| enum | Alliance { Self = 1, Ally = 2, Neutral = 3, Enemy = 4 } |
| Relationship to this player. More... | |
| enum | CloakState { Cloaked = 1, CloakedDetected = 2, NotCloaked = 3, Unknown = 4 } |
| Unit cloak state. More... | |
Public Attributes | |
| DisplayType | display_type |
| If the unit is shown on screen or not. | |
| Alliance | alliance |
| Relationship of the unit to this player. | |
| Tag | tag |
| A unique identifier for the instance of a unit. | |
| UnitTypeID | unit_type |
| An identifier of the type of unit. | |
| int | owner |
| Which player owns a unit. | |
| Point3D | pos |
| Position of the unit in the world. | |
| float | facing |
| Direction the unit faces in radians (1 radian == 57.296 degrees) | |
| float | radius |
| Radius of the unit. | |
| float | build_progress |
| Gives progress under construction. Range: [0.0, 1.0]. 1.0 == finished. | |
| CloakState | cloak |
| If the unit is cloaked. | |
| float | detect_range |
| Range of detector for detector units. | |
| float | radar_range |
| Range of radar for units that are radar units. | |
| bool | is_selected |
| If the unit is in the current selection of the player. | |
| bool | is_on_screen |
| Visible and within the camera frustum. | |
| bool | is_blip |
| Detected by sensor tower. | |
| float | health |
| Health of the unit. Not set for snapshots. | |
| float | health_max |
| Max health for the unit. Not set for snapshots. | |
| float | shield |
| Shield of the unit. Not set for snapshots. | |
| float | shield_max |
| Max shield of the unit. Not set for snapshots. | |
| float | energy |
| Energy of the unit. Not set for snapshots. | |
| float | energy_max |
| Max energy of the unit. Not set for snapshots. | |
| int | mineral_contents |
| Amount of minerals if the unit is a mineral field. Not set for snapshots. | |
| int | vespene_contents |
| Amount of vespene if the unit is a geyser. Not set for snapshots. | |
| bool | is_flying |
| If the unit is flying. Not set for snapshots. | |
| bool | is_burrowed |
| If the unit is burrowed. Not set for snapshots. | |
| float | weapon_cooldown |
| Time remaining for a weapon on cooldown. Not set for snapshots. | |
| std::vector< UnitOrder > | orders |
| Orders on a unit. Only valid for this player's units. | |
| Tag | add_on_tag |
| Add-on like a tech lab or reactor. Only valid for this player's units. | |
| std::vector< PassengerUnit > | passengers |
| Passengers in this transport. Only valid for this player's units. | |
| int | cargo_space_taken |
| Number of cargo slots used in the transport. Only valid for this player's units. | |
| int | cargo_space_max |
| Number of cargo slots available for a transport. Only valid for this player's units. | |
| int | assigned_harvesters |
| Number of harvesters associated with a town hall (e.g., Command Center). Only valid for this player's units. | |
| int | ideal_harvesters |
| Number of harvesters that can be assigned to a town hall (e.g., Command Center). Only valid for this player's units. | |
| Tag | engaged_target_tag |
| Target unit of a unit. Only valid for this player's units. | |
| std::vector< BuffID > | buffs |
| Buffs on this unit. Only valid for this player's units. | |
| bool | is_powered |
| Whether the unit is powered by a pylon. | |
| bool | is_alive |
| Whether the unit is alive or not. | |
| uint32_t | last_seen_game_loop |
| The last time the unit was seen. | |
A unit. Could be a structure, a worker or a military unit.
| enum sc2::Unit::Alliance |
Unit cloak state.
| Enumerator | |
|---|---|
| Cloaked |
Cloaked, invisible to enemies until detected. |
| CloakedDetected |
Cloaked enemy, but detected. |
| NotCloaked |
No cloaking. |
| Unknown |
Could not determine cloaking state. |
1.8.11