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

#include <sc2_interfaces.h>

Public Member Functions

virtual void UnitCommand (AbilityID ability)=0
 
virtual void UnitCommand (AbilityID ability, const Point2DI &point, bool minimap=false)=0
 
virtual void CameraMove (const Point2DI &center)=0
 Moves the camera to be centered around a position. Coordinate is position on minimap feature layer.
 
virtual void Select (const Point2DI &center, PointSelectionType selection_type)=0
 
virtual void Select (const Point2DI &p0, const Point2DI &p1, bool add_to_selection=false)=0
 
virtual void SendActions ()=0
 

Detailed Description

The ActionFeatureLayerInterface emulates UI actions in feature layer. Not available in replays. Guaranteed to be valid when the OnStep event is called.

Member Function Documentation

virtual void sc2::ActionFeatureLayerInterface::Select ( const Point2DI center,
PointSelectionType  selection_type 
)
pure virtual

Selection of a point, equivalent to clicking the mouse on a unit.

Parameters
centerThe feature layer 'pixel' being clicked on.
selection_typeAny modifier keys, for example if 'shift-click' is desired.
virtual void sc2::ActionFeatureLayerInterface::Select ( const Point2DI p0,
const Point2DI p1,
bool  add_to_selection = false 
)
pure virtual

Selection of an area, equivalent to click-dragging the mouse over an area of the screen.

Parameters
p0The feature layer pixel where the first click occurs (mouse button down).
p1The feature layer pixel where the drag release occurs (mouse button up).
add_to_selectionWill add newly selected units to an existing selection.
virtual void sc2::ActionFeatureLayerInterface::SendActions ( )
pure virtual

This function sends out all batched selection and unit commands. You DO NOT need to call this function in non real time simulations since it is automatically called when stepping the simulation forward. You only need to call this function in a real time simulation.

virtual void sc2::ActionFeatureLayerInterface::UnitCommand ( AbilityID  ability)
pure virtual

Issues a command to whatever is selected. Self targeting.

Parameters
abilityThe ability id of the command.
virtual void sc2::ActionFeatureLayerInterface::UnitCommand ( AbilityID  ability,
const Point2DI point,
bool  minimap = false 
)
pure virtual

Issues a command to whatever is selected. Uses a point as a target for the command.

Parameters
abilityThe ability id of the command.
pointThe 2D world position to target.
minimapTarget in the minimap instead of the map.

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