BWAPI 4.2.0 An API for interacting with Starcraft: Broodwar (1.16.1) |
Public Member Functions | |
TournamentModule () | |
virtual bool | onAction (BWAPI::Tournament::ActionID actionType, void *parameter=nullptr) |
virtual void | onFirstAdvertisement () |
TournamentModule is a virtual class that is intended to be implemented or inherited by a custom Tournament class.
Like AIModule, the Broodwar interface is guaranteed to be initialized if any of these predefined interface functions are invoked by BWAPI.
nullptr
) virtualThis function regulates the functions involving game settings that an AI module is allowed to execute.
For example, if the tournament forbids the enabling of Flag::CompleteMapInformation, then this function can deny the request.
actionType | An ActionID containing the action that the AI module is requesting. |
parameter | An optional parameter that pertains to certain action requests. For example, if actionType is Tournament::ActionID::SendText, then parameter is a pointer to a null-terminated character array containing the message. If actionType is Tournament::ActionID::SetLocalSpeed, then parameter is a pointer to an integer. |
This function is called if the current player is chosen to advertise the BWAPI revision.
When tournament mode is enabled, to reduce spam, only one bot sends the revision message. The bot that is chosen depends on its player ID. Only one of the bots can call this function during a tournament game.