BWAPI  4.1.2
An API for interacting with Starcraft: Broodwar (1.16.1)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
Public Member Functions | List of all members
BWAPI::Race Class Reference
Inheritance diagram for BWAPI::Race:
Inheritance graph

Public Member Functions

 Race (int id=Races::Enum::None)
 
UnitType getCenter () const
 
UnitType getRefinery () 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

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.

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::getCenter ( ) const

Retrieves the default resource center UnitType that is used to create expansions for this Race.

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