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

Public Member Functions

constexpr PlayerType (int id=PlayerTypes::Enum::None)
bool isGameType () const
bool isLobbyType () const

Detailed Description

Represents the type of controller for the player slot (i.e.

human, computer).

See also
PlayerTypes

Constructor & Destructor Documentation

constexpr BWAPI::PlayerType::PlayerType (int id = PlayerTypes::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::PlayerTypes::allPlayerTypes().

Member Function Documentation

bool BWAPI::PlayerType::isLobbyType () const

Identifies whether or not this type is used for the pre-game lobby.

A type such as PlayerTypes::ComputerLeft would only appear in-game when a computer player is defeated.

Returns
true if this type can appear in the pre-game lobby, false otherwise.
bool BWAPI::PlayerType::isGameType () const

Identifies whether or not this type is used in-game.

A type such as PlayerTypes::Closed would not be a valid in-game type.

Returns
true if the type can appear in-game, false otherwise.
See also
isLobbyType