class
TournamentModuleTournamentModule is a virtual class that is intended to be implemented or inherited by a custom Tournament class.
Contents
Like AIModule, the Broodwar interface is guaranteed to be initialized if any of these predefined interface functions are invoked by BWAPI.
Constructors, destructors, conversion operators
Public functions
-
auto onAction(BWAPI::
Tournament:: ActionID actionType, void* parameter = nullptr) -> bool virtual - This function regulates the functions involving game settings that an AI module is allowed to execute.
- void onFirstAdvertisement() virtual
- This function is called if the current player is chosen to advertise the BWAPI revision.
Function documentation
bool BWAPI:: TournamentModule:: onAction(BWAPI:: Tournament:: ActionID actionType,
void* parameter = nullptr) virtual
This function regulates the functions involving game settings that an AI module is allowed to execute.
Parameters | |
---|---|
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. |
For example, if the tournament forbids the enabling of Flag::
void BWAPI:: TournamentModule:: onFirstAdvertisement() virtual
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.