BWAPI
Namespaces | Classes | Enumerations | Functions | Variables
BWAPI Namespace Reference

Namespaces

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

Classes

class  BulletImpl
class  Command
class  CommandTemp
class  ForceImpl
class  GameImpl
class  Map
class  PlayerImpl
class  RegionImpl
class  Server
class  UnitImpl
class  RaceInternal
class  TechTypeInternal
class  UnitTypeInternal
class  UpgradeTypeInternal
class  WeaponTypeInternal
class  AIModule
class  TournamentModule
class  Bullet
class  BulletType
struct  BulletData
class  Client
struct  ForceData
struct  unitFinder
struct  GameData
struct  GameInstance
struct  GameTable
struct  PlayerData
struct  RegionData
struct  UnitData
class  Color
class  DamageType
class  Error
class  Event
class  ExplosionType
class  Force
class  Game
class  GameType
class  Order
class  Player
class  PlayerType
class  Position
class  Race
class  Region
class  TechType
class  TilePosition
class  Type
class  Unit
class  UnitCommand
class  UnitCommandType
class  UnitSizeType
class  UnitType
class  UpgradeType
class  WeaponType

Enumerations

enum  MouseButton { M_LEFT = 0, M_RIGHT = 1, M_MIDDLE = 2, M_MAX }
enum  Key {
  K_LBUTTON = 0x01, K_RBUTTON = 0x02, K_CANCEL = 0x03, K_MBUTTON = 0x04,
  K_XBUTTON1 = 0x05, K_XBUTTON2 = 0x06, K_BACK = 0x08, K_TAB = 0x09,
  K_CLEAR = 0x0C, K_RETURN = 0x0D, K_SHIFT = 0x10, K_CONTROL = 0x11,
  K_MENU = 0x12, K_PAUSE = 0x13, K_CAPITAL = 0x14, K_KANA = 0x15,
  K_HANGEUL = 0x15, K_HANGUL = 0x15, K_JUNJA = 0x17, K_FINAL = 0x18,
  K_HANJA = 0x19, K_KANJI = 0x19, K_ESCAPE = 0x1B, K_CONVERT = 0x1C,
  K_NONCONVERT = 0x1D, K_ACCEPT = 0x1E, K_MODECHANGE = 0x1F, K_SPACE = 0x20,
  K_PRIOR = 0x21, K_NEXT = 0x22, K_END = 0x23, K_HOME = 0x24,
  K_LEFT = 0x25, K_UP = 0x26, K_RIGHT = 0x27, K_DOWN = 0x28,
  K_SELECT = 0x29, K_PRINT = 0x2A, K_EXECUTE = 0x2B, K_SNAPSHOT = 0x2C,
  K_INSERT = 0x2D, K_DELETE = 0x2E, K_HELP = 0x2F, K_0 = 0x30,
  K_1 = 0x31, K_2 = 0x32, K_3 = 0x33, K_4 = 0x34,
  K_5 = 0x35, K_6 = 0x36, K_7 = 0x37, K_8 = 0x38,
  K_9 = 0x39, K_A = 0x41, K_B = 0x42, K_C = 0x43,
  K_D = 0x44, K_E = 0x45, K_F = 0x46, K_G = 0x47,
  K_H = 0x48, K_I = 0x49, K_J = 0x4A, K_K = 0x4B,
  K_L = 0x4C, K_M = 0x4D, K_N = 0x4E, K_O = 0x4F,
  K_P = 0x50, K_Q = 0x51, K_R = 0x52, K_S = 0x53,
  K_T = 0x54, K_U = 0x55, K_V = 0x56, K_W = 0x57,
  K_X = 0x58, K_Y = 0x59, K_Z = 0x5A, K_LWIN = 0x5B,
  K_RWIN = 0x5C, K_APPS = 0x5D, K_SLEEP = 0x5F, K_NUMPAD0 = 0x60,
  K_NUMPAD1 = 0x61, K_NUMPAD2 = 0x62, K_NUMPAD3 = 0x63, K_NUMPAD4 = 0x64,
  K_NUMPAD5 = 0x65, K_NUMPAD6 = 0x66, K_NUMPAD7 = 0x67, K_NUMPAD8 = 0x68,
  K_NUMPAD9 = 0x69, K_MULTIPLY = 0x6A, K_ADD = 0x6B, K_SEPARATOR = 0x6C,
  K_SUBTRACT = 0x6D, K_DECIMAL = 0x6E, K_DIVIDE = 0x6F, K_F1 = 0x70,
  K_F2 = 0x71, K_F3 = 0x72, K_F4 = 0x73, K_F5 = 0x74,
  K_F6 = 0x75, K_F7 = 0x76, K_F8 = 0x77, K_F9 = 0x78,
  K_F10 = 0x79, K_F11 = 0x7A, K_F12 = 0x7B, K_F13 = 0x7C,
  K_F14 = 0x7D, K_F15 = 0x7E, K_F16 = 0x7F, K_F17 = 0x80,
  K_F18 = 0x81, K_F19 = 0x82, K_F20 = 0x83, K_F21 = 0x84,
  K_F22 = 0x85, K_F23 = 0x86, K_F24 = 0x87, K_NUMLOCK = 0x90,
  K_SCROLL = 0x91, K_OEM_NEC_EQUAL = 0x92, K_OEM_FJ_JISHO = 0x92, K_OEM_FJ_MASSHOU = 0x93,
  K_OEM_FJ_TOUROKU = 0x94, K_OEM_FJ_LOYA = 0x95, K_OEM_FJ_ROYA = 0x96, K_LSHIFT = 0xA0,
  K_RSHIFT = 0xA1, K_LCONTROL = 0xA2, K_RCONTROL = 0xA3, K_LMENU = 0xA4,
  K_RMENU = 0xA5, K_BROWSER_BACK = 0xA6, K_BROWSER_FORWARD = 0xA7, K_BROWSER_REFRESH = 0xA8,
  K_BROWSER_STOP = 0xA9, K_BROWSER_SEARCH = 0xAA, K_BROWSER_FAVORITES = 0xAB, K_BROWSER_HOME = 0xAC,
  K_VOLUME_MUTE = 0xAD, K_VOLUME_DOWN = 0xAE, K_VOLUME_UP = 0xAF, K_MEDIA_NEXT_TRACK = 0xB0,
  K_MEDIA_PREV_TRACK = 0xB1, K_MEDIA_STOP = 0xB2, K_MEDIA_PLAY_PAUSE = 0xB3, K_LAUNCH_MAIL = 0xB4,
  K_LAUNCH_MEDIA_SELECT = 0xB5, K_LAUNCH_APP1 = 0xB6, K_LAUNCH_APP2 = 0xB7, K_OEM_1 = 0xBA,
  K_OEM_PLUS = 0xBB, K_OEM_COMMA = 0xBC, K_OEM_MINUS = 0xBD, K_OEM_PERIOD = 0xBE,
  K_OEM_2 = 0xBF, K_OEM_3 = 0xC0, K_OEM_4 = 0xDB, K_OEM_5 = 0xDC,
  K_OEM_6 = 0xDD, K_OEM_7 = 0xDE, K_OEM_8 = 0xDF, K_OEM_AX = 0xE1,
  K_OEM_102 = 0xE2, K_ICO_HELP = 0xE3, K_ICO_00 = 0xE4, K_PROCESSKEY = 0xE5,
  K_ICO_CLEAR = 0xE6, K_PACKET = 0xE7, K_OEM_RESET = 0xE9, K_OEM_JUMP = 0xEA,
  K_OEM_PA1 = 0xEB, K_OEM_PA2 = 0xEC, K_OEM_PA3 = 0xED, K_OEM_WSCTRL = 0xEE,
  K_OEM_CUSEL = 0xEF, K_OEM_ATTN = 0xF0, K_OEM_FINISH = 0xF1, K_OEM_COPY = 0xF2,
  K_OEM_AUTO = 0xF3, K_OEM_ENLW = 0xF4, K_OEM_BACKTAB = 0xF5, K_ATTN = 0xF6,
  K_CRSEL = 0xF7, K_EXSEL = 0xF8, K_EREOF = 0xF9, K_PLAY = 0xFA,
  K_ZOOM = 0xFB, K_NONAME = 0xFC, K_PA1 = 0xFD, K_OEM_CLEAR = 0xFE,
  K_MAX
}

