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

Public Member Functions

constexpr TechType (int id=TechTypes::Enum::None)
int energyCost () const
int gasPrice () const
Order getOrder () const
Race getRace () const
WeaponType getWeapon () const
int mineralPrice () const
UnitType requiredUnit () const
int researchTime () const
bool targetsPosition () const
bool targetsUnit () const
UnitType whatResearches () const
const UnitType::setwhatUses () const

Detailed Description

The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability which can be researched with UnitInterface::research or used with UnitInterface::useTech.

In order for a Unit to use its own specialized ability, it must first be available and researched.

See also
TechTypes

Constructor & Destructor Documentation

constexpr BWAPI::TechType::TechType (int id = TechTypes::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::TechTypes::allTechTypes().

Member Function Documentation

Race BWAPI::TechType::getRace () const

Retrieves the race that is required to research or use the TechType.

Note
There is an exception where Infested Kerrigan can use Psionic Storm. This does not apply to the behavior of this function.
Returns
Race object indicating which race is designed to use this technology type.
int BWAPI::TechType::mineralPrice () const

Retrieves the mineral cost of researching this technology.

Returns
Amount of minerals needed in order to research this technology.
int BWAPI::TechType::gasPrice () const

Retrieves the vespene gas cost of researching this technology.

Returns
Amount of vespene gas needed in order to research this technology.
int BWAPI::TechType::researchTime () const

Retrieves the number of frames needed to research the tech type.

Returns
The time, in frames, it will take for the research to complete.
See also
UnitInterface::getRemainingResearchTime
int BWAPI::TechType::energyCost () const

Retrieves the amount of energy needed to use this TechType as an ability.

Returns
Energy cost of the ability.
See also
UnitInterface::getEnergy
UnitType BWAPI::TechType::whatResearches () const

Retrieves the UnitType that can research this technology.

Returns
UnitType that is able to research the technology in the game.
Return values
UnitTypes::NoneIf the technology/ability is either provided for free or never available.
WeaponType BWAPI::TechType::getWeapon () const

Retrieves the Weapon that is attached to this tech type.

A technology's WeaponType is used to indicate the range and behaviour of the ability when used by a Unit.

Returns
WeaponType containing information about the ability's behavior.
Return values
WeaponTypes::NoneIf there is no corresponding WeaponType.
bool BWAPI::TechType::targetsUnit () const

Checks if this ability can be used on other units.

Returns
true if the ability can be used on other units, and false if it can not.
bool BWAPI::TechType::targetsPosition () const

Checks if this ability can be used on the terrain (ground).

Returns
true if the ability can be used on the terrain.
const UnitType::set& BWAPI::TechType::whatUses () const

Retrieves the set of all UnitTypes that are capable of using this ability.

Returns
Set of UnitTypes that can use this ability when researched.
Order BWAPI::TechType::getOrder () const

Retrieves the Order that a Unit uses when using this ability.

Returns
Order representing the action a Unit uses to perform this ability
UnitType BWAPI::TechType::requiredUnit () const

Retrieves the UnitType required to research this technology.

The required unit type must be a completed unit owned by the player researching the technology.

Returns
UnitType that is needed to research this tech type.
Return values
UnitTypes::Noneif no unit is required to research this tech type.
See also
PlayerInterface::completedUnitCount
Since
4.1.2