BWAPI  4.2.0
An API for interacting with Starcraft: Broodwar (1.16.1)
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
BWAPI Namespace Reference

Namespaces

 BulletTypes
 Colors
 CoordinateType
 DamageTypes
 Errors
 EventType
 ExplosionTypes
 Filter
 Flag
 GameTypes
 Latency
 Orders
 PlayerTypes
 Positions
 Races
 TechTypes
 Text
 TilePositions
 Tournament
 UnitCommandTypes
 UnitSizeTypes
 UnitTypes
 UpgradeTypes
 WalkPositions
 WeaponTypes

Classes

class  AIModule
class  BestFilter
class  BulletInterface
class  Bulletset
class  BulletType
class  Color
class  CompareFilter
class  DamageType
class  Error
class  Event
class  ExplosionType
class  ForceInterface
class  Forceset
class  Game
class  GameType
class  GameWrapper
class  Interface
class  InterfaceEvent
class  Order
class  PlayerInterface
class  Playerset
class  PlayerType
class  Point
class  Point< bool, Scale >
class  Point< char, Scale >
class  Point< T, 0 >
class  Point< unsigned char, Scale >
class  Race
class  RegionInterface
class  Regionset
class  SetContainer
class  TechType
class  TournamentModule
class  Type
class  UnaryFilter
class  UnitCommand
class  UnitCommandType
class  UnitInterface
class  Unitset
class  UnitSizeType
class  UnitType
class  UpgradeType
class  WeaponType

Typedefs

typedef BestFilter< UnitBestUnitFilter
typedef BulletInterfaceBullet
typedef ForceInterfaceForce
typedef PlayerInterfacePlayer
typedef BWAPI::Point< int, POSITION_SCALEPosition
typedef CompareFilter< Unit,int, int(*)(Unit)> PtrIntCompareUnitFilter
typedef UnaryFilter< Unit,bool(*)(Unit)> PtrUnitFilter
typedef RegionInterfaceRegion
template<class T , class HashT >
using SetContainerUnderlyingT = std::unordered_set< T, HashT >
typedef BWAPI::Point< int, TILEPOSITION_SCALETilePosition
typedef UnitInterfaceUnit
typedef UnaryFilter< UnitUnitFilter
typedef BWAPI::Point< int, WALKPOSITION_SCALEWalkPosition

Enumerations

enum  Key {
  K_LBUTTON = 0x01,
  K_RBUTTON,
  K_CANCEL,
  K_MBUTTON,
  K_XBUTTON1,
  K_XBUTTON2 ,
  K_BACK,
  K_TAB ,
  K_CLEAR,
  K_RETURN ,
  K_SHIFT,
  K_CONTROL,
  K_MENU,
  K_PAUSE,
  K_CAPITAL,
  K_KANA,
  K_UNDEFINED_16,
  K_JUNJA,
  K_FINAL,
  K_KANJI ,
  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 ,
  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 ,
  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 ,
  K_NUMLOCK,
  K_SCROLL,
  K_OEM_NEC_EQUAL,
  K_OEM_FJ_JISHO,
  K_OEM_FJ_MASSHOU,
  K_OEM_FJ_TOUROKU,
  K_OEM_FJ_LOYA ,
  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 ,
  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 ,
  K_OEM_AX,
  K_OEM_102,
  K_ICO_HELP,
  K_ICO_00,
  K_PROCESSKEY,
  K_ICO_CLEAR,
  K_PACKET ,
  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
}
enum  MouseButton {
  M_LEFT = 0,
  M_RIGHT,
  M_MIDDLE,
  M_MAX
}

Functions

int BWAPI_getRevision ()
bool BWAPI_isDebug ()
template<typename _PARAM >
BestFilter< _PARAM > Highest (const CompareFilter< _PARAM, int > &filter)
template<typename _PARAM >
BestFilter< _PARAM > Lowest (const CompareFilter< _PARAM, int > &filter)

Variables