Functions

void BWtoBWAPI_init ()
void swap (int &a0, int &a1)
int fixPathString (const char *in, char *out, size_t outLen)
bool __fastcall BWAPI_squareIterator_callback (Unit *uIterator)
bool __fastcall BWAPI_radiusIterator_callback (Unit *uIterator)
unsigned int getLobbyPlayerCount ()
unsigned int getLobbyOpenCount ()
bool isUnitAlive (UnitImpl *i, bool isHidden=false)
bool __fastcall Shared_unitRadiusIterator_callback (Unit *uIterator)
bool __fastcall Shared_unitInWpnRange_callback (Unit *uIterator)
bool __fastcall Client_squareIterator_callback (Unit *uIterator)
bool __fastcall Client_radiusIterator_callback (Unit *uIterator)
int getValidBulletTypeID (int id)
int getRGBIndex (int red, int green, int blue)
void fixName (std::string *name)
const char * underscoresToSpaces (const char *pszTypename)
int getValidDamageTypeID (int id)
int getValidErrorID (int id)
int getValidExplosionTypeID (int id)
int getValidGameTypeID (int id)
int getValidOrderID (int id)
int getValidPlayerTypeID (int id)
int getValidRaceID (int id)
int getValidTechTypeID (int id)
int getValidUnitCommandTypeID (int id)
int getValidUnitSizeTypeID (int id)
int getValidUnitTypeID (int id)
int getValidUpgradeTypeID (int id)
int getValidWeaponTypeID (int id)
void BWAPI_init ()
int BWAPI_getRevision ()
bool BWAPI_isDebug ()

