BWAPI  4.2.0
An API for interacting with Starcraft: Broodwar (1.16.1)
Public Member Functions | List of all members
BWAPI::UpgradeType Class Reference
Inheritance diagram for BWAPI::UpgradeType:
Inheritance graph

Public Member Functions

constexpr UpgradeType (int id=UpgradeTypes::Enum::None)
int gasPrice (int level=1) const
int gasPriceFactor () const
Race getRace () const
int maxRepeats () const
int mineralPrice (int level=1) const
int mineralPriceFactor () const
int upgradeTime (int level=1) const
int upgradeTimeFactor () const
UnitType whatsRequired (int level=1) const
UnitType whatUpgrades () const
const UnitType::setwhatUses () const

Detailed Description

The upgrade type represents a passive upgrade that can be obtained with UnitInterface::upgrade.

See also
UpgradeTypes

Constructor & Destructor Documentation

constexpr BWAPI::UpgradeType::UpgradeType (int id = UpgradeTypes::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.

Parameters
idThe 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.

References BWAPI::UpgradeTypes::allUpgradeTypes().

Member Function Documentation

Race BWAPI::UpgradeType::getRace () const

Retrieves the race the upgrade is for.

For example, UpgradeTypes::Terran_Infantry_Armor.getRace() will return Races::Terran.

Returns
Race that this upgrade belongs to.
int BWAPI::UpgradeType::mineralPrice (int level = 1) const

Returns the mineral price for the upgrade.

Parameters
level(optional) The next upgrade level.
Note
Upgrades start at level 0.
Returns
The mineral cost of the upgrade for the given level.
int BWAPI::UpgradeType::mineralPriceFactor () const

The amount that the mineral price increases for each additional upgrade.

Returns
The mineral cost added to the upgrade after each level.
int BWAPI::UpgradeType::gasPrice (int level = 1) const

Returns the vespene gas price for the first upgrade.

Parameters
level(optional) The next upgrade level.
Note
Upgrades start at level 0.
Returns
The gas cost of the upgrade for the given level.
int BWAPI::UpgradeType::gasPriceFactor () const

Returns the amount that the vespene gas price increases for each additional upgrade.

Returns
The gas cost added to the upgrade after each level.
int BWAPI::UpgradeType::upgradeTime (int level = 1) const

Returns the number of frames needed to research the first upgrade.

Parameters
level(optional) The next upgrade level.
Note
Upgrades start at level 0.
Returns
The time cost of the upgrade for the given level.
int BWAPI::UpgradeType::upgradeTimeFactor () const

Returns the number of frames that the upgrade time increases for each additional upgrade.

Returns
The time cost added to the upgrade after each level.
int BWAPI::UpgradeType::maxRepeats () const

Returns the maximum number of times the upgrade can be researched.

Returns
Maximum number of times this upgrade can be upgraded.
UnitType BWAPI::UpgradeType::whatUpgrades () const

Returns the type of unit that researches the upgrade.

Returns
The UnitType that is used to upgrade this type.
UnitType BWAPI::UpgradeType::whatsRequired (int level = 1) const

Returns the type of unit that is required for the upgrade.

The player must have at least one of these units completed in order to start upgrading this upgrade.

Parameters
level(optional) The next upgrade level.
Note
Upgrades start at level 0.
Returns
UnitType required to obtain this upgrade.
const UnitType::set& BWAPI::UpgradeType::whatUses () const

Returns the set of units that are affected by this upgrade.

Returns
Set of unit types that passively use this upgrade type.