GameWrapper Broodwar
GameBroodwarPtr
std::ostreambwerr
std::ostreambwout
const int CLIENT_VERSION = 10002
static const int ENERGY_REGEN_RATE = 8
std::ostreamerr
static const int LIFE_REGEN_RATE = 4
std::ostreamout
const int POSITION_SCALE = 1
static const int SHIELD_REGEN_RATE = 7
const int TILEPOSITION_SCALE = 32
const int WALKPOSITION_SCALE = 8

Detailed Description

The primary namespace for the BWAPI interface.

Everything that is BWAPI is contained within it.

Typedef Documentation

Indicates a position that is 1x1 pixel in size.

This is the most precise position type.

See also
Positions

Indicates a position that is 8x8 pixels in size.

See also
Game::isWalkable, WalkPositions

Indicates a position that is 32x32 pixels in size.

Typically used for building placement.

See also
TilePositions

Enumeration Type Documentation

An enumeration of mouse button inputs.

See also
Game::getMouseState
Enumerator
M_LEFT 
M_RIGHT 
M_MIDDLE 
M_MAX 

An enumeration of keyboard input values.

See also
Game::getKeyState
Enumerator
K_LBUTTON 
K_RBUTTON 
K_CANCEL 
K_MBUTTON 
K_XBUTTON1 
K_XBUTTON2 
K_BACK 
K_TAB 
K_CLEAR 
K_RETURN 
K_SHIFT 
K_CONTROL 
K_MENU 
K_PAUSE 
K_CAPITAL 
K_KANA 
K_UNDEFINED_16 
K_JUNJA 
K_FINAL 
K_KANJI 
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 
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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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 

Function Documentation

BestFilter<_PARAM> BWAPI::Lowest (const CompareFilter< _PARAM, int > & filter)
BestFilter<_PARAM> BWAPI::Highest (const CompareFilter< _PARAM, int > & filter)
int BWAPI::BWAPI_getRevision ()

Retrieves the revision of the BWAPILIB module currently being used.

Returns
An integer representing the revision number of the library.
Note
This function is considered thread-safe.
bool BWAPI::BWAPI_isDebug ()

Checks if the BWAPILIB module was compiled in DEBUG mode.

Return values
trueif this is a DEBUG build
falseif this is a RELEASE build
Note
This function is considered thread-safe.

Variable Documentation

Game* BWAPI::BroodwarPtr
GameWrapper BWAPI::Broodwar

The primary Game interface, used to access any Game information or perform Game actions.

Referenced by BWAPI::GameWrapper::operator<<().

const int BWAPI::POSITION_SCALE = 1

The scale of a Position.

Each position corresponds to a 1x1 pixel area.

See also
Position
const int BWAPI::WALKPOSITION_SCALE = 8

The scale of a WalkPosition.

Each walk position corresponds to an 8x8 pixel area.

See also
WalkPosition
const int BWAPI::TILEPOSITION_SCALE = 32

The scale of a TilePosition.

Each tile position corresponds to a 32x32 pixel area.

See also
TilePosition
std::ostream& BWAPI::bwout

Output stream that writes text to the screen as a notification.

Colored Text::Yellow by default, but preserves new Text::Enum colors written to it between lines. Wraps text when needed, not on word boundaries.

Note
Text printed from this stream is not seen by other players or in replays.
See also
Text::Enum, BroodwarOutputDevice
Since
4.2.0
std::ostream& BWAPI::bwerr

An output stream like bwout, but colored Text::BrightRed by default

See also
bwout
Since
4.2.0
std::ostream& BWAPI::out

An output stream that writes to both std::cout and BWAPI::bwout.

Since
4.2.0
std::ostream& BWAPI::err

An output stream that writes to both std::cerr and BWAPI::bwerr.

Since
4.2.0
const int BWAPI::SHIELD_REGEN_RATE = 7 static

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

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

Since
4.1.0 Beta
const int BWAPI::ENERGY_REGEN_RATE = 8 static

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

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

Since
4.1.0 Beta
const int BWAPI::LIFE_REGEN_RATE = 4 static

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

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

Since
4.1.0 Beta
const int BWAPI::CLIENT_VERSION = 10002

The client version that this header file was compiled with.

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

Note
This value is purposely high to avoid collisions with revision values.
Since
4.2.0