Variables

int BWtoBWAPI_Order [BW::OrderID::MAX]
int AttackAnimationRestFrame [BW::UnitID::MAX]
BWAPI::Position unitsInRadius_compare
int unitsInRadius_radius
GameImpl BroodwarImpl
GameBroodwar = NULL
DWORD createdTimer
const BWAPI::GameInstance GameInstance_None = { 0xFFFFFFFF, false, 0 }
const UnitunitsInRadius_Unit
int unitsInRadius_Radius
const UnitunitsInWpnRange_Unit
WeaponType unitsInWpnRange_Wpn
int unitsInWpnRange_Max
Client BWAPIClient
bool initializingBulletType = true
std::string bulletTypeName [211]
std::map< std::string, BulletTypebulletTypeMap
std::set< BulletTypebulletTypeSet
bool rgbInitialized = false
unsigned int palette [256]
bool initializingDamageType = true
std::string damageTypeName [7]
std::map< std::string, DamageTypedamageTypeMap
std::set< DamageTypedamageTypeSet
bool initializingError = true
std::string errorName [BWAPI_ERROR_MAX_COUNT]
std::map< std::string, ErrorerrorMap
std::set< ErrorerrorSet
std::string emptyString
bool initializingExplosionType = true
std::string explosionTypeName [26]
std::map< std::string,
ExplosionType
explosionTypeMap
std::set< ExplosionTypeexplosionTypeSet
bool initializingGameType = true
std::string gameTypeName [35]
std::map< std::string, GameTypegameTypeMap
std::set< GameTypegameTypeSet
bool initializingOrder = true
std::string orderName [191]
std::map< std::string, OrderorderMap
std::set< OrderorderSet
bool initializingPlayerType = true
std::string playerTypeName [13]
std::map< std::string, PlayerTypeplayerTypeMap
std::set< PlayerTypeplayerTypeSet
bool initializingRace = true
RaceInternal raceData [7]
std::map< std::string, RaceraceMap
std::set< RaceraceSet
bool initializingTechType = true
TechTypeInternal techTypeData [47]
std::map< std::string, TechTypetechTypeMap
std::set< TechTypetechTypeSet
bool initializingUnitCommandType = true
std::string unitCommandTypeName [BWAPI_UNIT_COMMAND_TYPE_COUNT]
std::map< std::string,
UnitCommandType
unitCommandTypeMap
std::set< UnitCommandTypeunitCommandTypeSet
bool initializingUnitSizeType = true
std::string unitSizeTypeName [6]
std::map< std::string,
UnitSizeType
unitSizeTypeMap
std::set< UnitSizeTypeunitSizeTypeSet
bool initializingUnitType = true
UnitTypeInternal unitTypeData [245]
std::map< std::string, UnitTypeunitTypeMap
std::set< UnitTypeunitTypeSet
std::set< UnitTypemacroTypeSet
int maxWidth
int maxHeight
bool initializingUpgradeType = true
UpgradeTypeInternal upgradeTypeData [63]
std::map< std::string,
UpgradeType
upgradeTypeMap
std::set< UpgradeTypeupgradeTypeSet
bool initializingWeaponType = true
WeaponTypeInternal weaponTypeData [132]
std::map< std::string, WeaponTypeweaponTypeMap
std::set< WeaponTypeweaponTypeSet
std::set< WeaponTypespecialWeaponTypeSet
std::set< WeaponTypenormalWeaponTypeSet

