BWAPI namespace

The primary namespace for the BWAPI interface.

Everything that is BWAPI is contained within it.

Namespaces

namespace BulletTypes
Namespace containing bullet types.
namespace Colors
Namespace containing known colors.
namespace CoordinateType
Contains the coordinate type enumeration for relative drawing positions.
namespace DamageTypes
Namespace containing damage types.
namespace Errors
Namespace containing error codes
namespace EventType
Contains a list of event types supported by BWAPI.
namespace ExplosionTypes
Namespace containing explosion types.
namespace Filter
namespace Flag
Contains flag enumerations for BWAPI.
namespace GameTypes
Namespace containing game types.
namespace Orders
Namespace containing unit orders.
namespace PlayerTypes
Namespace containing player types (player controllers).
namespace Positions
List of special Position constants.
namespace Races
Namespace containing all valid races.
namespace TechTypes
Namespace containing tech types.
namespace Text
Namespace containing text formatting codes.
namespace TilePositions
List of special TilePosition constants.
namespace Tournament
Contains a list of interruptable actions that the tournament module can allow or deny.
namespace UnitCommandTypes
Namespace containing unit command types.
namespace UnitSizeTypes
Namespace containing unit size types.
namespace UnitTypes
Namespace containing unit types.
namespace UpgradeTypes
Namespace of upgrade types.
namespace WalkPositions
List of special WalkPosition constants.
namespace WeaponTypes
namespace containing weapon types.

Classes

