SC2API
An API for AI for StarCraft II
|
Data about a unit type. This data is derived from the catalog (xml) data of the game and upgrades. More...
#include <sc2_data.h>
Public Member Functions | |
UnitTypeData () | |
Constructor. | |
void | ReadFromProto (const SC2APIProtocol::UnitTypeData &unit_data) |
std::string | Log () const |
Serialize this unit type to a string. | |
Public Attributes | |
UnitTypeID | unit_type_id |
Stable ID. This ID will not change between patches. | |
std::string | name |
Unit type name, corresponds to the game's catalog. | |
bool | available |
If true, the unit is available to the current mods/map. | |
uint32_t | cargo_size |
Number of cargo slots they occupy in a transport. | |
int | mineral_cost |
Cost in minerals to build this unit type. | |
int | vespene_cost |
Cost in vespene to build this unit type. | |
std::vector< Attribute > | attributes |
Unit attributes, may change based on upgrades. | |
float | movement_speed |
Movement speed of unit type. | |
float | armor |
Armor of unit type. | |
std::vector< Weapon > | weapons |
Weapons on this unit type. | |
float | food_required |
How much food the unit requires. | |
float | food_provided |
How much food the unit provides. | |
AbilityID | ability_id |
Which ability id creates the unit. | |
Race | race |
The race the unit belongs to. | |
float | build_time |
How long the unit takes to build. | |
bool | has_minerals |
Whether the unit can have minerals (mineral patches). | |
bool | has_vespene |
Whether the unit can have vespene (vespene geysers). | |
float | sight_range |
Range the unit reveals vision. | |
std::vector< UnitTypeID > | tech_alias |
Units this is equivalent to in terms of satisfying tech requirements. | |
UnitTypeID | unit_alias |
Units that are morphed variants of the same unit. | |
UnitTypeID | tech_requirement |
Structure required to build this unit. (Or any with the same tech_alias) | |
bool | require_attached |
Whether tech_requirement is an add-on. | |
Data about a unit type. This data is derived from the catalog (xml) data of the game and upgrades.
void sc2::UnitTypeData::ReadFromProto | ( | const SC2APIProtocol::UnitTypeData & | unit_data | ) |
Serialize this ability entry from the .proto file (used internally).
unit_data | The proto entry for this ability. |