Detailed Description

Everything in the BWAPI library that doesn't map or work directly with the bw data.


Enumeration Type Documentation

enum BWAPI::Key
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_HANGEUL 
K_HANGUL 
K_JUNJA 
K_FINAL 
K_HANJA 
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 
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Y 
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 
Enumerator:
M_LEFT 
M_RIGHT 
M_MIDDLE 
M_MAX 

Function Documentation

Here is the caller graph for this function:

You have to call this from your AIModule Dllmain function.

 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 {
   switch (ul_reason_for_call)
   {
     case DLL_PROCESS_ATTACH:
       BWAPI::BWAPI_init();
       break;
     case DLL_PROCESS_DETACH:
       break;
   }

   return TRUE;
 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool __fastcall BWAPI::BWAPI_radiusIterator_callback ( Unit *  uIterator)

Here is the call graph for this function:

Here is the caller graph for this function:

bool __fastcall BWAPI::BWAPI_squareIterator_callback ( Unit *  uIterator)

Here is the caller graph for this function:

Here is the caller graph for this function:

bool __fastcall BWAPI::Client_radiusIterator_callback ( Unit *  uIterator)

Here is the call graph for this function:

bool __fastcall BWAPI::Client_squareIterator_callback ( Unit *  uIterator)
void BWAPI::fixName ( std::string *  name)

Here is the caller graph for this function:

int BWAPI::fixPathString ( const char *  in,
char *  out,
size_t  outLen 
)

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

int BWAPI::getRGBIndex ( int  red,
int  green,
int  blue 
)

Here is the call graph for this function:

bool BWAPI::isUnitAlive ( UnitImpl *  i,
bool  isHidden = false 
) [inline]
bool __fastcall BWAPI::Shared_unitInWpnRange_callback ( Unit *  uIterator)

Here is the call graph for this function:

Here is the caller graph for this function:

bool __fastcall BWAPI::Shared_unitRadiusIterator_callback ( Unit *  uIterator)

Here is the call graph for this function:

Here is the caller graph for this function:

void BWAPI::swap ( int a0,
int a1 
) [inline]

Here is the caller graph for this function:

const char * BWAPI::underscoresToSpaces ( const char *  pszTypename)

Variable Documentation

Broodwar is, and always should be the ONLY instance of the Game class, it is singleton. As there is only one instance, the class is defined globaly and as value (not pointer), so the instance is constructed automatically and there is also no need to care about the destructor. We wanted to save passing the Game parameter everywhere, so we expect everywhere in the code that this variable is instantialised.

std::map<std::string, BulletType> BWAPI::bulletTypeMap
std::string BWAPI::bulletTypeName[211]
std::map<std::string, DamageType> BWAPI::damageTypeMap
std::string BWAPI::damageTypeName[7]
std::string BWAPI::emptyString
std::map<std::string, Error> BWAPI::errorMap
std::set< Error > BWAPI::errorSet
std::map<std::string, ExplosionType> BWAPI::explosionTypeMap
std::string BWAPI::explosionTypeName[26]
const BWAPI::GameInstance BWAPI::GameInstance_None = { 0xFFFFFFFF, false, 0 }
std::map<std::string, GameType> BWAPI::gameTypeMap
std::string BWAPI::gameTypeName[35]
std::map<std::string, Order> BWAPI::orderMap
std::string BWAPI::orderName[191]
std::set< Order > BWAPI::orderSet
unsigned int BWAPI::palette[256]
std::map<std::string, PlayerType> BWAPI::playerTypeMap
std::string BWAPI::playerTypeName[13]
std::map<std::string, Race> BWAPI::raceMap
std::set< Race > BWAPI::raceSet
bool BWAPI::rgbInitialized = false
std::map<std::string, TechType> BWAPI::techTypeMap
std::map<std::string, UnitSizeType> BWAPI::unitSizeTypeMap
std::string BWAPI::unitSizeTypeName[6]
std::map<std::string, UnitType> BWAPI::unitTypeMap
std::map<std::string, UpgradeType> BWAPI::upgradeTypeMap
std::map<std::string, WeaponType> BWAPI::weaponTypeMap
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines