BWAPI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
BWAPI::UnitType Class Reference

#include <UnitType.h>

Inheritance diagram for BWAPI::UnitType:
Inheritance graph
[legend]
Collaboration diagram for BWAPI::UnitType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UnitType ()
 UnitType (int id)
const std::string & getName () const
const char * c_str () const
Race getRace () const
const std::pair< UnitType, intwhatBuilds () const
const std::map< UnitType, int > & requiredUnits () const
TechType requiredTech () const
TechType cloakingTech () const
const std::set< TechType > & abilities () const
const std::set< UpgradeType > & upgrades () const
UpgradeType armorUpgrade () const
int maxHitPoints () const
int maxShields () const
int maxEnergy () const
int armor () const
int mineralPrice () const
int gasPrice () const
int buildTime () const
int supplyRequired () const
int supplyProvided () const
int spaceRequired () const
int spaceProvided () const
int buildScore () const
int destroyScore () const
UnitSizeType size () const
int tileWidth () const
int tileHeight () const
int dimensionLeft () const
int dimensionUp () const
int dimensionRight () const
int dimensionDown () const
int seekRange () const
int sightRange () const
WeaponType groundWeapon () const
int maxGroundHits () const
WeaponType airWeapon () const
int maxAirHits () const
double topSpeed () const
int acceleration () const
int haltDistance () const
int turnRadius () const
bool canProduce () const
bool canAttack () const
bool canMove () const
bool isFlyer () const
bool regeneratesHP () const
bool isSpellcaster () const
bool hasPermanentCloak () const
bool isInvincible () const
bool isOrganic () const
bool isMechanical () const
bool isRobotic () const
bool isDetector () const
bool isResourceContainer () const
bool isResourceDepot () const
bool isRefinery () const
bool isWorker () const
bool requiresPsi () const
bool requiresCreep () const
bool isTwoUnitsInOneEgg () const
bool isBurrowable () const
bool isCloakable () const
bool isBuilding () const
bool isAddon () const
bool isFlyingBuilding () const
bool isNeutral () const
bool isHero () const
bool isPowerup () const
bool isBeacon () const
bool isFlagBeacon () const
bool isSpecialBuilding () const
bool isSpell () const
bool producesLarva () const
bool isMineralField () const
bool canBuildAddon () const

Detailed Description

The UnitType class is used to get information about a particular type of unit, such as the build time of a Lurker, or the mineral price of an Ultralisk. TODO Add the unittype table from the wiki


Constructor & Destructor Documentation


Member Function Documentation

const std::set< TechType > & BWAPI::UnitType::abilities ( ) const

Returns the set of tech types this unit can use, provided the tech types have been researched and the unit has enough energy.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns how fast the unit can accelerate to its top speed. What units this quantity is measured in is currently unknown.

Here is the call graph for this function:

Returns the unit's air weapon.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the amount of armor the non-upgraded unit type has.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the upgrade that increase's the unit's armor, or UpgradeTypes::None if no upgrade increase's this unit's armor. For example UnitTypes::Terran_Marine.armorUpgrade() will return a pointer to UpgradeTypes::Terran_Infantry_Armor.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the score which is used to determine the total scores in the after-game stats screen.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the number of frames needed to make this unit type.

Here is the call graph for this function:

Here is the caller graph for this function:

const char * BWAPI::UnitType::c_str ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit can attack (either ground or air). Returns false for units that can only inflict damage via special abilities (such as Protoss High Templar).

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is capable of constructing an addon. This consists of Command Center, Factory, Starport, and Science Facility.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::canMove ( ) const

Returns true if the unit can move. Note that buildings will return false, even Terran buildings which can move once lifted.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the 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-building units: Protoss Carrier (can produce interceptors) and Protoss Reaver (can produce scarabs).

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the tech used to cloak the unit, or TechTypes::None if the unit cannot cloak or is permanently cloaked

Here is the call graph for this function:

Returns the score which is used to determine the total scores in the after-game stats screen.

Here is the call graph for this function:

Here is the caller graph for this function:

Distance from the center of the unit to the bottom edge of the unit, measured in pixels.

Here is the call graph for this function:

Here is the caller graph for this function:

Distance from the center of the unit to the left edge of the unit, measured in pixels.

Here is the call graph for this function:

Here is the caller graph for this function:

Distance from the center of the unit to the right edge of the unit, measured in pixels.

Here is the call graph for this function:

Here is the caller graph for this function:

Distance from the center of the unit to the top edge of the unit, measured in pixels.

Here is the call graph for this function:

Here is the caller graph for this function:

UnitTypes::Siege_Tank_Tank_Mode.gasPrice() returns 100.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string & BWAPI::UnitType::getName ( ) const

Returns the name of the unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the race that the unit belongs to. For example UnitTypes::Terran_SCV.getRace() will return Races::Terran.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the unit's ground weapon.

Here is the call graph for this function:

Here is the caller graph for this function:

Related to how fast the unit can halt. What units this quantity is measured in is currently unknown.

Here is the call graph for this function:

Returns true for the two units that are permanently cloaked - Protoss Observer and Protoss Dark Templar.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isAddon ( ) const

Returns true if the unit is an add-on, such as a Terran Comsat Station.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isBeacon ( ) const

Returns true if the unit is a regular Beacon.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is a building (also true for mineral field and vespene geyser).

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for Zerg Lurker and units that can burrow when burrow tech is researched.

Here is the call graph for this function:

Returns true for units that can be cloaked - Terran Ghost and Terran Wraith. Does not include units which have permanent cloak (Protoss Observer and Protoss Dark Templar).

Here is the call graph for this function:

Returns true for the seven units that can detect cloaked units - Terran Science Vessel, Spell Scanner Sweep, Zerg Overlord, Protoss Observer, Terran Missile Turret, Zerg Spore Colony, and Protoss Photon Cannon.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is a flag Beacon.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isFlyer ( ) const

Returns true for flying/air units.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for Terran buildings that can lift off (i.e. Barracks).

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isHero ( ) const

Returns true if the unit is a Hero unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for units that cannot be destroyed (i.e. Terran Nuclear Missile, Mineral Field, Vespene Geyser, etc)

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is mechanical such as a Terran Vulture.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is one of the three mineral field types.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is neutral, such as a critter or mineral field.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is organic, such as a Terran Marine.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is a Powerup unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for Terran Refinery, Zerg Extractor, and Protoss Assimilator.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for the five units that hold resources - Mineral Field, Vespene Geyser, Terran Refinery, Zerg Extractor, and Protoss Assimilator.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for the five units that can accept resources - Terran Command Center, Protoss Nexus, Zerg Hatchery, Zerg Lair, and Zerg Hive.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for the four robotic Protoss units - Probe, Shuttle, Reaver, and Observer.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit is a special building.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isSpell ( ) const

Returns true if the unit is a spell unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit type is capable of casting spells / using technology.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for Zergling and Scourge.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BWAPI::UnitType::isWorker ( ) const

Returns true for Protoss Probe, Terran SCV, and Zerg Drone.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Returns the maximum amount of energy the unit type can have.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Returns the maximum amount of hit points the unit type can have.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the maximum amount of shields the unit type can have.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the mineral price of the unit.

Example: UnitTypes::Siege_Tank_Tank_Mode.mineralPrice() returns 150.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the unit produces larva.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for units that regenerate health (i.e. zerg units).

Here is the call graph for this function:

Here is the caller graph for this function:

Included in the API for completeness, since the only units that actually needs tech to be trained are the Zerg_Lurker and Zerg_Lurker_Egg. The tech type needed is TechTypes::Lurker_Aspect.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::map< UnitType, int > & BWAPI::UnitType::requiredUnits ( ) const

Returns the units the player is required to have before it can train or build the given unit type.

Example: UnitTypes::Terran_Battlecruiser.requiredUnits() will return a map of three keys: UnitTypes::Terran_Starport, UnitTypes::Terran_Control_Tower, and UnitTypes::Terran_Physics_Lab.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for buildings that can only be built on zerg creep.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true for buildings that must be near a pylon to be constructed.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the range at which the unit will start targeting enemy units, measured in pixels.

Here is the call graph for this function:

Returns how far the un-upgraded unit type can see into the fog of war, measured in pixels.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the size of the unit - either Small, Medium, Large, or Independent.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the amount of space this unit type provides.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the amount of space this unit type takes up inside a bunker or transport unit.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the amount of supply produced by this unit (i.e. for a Protoss_Pylon). Supply counts returned by BWAPI are double what you would expect to see from playing the game. This is because zerglings take up 0.5 in-game supply.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the amount of supply used by this unit. Supply counts returned by BWAPI are double what you would expect to see from playing the game. This is because zerglings take up 0.5 in-game supply.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the tile height of the unit. Useful for determining the size of buildings. For example UnitTypes::Terran_Supply_Depot.tileHeight() will return 2.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the tile width of the unit. Useful for determining the size of buildings. For example UnitTypes::Terran_Supply_Depot.tileWidth() will return 3.

Here is the call graph for this function:

Here is the caller graph for this function:

double BWAPI::UnitType::topSpeed ( ) const

Returns the unit's non-upgraded top speed in pixels per frame. For Terran buildings that can lift off and the Zerg Infested Command Center, this returns how fast the building moves when it is lifted.

Here is the call graph for this function:

Here is the caller graph for this function:

Related to how fast the unit can turn. What units this quantity is measured in is currently unknown.

Here is the call graph for this function:

const std::set< UpgradeType > & BWAPI::UnitType::upgrades ( ) const

Returns the set of upgrade types that can affect this unit.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::pair< UnitType, int > BWAPI::UnitType::whatBuilds ( ) const

Returns what builds this unit type. The second number will usually be 1 unless the unit type is Protoss_Archon or Protoss_Dark_Archon. Units that cannot be created, such as critters and mineral fields, will return a pair where the unit type is UnitTypes::None, and the second component is 0.

Example: UnitTypes::Terran_Marine.whatBuilds() will return an std::pair, where the first component is UnitTypes::Terran_Barracks.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines