BWAPI::Race class

The Race object is used to get information about a particular race.

For example, the default worker and supply provider UnitType.

As you should already know, Starcraft has three races: Terran , Protoss , and Zerg .

Base classes

template<class T, int UnknownId>
class Type<Race, Races::Enum::Unknown>
Base superclass for all BWAPI Types.

Constructors, destructors, conversion operators

Race(int id = Races::Enum::None) explicit constexpr
Expected type constructor.

Public functions

auto getCenter() const -> UnitType
Deprecated.
auto getRefinery() const -> UnitType
Retrieves the default structure UnitType for this Race that is used to harvest gas from Vespene Geysers.
auto getResourceDepot() const -> UnitType since v4.2.0
Retrieves the default resource depot UnitType that workers of this race can construct and return resources to.
auto getSupplyProvider() const -> UnitType
Retrieves the default supply provider UnitType for this race that is used to construct units.
auto getTransport() const -> UnitType
Retrieves the default transport UnitType for this race that is used to transport ground units across the map.
auto getWorker() const -> UnitType
Retrieves the default worker type for this Race.

Function documentation

BWAPI::Race::Race(int id = Races::Enum::None) explicit constexpr

Expected type constructor.

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

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.

UnitType BWAPI::Race::getCenter() const

Deprecated.

Use getResourceDepot instead.

UnitType BWAPI::Race::getRefinery() const

Retrieves the default structure UnitType for this Race that is used to harvest gas from Vespene Geysers.

Returns UnitType of the structure used to harvest gas.

UnitType BWAPI::Race::getResourceDepot() const since v4.2.0

Retrieves the default resource depot UnitType that workers of this race can construct and return resources to.

Returns UnitType of the center that this race uses.

UnitType BWAPI::Race::getSupplyProvider() const

Retrieves the default supply provider UnitType for this race that is used to construct units.

Returns UnitType that provides the player with supply.

UnitType BWAPI::Race::getTransport() const

Retrieves the default transport UnitType for this race that is used to transport ground units across the map.

Returns UnitType for transportation.

UnitType BWAPI::Race::getWorker() const

Retrieves the default worker type for this Race.

Returns UnitType of the worker that this race uses.