class AIModule
AIModule is a virtual class that is intended to be implemented or inherited by a custom AI class.
class APMCounter
template<typename _PARAM>
class BestFilter
The BestFilter is used to compare two objects with each other.
class Bullet
An interface object representing a bullet or missile spawned from an attack.
struct BulletID
class Bulletset
A container for a set of Bullet objects.
class BulletType
This class represents a type of bullet.
class Color
The Color object is used in drawing routines to specify the color to use.
class CommandOptimizer
Used for optimizing several commands of the same type, usually by grouping units together.
template<typename PType, typename RType = int, class Container = std::function<RType(PType)>>
class CompareFilter
The CompareFilter is a container in which a stored function predicate returns a value.
class DamageType
Damage types are used in Broodwar to determine the amount of damage that will be done to a unit.
class Error
The Error object is generally used to determine why certain functions in BWAPI have failed.
class Event
class ExplosionType
A representation of a weapon's explosion type.
class Force
The Force class is used to get information about each force in a match.
struct ForceID
class Forceset
A container that holds a group of Forces.
class FPSCounter
class Game
The abstract Game class is implemented by BWAPI and is the primary means of obtaining all game state information from Starcraft Broodwar.
class GameType
A class that represents game types in Broodwar.
struct IDCompare
template<typename T>
struct Identifier
template<typename Interface, typename Data>
struct InterfaceDataWrapper
struct NoneIdentifier
class Order
An Order (Order type) represents a Unit's current action and can be retrieved with Unit::getOrder.
class Player
The Player represents a unique controller in the game.
struct PlayerID
class Playerset
A set containing Player objects.
class PlayerType
Represents the type of controller for the player slot (i.e.
template<typename T, int Scale>
class Point
The Point class is a base class that implements convenience members and performs conversions for several different position scales.
class Race
The Race object is used to get information about a particular race.
class Region
Region objects are created by Starcraft: Broodwar to contain several tiles with the same properties, and create a node in pathfinding and other algorithms.
struct RegionID
class Regionset
A container that holds a set of Region objects.
template<class T, typename Compare = std::less<>>
class SetContainer
This container is used to wrap convenience functions for BWAPI and be used as a bridge with a built-in set type.
class TechType
The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability which can be researched with Unit::research or used with Unit::useTech.
class TournamentModule
TournamentModule is a virtual class that is intended to be implemented or inherited by a custom Tournament class.
template<class T, int UnknownId>
class Type
Base superclass for all BWAPI Types.
template<class PType, class Container = std::function<bool(PType)>>
class UnaryFilter
UnaryFilter allows for logical functor combinations.
class Unit
The Unit class is used to get information about individual units as well as issue orders to units.
class UnitCommand
class UnitCommandType
A representation of a unit command in BWAPI.
class UnitFinder
struct UnitID
class Unitset
class UnitSizeType
Size types are used by unit types in Broodwar to determine how much damage will be applied.
class UnitType
The UnitType is used to get information about a particular type of unit, such as its cost, build time, weapon, hit points, abilities, etc.
class UpgradeType
The upgrade type represents a passive upgrade that can be obtained with Unit::upgrade.
class WeaponType
This object identifies a weapon type used by a unit to attack and deal damage.

Enums

enum Key { K_LBUTTON = 0x01, K_RBUTTON, K_CANCEL, K_MBUTTON, K_XBUTTON1, K_XBUTTON2, __UNDEFINED_7, K_BACK, K_TAB, __RESERVED_A, __RESERVED_B, K_CLEAR, K_RETURN, __UNDEFINED_E, __UNDEFINED_F, K_SHIFT, K_CONTROL, K_MENU, K_PAUSE, K_CAPITAL, K_KANA, K_UNDEFINED_16, K_JUNJA, K_FINAL, K_KANJI, __UNDEFINED_1A, K_ESCAPE, K_CONVERT, K_NONCONVERT, K_ACCEPT, K_MODECHANGE, K_SPACE, K_PRIOR, K_NEXT, K_END, K_HOME, K_LEFT, K_UP, K_RIGHT, K_DOWN, K_SELECT, K_PRINT, K_EXECUTE, K_SNAPSHOT, K_INSERT, K_DELETE, K_HELP, K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9, __UNDEFINED_3A, __UNDEFINED_3B, __UNDEFINED_3C, __UNDEFINED_3D, __UNDEFINED_3E, __UNDEFINED_3F, __UNDEFINED_40, K_A, K_B, K_C, K_D, K_E, K_F, K_G, K_H, K_I, K_J, K_K, K_L, K_M, K_N, K_O, K_P, K_Q, K_R, K_S, K_T, K_U, K_V, K_W, K_X, K_Y, K_Z, K_LWIN, K_RWIN, K_APPS, __RESERVED_5E, K_SLEEP, K_NUMPAD0, K_NUMPAD1, K_NUMPAD2, K_NUMPAD3, K_NUMPAD4, K_NUMPAD5, K_NUMPAD6, K_NUMPAD7, K_NUMPAD8, K_NUMPAD9, K_MULTIPLY, K_ADD, K_SEPARATOR, K_SUBTRACT, K_DECIMAL, K_DIVIDE, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_F13, K_F14, K_F15, K_F16, K_F17, K_F18, K_F19, K_F20, K_F21, K_F22, K_F23, K_F24, __UNASSIGNED_88, __UNASSIGNED_89, __UNASSIGNED_8A, __UNASSIGNED_8B, __UNASSIGNED_8C, __UNASSIGNED_8D, __UNASSIGNED_8E, __UNASSIGNED_8F, K_NUMLOCK, K_SCROLL, K_OEM_NEC_EQUAL, K_OEM_FJ_JISHO, K_OEM_FJ_MASSHOU, K_OEM_FJ_TOUROKU, K_OEM_FJ_LOYA, __UNASSIGNED_97, __UNASSIGNED_98, __UNASSIGNED_99, __UNASSIGNED_9A, __UNASSIGNED_9B, __UNASSIGNED_9C, __UNASSIGNED_9D, __UNASSIGNED_9E, __UNASSIGNED_9F, K_LSHIFT, K_RSHIFT, K_LCONTROL, K_RCONTROL, K_LMENU, K_RMENU, K_BROWSER_BACK, K_BROWSER_FORWARD, K_BROWSER_REFRESH, K_BROWSER_STOP, K_BROWSER_SEARCH, K_BROWSER_FAVORITES, K_BROWSER_HOME, K_VOLUME_MUTE, K_VOLUME_DOWN, K_VOLUME_UP, K_MEDIA_NEXT_TRACK, K_MEDIA_PREV_TRACK, K_MEDIA_STOP, K_MEDIA_PLAY_PAUSE, K_LAUNCH_MAIL, K_LAUNCH_MEDIA_SELECT, K_LAUNCH_APP1, K_LAUNCH_APP2, __RESERVED_B8, __RESERVED_B9, K_OEM_1, K_OEM_PLUS, K_OEM_COMMA, K_OEM_MINUS, K_OEM_PERIOD, K_OEM_2, K_OEM_3, K_OEM_4 = 0xDB, K_OEM_5, K_OEM_6, K_OEM_7, K_OEM_8, __RESERVED_E0, K_OEM_AX, K_OEM_102, K_ICO_HELP, K_ICO_00, K_PROCESSKEY, K_ICO_CLEAR, K_PACKET, __UNASSIGNED_E8, K_OEM_RESET, K_OEM_JUMP, K_OEM_PA1, K_OEM_PA2, K_OEM_PA3, K_OEM_WSCTRL, K_OEM_CUSEL, K_OEM_ATTN, K_OEM_FINISH, K_OEM_COPY, K_OEM_AUTO, K_OEM_ENLW, K_OEM_BACKTAB, K_ATTN, K_CRSEL, K_EXSEL, K_EREOF, K_PLAY, K_ZOOM, K_NONAME, K_PA1, K_OEM_CLEAR, K_MAX }
An enumeration of keyboard input values.
enum MouseButton { M_LEFT = 0, M_RIGHT, M_MIDDLE, M_MAX }
An enumeration of mouse button inputs.

Typedefs

using BestUnitFilter = BestFilter<Unit>
using Container_Unitset = SetContainer<BWAPI::Unit, IDCompare>
The Unitset is a container for a set of pointers to Unit objects.
using Position = Point<int, 1>
Indicates a position that is 1x1 pixel in size.
template<typename T>
using PtrCompareUnitFilter = CompareFilter<Unit, T, T(*)(Unit const&)>
using PtrUnitFilter = UnaryFilter<Unit, bool(*)(Unit const&)>
template<class T, typename Compare>
using SetContainerUnderlyingT = std::set<T, Compare>
using TilePosition = Point<int, 32>
Indicates a position that is 32x32 pixels in size.
using UnitFilter = UnaryFilter<Unit>
using WalkPosition = BWAPI::Point<int, WALKPOSITION_SCALE>
Indicates a position that is 8x8 pixels in size.

Functions

auto BWAPI_getRevision() -> int
Retrieves the revision of the BWAPILIB module currently being used.
auto BWAPI_isDebug() -> bool
Checks if the BWAPILIB module was compiled in DEBUG mode.
template<typename _PARAM>
auto Highest(const CompareFilter<_PARAM, int>& filter) -> BestFilter<_PARAM>
template<typename _PARAM>
auto Lowest(const CompareFilter<_PARAM, int>& filter) -> BestFilter<_PARAM>

Variables

const int CLIENT_VERSION since v4.2.0
The client version that this header file was compiled with.
static const int ENERGY_REGEN_RATE since v4.1.0
The amount of energy that a unit with special abilities recovers over 256 frames.
static const int LIFE_REGEN_RATE since v4.1.0
The amount of life that a zerg unit recovers over 256 frames.
const int POSITION_SCALE
The scale of a Position.
static const int SHIELD_REGEN_RATE since v4.1.0
The amount of shield points that a unit recovers over 256 frames.
const int TILEPOSITION_SCALE
The scale of a TilePosition.
const int WALKPOSITION_SCALE
The scale of a WalkPosition.

Enum documentation

enum BWAPI::Key

An enumeration of keyboard input values.

enum BWAPI::MouseButton

An enumeration of mouse button inputs.

Typedef documentation

using BWAPI::Container_Unitset = SetContainer<BWAPI::Unit, IDCompare>

The Unitset is a container for a set of pointers to Unit objects.

It is typically used for groups of units instead of having to manage each Unit individually.

typedef Point<int, 1> BWAPI::Position

Indicates a position that is 1x1 pixel in size.

This is the most precise position type.

typedef Point<int, 32> BWAPI::TilePosition

Indicates a position that is 32x32 pixels in size.

Typically used for building placement.

typedef BWAPI::Point<int, WALKPOSITION_SCALE> BWAPI::WalkPosition

Indicates a position that is 8x8 pixels in size.

Function documentation

int BWAPI::BWAPI_getRevision()

Retrieves the revision of the BWAPILIB module currently being used.

Returns An integer representing the revision number of the library.

bool BWAPI::BWAPI_isDebug()

Checks if the BWAPILIB module was compiled in DEBUG mode.

Returns
true if this is a DEBUG build
false if this is a RELEASE build

Variable documentation

const int BWAPI::CLIENT_VERSION since v4.2.0

The client version that this header file was compiled with.

Used to determine a client's compatibility with the BWAPI server process.

static const int BWAPI::ENERGY_REGEN_RATE since v4.1.0

The amount of energy that a unit with special abilities recovers over 256 frames.

That is, 8/256 energy is generated per frame.

static const int BWAPI::LIFE_REGEN_RATE since v4.1.0

The amount of life that a zerg unit recovers over 256 frames.

That is, 4/256 life is regenerated per frame.

const int BWAPI::POSITION_SCALE

The scale of a Position.

Each position corresponds to a 1x1 pixel area.

static const int BWAPI::SHIELD_REGEN_RATE since v4.1.0

The amount of shield points that a unit recovers over 256 frames.

That is, 7/256 shields are regenerated per frame.

const int BWAPI::TILEPOSITION_SCALE

The scale of a TilePosition.

Each tile position corresponds to a 32x32 pixel area.

const int BWAPI::WALKPOSITION_SCALE

The scale of a WalkPosition.

Each walk position corresponds to an 8x8 pixel area.