An API for interacting with Starcraft: Broodwar (1.16.1)
|virtual void||onEnd (bool isWinner)|
|virtual void||onFrame ()|
|virtual void||onNukeDetect (Position target)|
|virtual void||onPlayerLeft (Player player)|
|virtual void||onReceiveText (Player player, std::string text)|
|virtual void||onSaveGame (std::string gameName)|
|virtual void||onSendText (std::string text)|
|virtual void||onStart ()|
|virtual void||onUnitComplete (Unit unit)|
|virtual void||onUnitCreate (Unit unit)|
|virtual void||onUnitDestroy (Unit unit)|
|virtual void||onUnitDiscover (Unit unit)|
|virtual void||onUnitEvade (Unit unit)|
|virtual void||onUnitHide (Unit unit)|
|virtual void||onUnitMorph (Unit unit)|
|virtual void||onUnitRenegade (Unit unit)|
|virtual void||onUnitShow (Unit unit)|
AIModule is a virtual class that is intended to be implemented or inherited by a custom AI class.
The Broodwar interface is guaranteed to be initialized if any of these predefined interface functions are invoked by BWAPI.
Called only once at the beginning of a game.
It is intended that the AI module do any data initialization in this function.
Called once at the end of a game.
|isWinner||A boolean value to determine if the current player has won the match. This value will be true if the current player has won, and false if either the player has lost or the game is actually a replay.|
Called once for every execution of a logical frame in Broodwar.
Users will generally put most of their code in this function.
Called when the user attempts to send a text message.
This function can be used to make the bot execute text commands entered by the user for debugging purposes.
|text||A string containing the exact text message that was sent by the user.|
Called when the client receives a message from another Player.
This function can be used to retrieve information from allies in team games, or just to respond to other players.
|player||The Player interface object representing the owner of the text message.|
|text||The text message that the |
Called when a Player leaves the game.
All of their units are automatically given to the neutral player with their colour and alliance parameters preserved.
|player||The Player interface object representing the player that left the game.|
Called when a unit is removed from the game either through death or other means.
|unit||Unit object representing the unit that has just been destroyed or otherwise completely removed from the game.|
Called when a unit changes its UnitType.
|unit||Unit object representing the unit that had its UnitType change.|
Called when the state of the Broodwar game is saved to file.
|gameName||A String object containing the file name that the game was saved as.|
Called when the state of a unit changes from incomplete to complete.
|unit||The Unit object representing the Unit that has just finished training or constructing.|