SC2API
An API for AI for StarCraft II
Public Member Functions | List of all members
sc2::Agent Class Reference

The base class for user defined bots. More...

#include <sc2_agent.h>

Inheritance diagram for sc2::Agent:
sc2::Client sc2::ClientEvents

Public Member Functions

ActionInterfaceActions ()
 
ActionFeatureLayerInterfaceActionsFeatureLayer ()
 
AgentControlInterfaceAgentControl ()
 
- Public Member Functions inherited from sc2::Client
const ObservationInterfaceObservation () const
 The ObservationInterface is used to query game state.
 
QueryInterfaceQuery ()
 The UnitQuery interface is used to issue commands to units.
 
DebugInterfaceDebug ()
 The DebugInterface allows a derived class to print text, draw primitive shapes and spawn/destroy units.
 
ControlInterfaceControl ()
 
const ControlInterfaceControl () const
 
void Reset ()
 
- Public Member Functions inherited from sc2::ClientEvents
virtual void OnGameFullStart ()
 Called when a game is started after a load. Fast restarting will not call this.
 
virtual void OnGameStart ()
 Called when a game is started or restarted.
 
virtual void OnGameEnd ()
 Called when a game has ended.
 
virtual void OnStep ()
 
virtual void OnUnitDestroyed (const Unit *)
 
virtual void OnUnitCreated (const Unit *)
 
virtual void OnUnitIdle (const Unit *)
 
virtual void OnUpgradeCompleted (UpgradeID)
 
virtual void OnBuildingConstructionComplete (const Unit *)
 
virtual void OnNydusDetected ()
 Called when a nydus is placed.
 
virtual void OnNuclearLaunchDetected ()
 Called when a nuclear launch is detected.
 
virtual void OnUnitEnterVision (const Unit *)
 
virtual void OnError (const std::vector< ClientError > &, const std::vector< std::string > &={})
 Called for various errors the library can encounter. See ClientError enum for possible errors.
 

Detailed Description

The base class for user defined bots.

Member Function Documentation

ActionInterface* sc2::Agent::Actions ( )

Interface for issuing actions to units. Actions should be batched via the UnitCommand functions then eventually dispatched with SendActions. If you are stepping the simulation yourself the Step will automatically call SendActions. If your bot is running in real time you must call SendActions yourself.

Returns
The raw (basic) action interface.
ActionFeatureLayerInterface* sc2::Agent::ActionsFeatureLayer ( )

Interface for issuing actions in feature layers.

Returns
The feature layer action interface.
AgentControlInterface* sc2::Agent::AgentControl ( )

The AgentControlInterface is only currently used for restarting a game. For internal use.

Returns
The agent control interface.

The documentation for this class was generated from the following file: