BWAPI 4.2.0 An API for interacting with Starcraft: Broodwar (1.16.1) |
Public Member Functions | |
constexpr | UnitType (int id=UnitTypes::Enum::None) |
const SetContainer< TechType > & | abilities () const |
int | acceleration () const |
WeaponType | airWeapon () const |
int | armor () const |
UpgradeType | armorUpgrade () const |
int | buildScore () const |
const UnitType::set & | buildsWhat () const |
int | buildTime () const |
bool | canAttack () const |
bool | canBuildAddon () const |
bool | canMove () const |
bool | canProduce () const |
TechType | cloakingTech () const |
int | destroyScore () const |
int | dimensionDown () const |
int | dimensionLeft () const |
int | dimensionRight () const |
int | dimensionUp () const |
int | gasPrice () const |
Race | getRace () const |
WeaponType | groundWeapon () const |
int | haltDistance () const |
bool | hasPermanentCloak () const |
int | height () const |
bool | isAddon () const |
bool | isBeacon () const |
bool | isBuilding () const |
bool | isBurrowable () const |
bool | isCloakable () const |
bool | isCritter () const |
bool | isDetector () const |
bool | isFlagBeacon () const |
bool | isFlyer () const |
bool | isFlyingBuilding () const |
bool | isHero () const |
bool | isInvincible () const |
bool | isMechanical () const |
bool | isMineralField () const |
bool | isNeutral () const |
bool | isOrganic () const |
bool | isPowerup () const |
bool | isRefinery () const |
bool | isResourceContainer () const |
bool | isResourceDepot () const |
bool | isRobotic () const |
bool | isSpecialBuilding () const |
bool | isSpell () const |
bool | isSpellcaster () const |
bool | isSuccessorOf (UnitType type) const |
bool | isTwoUnitsInOneEgg () const |
bool | isWorker () const |
int | maxAirHits () const |
int | maxEnergy () const |
int | maxGroundHits () const |
int | maxHitPoints () const |
int | maxShields () const |
int | mineralPrice () const |
bool | producesCreep () const |
bool | producesLarva () const |
bool | regeneratesHP () const |
TechType | requiredTech () const |
const std::map< UnitType, int > & | requiredUnits () const |
bool | requiresCreep () const |
bool | requiresPsi () const |
const SetContainer< TechType > & | researchesWhat () const |
int | seekRange () const |
int | sightRange () const |
UnitSizeType | size () const |
int | spaceProvided () const |
int | spaceRequired () const |
int | supplyProvided () const |
int | supplyRequired () const |
int | tileHeight () const |
TilePosition | tileSize () const |
int | tileWidth () const |
double | topSpeed () const |
int | turnRadius () const |
const SetContainer< UpgradeType > & | upgrades () const |
const SetContainer< UpgradeType > & | upgradesWhat () const |
const std::pair< UnitType, int > | whatBuilds () const |
int | width () const |
The UnitType is used to get information about a particular type of unit, such as its cost, build time, weapon, hit points, abilities, etc.
UnitTypes::Enum::None
)Expected type constructor.
If the type is an invalid type, then it becomes Types::Unknown. A type is invalid if its value is less than 0 or greater than Types::Unknown.
id | The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown. |
Obtains the source unit type that is used to build or train this unit type, as well as the amount of them that are required.
pair(UnitTypes::None,0) | If this unit type cannot be made by the player. |
Identifies the required TechType in order to create certain units.
TechTypes::None | If creating this unit type does not require a technology to be researched. |
Retrieves the cloaking technology associated with certain units.
TechTypes::None | If this unit type does not have an active cloak ability. |
Retrieves the set of abilities that this unit can use, provided it is available to you in the game.
Retrieves the set of upgrades that this unit can use to enhance its fighting ability.
Retrieves the upgrade type used to increase the armor of this unit type.
For each upgrade, this unit type gains +1 additional armor.
Retrieves the default maximum amount of hit points that this unit type can have.
Retrieves the default maximum amount of shield points that this unit type can have.
0 | If this unit type does not have shields. |
Retrieves the maximum amount of energy this unit type can have by default.
0 | If this unit does not gain energy for abilities. |
Retrieves the default amount of armor that the unit type starts with, excluding upgrades.
Retrieves the default mineral price of purchasing the unit.
Retrieves the default vespene gas price of purchasing the unit.
Retrieves the default time, in frames, needed to train, morph, or build the unit.
Retrieves the amount of supply that this unit type will use when created.
It will use the supply pool that is appropriate for its Race.
Retrieves the amount of space required by this unit type to fit inside a Bunker or Transport(Dropship, Shuttle, Overlord ).
255 | If this unit type can not be transported. |
Retrieves the amount of space provided by this Bunker or Transport(Dropship, Shuttle, Overlord ) for unit transportation.
Retrieves the amount of score points awarded for constructing this unit type.
This value is used for calculating scores in the post-game score screen.
Retrieves the amount of score points awarded for killing this unit type.
This value is used for calculating scores in the post-game score screen.
Retrieves the UnitSizeType of this unit, which is used in calculations along with weapon damage types to determine the amount of damage that will be dealt to this type.
Retrieves the width of this unit type, in tiles.
Used for determining the tile size of structures.
Retrieves the height of this unit type, in tiles.
Used for determining the tile size of structures.
Retrieves the tile size of this unit type.
Used for determining the tile size of structures.
Retrieves the distance from the center of the unit type to its left edge.
Retrieves the distance from the center of the unit type to its top edge.
Retrieves the distance from the center of the unit type to its right edge.
Retrieves the distance from the center of the unit type to its bottom edge.
A macro for retrieving the width of the unit type, which is calculated using dimensionLeft + dimensionRight + 1.
A macro for retrieving the height of the unit type, which is calculated using dimensionUp + dimensionDown + 1.
Retrieves the range at which this unit type will start targeting enemy units.
Retrieves the sight range of this unit type.
Retrieves this unit type's weapon type used when attacking targets on the ground.
Retrieves the maximum number of hits this unit can deal to a ground target using its ground weapon.
This value is multiplied by the ground weapon's damage to calculate the unit type's damage potential.
Retrieves this unit type's weapon type used when attacking targets in the air.
Retrieves the maximum number of hits this unit can deal to a flying target using its air weapon.
This value is multiplied by the air weapon's damage to calculate the unit type's damage potential.
Retrieves this unit type's top movement speed with no upgrades.
Retrieves the unit's acceleration amount.
Retrieves the unit's halting distance.
This determines how fast a unit can stop moving.
Retrieves a unit's turning radius.
This determines how fast a unit can turn.
Determines if a unit can train other units.
For example, UnitTypes::Terran_Barracks.canProduce() will return true, while UnitTypes::Terran_Marine.canProduce() will return false. This is also true for two non-structures: Carrier (can produce interceptors) and Reaver (can produce scarabs).
Checks if this unit is capable of attacking.
Checks if this unit type is capable of movement.
Checks if this unit type is a flying unit.
Flying units ignore ground pathing and collisions.
Checks if this unit type can regenerate hit points.
This generally applies to Zerg units.
Checks if this unit type has the capacity to store energy and use it for special abilities.
Checks if this unit type is permanently cloaked.
This means the unit type is always cloaked and requires a detector in order to see it.
Checks if this unit type is invincible by default.
Invincible units cannot take damage.
Checks if this unit is an organic unit.
The organic property is required for some abilities such as Heal.
Checks if this unit is mechanical.
The mechanical property is required for some actions such as Repair.
Checks if this unit type is capable of detecting units that are cloaked or burrowed.
Checks if this unit type is capable of storing resources such as Mineral Fields.
Resources are harvested from resource containers.
Checks if this unit type is a resource depot.
Resource depots must be placed a certain distance from resources. Resource depots are typically the main building for any particular race. Workers will return resources to the nearest resource depot.
Example:
Checks if this unit type is a refinery.
A refinery is a structure that is placed on top of a Vespene Geyser . Refinery types are Refinery , Extractor , and Assimilator.
Example:
Checks if this structure is powered by a psi field.
Structures powered by psi can only be placed near a Pylon. If the Pylon is destroyed, then this unit will lose power.
Checks if this structure must be placed on Zerg creep.
Checks if this unit type has the capability to use the Burrow technology when it is researched.
Checks if this unit is a structure.
This includes Mineral Fields and Vespene Geysers.
Checks if this unit is an add-on.
Add-ons are attachments used by some Terran structures such as the Comsat Station.
Checks if this structure has the capability to use the lift-off command.
Checks if this unit type is a neutral type, such as critters and resources.
Checks if this unit type is a hero.
Heroes are types that the player cannot obtain normally, and are identified by the white border around their icon when selected with a group.
Checks if this unit type is a powerup.
Powerups can be picked up and carried by workers. They are usually only seen in campaign maps and Capture the Flag.
Checks if this unit type is a beacon.
Each race has exactly one beacon each. They are UnitTypes::Special_Zerg_Beacon, UnitTypes::Special_Terran_Beacon, and UnitTypes::Special_Protoss_Beacon.
Checks if this unit type is a flag beacon.
Each race has exactly one flag beacon each. They are UnitTypes::Special_Zerg_Flag_Beacon, UnitTypes::Special_Terran_Flag_Beacon, and UnitTypes::Special_Protoss_Flag_Beacon. Flag beacons spawn a Flag after some ARBITRARY I FORGOT AMOUNT OF FRAMES.
Checks if this structure is special and cannot be obtained normally within the game.
Identifies if this unit type is used to complement some abilities.
These include UnitTypes::Spell_Dark_Swarm, UnitTypes::Spell_Disruption_Web, and UnitTypes::Spell_Scanner_Sweep, which correspond to TechTypes::Dark_Swarm, TechTypes::Disruption_Web, and TechTypes::Scanner_Sweep respectively.
Checks if this structure type produces creep.
That is, the unit type spreads creep over a wide area so that Zerg structures can be placed on it.
Checks if this unit type produces larva.
This is essentially used to check if the unit type is a Hatchery, Lair, or Hive.
Checks if this unit type is a mineral field and contains a resource amount.
This indicates that the unit type is either UnitTypes::Resource_Mineral_Field, UnitTypes::Resource_Mineral_Field_Type_2, or UnitTypes::Resource_Mineral_Field_Type_3.
Checks if this unit type is a neutral critter.
Example usage:
Checks if this unit type is capable of constructing an add-on.
An add-on is an extension or attachment for Terran structures, specifically the Command Center, Factory, Starport, and Science Facility.
Retrieves the set of units that this unit type is capable of creating.
This includes training, constructing, warping, and morphing.
Retrieves the set of technologies that this unit type is capable of researching.
Retrieves the set of upgrades that this unit type is capable of upgrading.
Checks if the current type is equal to the provided type, or a successor of the provided type.
For example, a Hive is a successor of a Hatchery, since it can still research the Burrow technology.
type | The unit type to check. |