BWAPI
Public Member Functions
ClientModule Class Reference

#include <ClientModule.h>

Inheritance diagram for ClientModule:
Inheritance graph
[legend]
Collaboration diagram for ClientModule:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ClientModule ()
virtual void onStart ()
virtual void onFrame ()
virtual void onEnd (bool isWinner)
virtual void onUnitCreate (BWAPI::Unit *unit)
virtual void onUnitDestroy (BWAPI::Unit *unit)
virtual void onSendText (std::string text)
virtual void onReceiveText (BWAPI::Player *player, std::string text)
virtual void onPlayerLeft (BWAPI::Player *player)
virtual void onNukeDetect (BWAPI::Position target)
virtual void onUnitMorph (BWAPI::Unit *unit)
virtual void onUnitShow (BWAPI::Unit *unit)
virtual void onUnitHide (BWAPI::Unit *unit)
virtual void onUnitRenegade (BWAPI::Unit *unit)
virtual void onSaveGame (std::string gameName)

Constructor & Destructor Documentation


Member Function Documentation

void ClientModule::onEnd ( bool  isWinner) [virtual]

Called at the end of a game. This is where we shut down sockets and clean up any data structures we have created.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onFrame ( ) [virtual]

Runs every frame

Sends the unit status to the ProxyBot, then waits for a list of command messages.

Reimplemented from BWAPI::AIModule.

void ClientModule::onNukeDetect ( BWAPI::Position  target) [virtual]

BWAPI calls this when a nuclear launch has been detected. If the target position is visible, or if Complete Map Information is enabled, the target position will also be provided. If Complete Map Information is disabled and the target position is not visible, target will be set to Positions::Unknown.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onPlayerLeft ( BWAPI::Player player) [virtual]

BWAPI calls this when a player leaves the game.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onReceiveText ( BWAPI::Player player,
std::string  text 
) [virtual]

BWAPI calls this when another player sends a message.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onSaveGame ( std::string  gameName) [virtual]

Reimplemented from BWAPI::AIModule.

void ClientModule::onSendText ( std::string  text) [virtual]

If Flag::UserInput is enabled, BWAPI will call this each time a user enters a message into the chat.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onStart ( ) [virtual]

Called at the start of a match.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitCreate ( BWAPI::Unit unit) [virtual]

BWAPI calls this when a unit is created. Note that this is NOT called when a unit changes type (such as larva into egg or egg into drone). Building a refinery/assimilator/extractor will not produce an onUnitCreate call since the vespene geyser changes to the unit type of the refinery/assimilator/extractor. If Complete Map Information is enabled, this will also be called for new units that are hidden by the fog of war. If the unit is visible upon creation, onUnitShow will be called shortly after onUnitCreate is called.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitDestroy ( BWAPI::Unit unit) [virtual]

Removes the unit from the ID->unit mapping

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitHide ( BWAPI::Unit unit) [virtual]

BWAPI calls this right before a unit becomes invisible, so if you want your non-cheating AI to remember where it last saw a unit, this callback would be a good place to implement it. The complete map information flag has no effect on this callback.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitMorph ( BWAPI::Unit unit) [virtual]

BWAPI calls this when a unit changes type, such as from a Zerg Drone to a Zerg Hatchery, or from a Terran Siege Tank Tank Mode to Terran Siege Tank Siege Mode. This is not called when the type changes to or from UnitTypes::Unknown (which happens when a unit becomes visible or invisible).

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitRenegade ( BWAPI::Unit unit) [virtual]

BWAPI calls this when an accessible unit changes ownership.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:

void ClientModule::onUnitShow ( BWAPI::Unit unit) [virtual]

BWAPI calls this the instant a previously invisible unit becomes visible. The complete map information flag has no effect on this callback.

Reimplemented from BWAPI::AIModule.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines