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

Public Member Functions

constexpr Race (int id=Races::Enum::None)
UnitType getCenter () const
UnitType getRefinery () const
UnitType getResourceDepot () const
UnitType getSupplyProvider () const
UnitType getTransport () const
UnitType getWorker () const

Detailed Description

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 .

See also
UnitType::getRace, PlayerInterface::getRace, Races

Constructor & Destructor Documentation

constexpr BWAPI::Race::Race (int id = Races::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::Races::allRaces().

Member Function Documentation

UnitType BWAPI::Race::getWorker () const

Retrieves the default worker type for this Race.

Note
In Starcraft, workers are the units that are used to construct structures.
Returns
UnitType of the worker that this race uses.
UnitType BWAPI::Race::getResourceDepot () const

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

Note
In Starcraft, the center is the very first structure of the Race's technology tree. Also known as its base of operations or resource depot.
Returns
UnitType of the center that this race uses.
Since
4.2.0
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.

Note
In Starcraft, you must first construct a structure over a Vespene Geyser in order to begin harvesting Vespene Gas.
Returns
UnitType of the structure used to harvest gas.
UnitType BWAPI::Race::getTransport () const

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

Note
In Starcraft, transports will allow you to carry ground units over unpassable terrain.
Returns
UnitType for transportation.
UnitType BWAPI::Race::getSupplyProvider () const

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

Note
In Starcraft, training, morphing, or warping in units requires that the player has sufficient supply available for their Race.
Returns
UnitType that provides the player with supply.