#include <sc2_interfaces.h>
|
virtual void | UnitCommand (const Unit *unit, AbilityID ability, bool queued_command=false)=0 |
|
virtual void | UnitCommand (const Unit *unit, AbilityID ability, const Point2D &point, bool queued_command=false)=0 |
|
virtual void | UnitCommand (const Unit *unit, AbilityID ability, const Unit *target, bool queued_command=false)=0 |
|
virtual void | UnitCommand (const Units &units, AbilityID ability, bool queued_move=false)=0 |
| Issues a command to multiple units (prefer this where possible). Same as UnitCommand(Unit, AbilityID).
|
|
virtual void | UnitCommand (const Units &units, AbilityID ability, const Point2D &point, bool queued_command=false)=0 |
| Issues a command to multiple units (prefer this where possible). Same as UnitCommand(Unit, AbilityID, Point2D).
|
|
virtual void | UnitCommand (const Units &units, AbilityID ability, const Unit *target, bool queued_command=false)=0 |
| Issues a command to multiple units (prefer this where possible). Same as UnitCommand(Unit, AbilityID, Unit).
|
|
virtual const std::vector< Tag > & | Commands () const =0 |
|
virtual void | ToggleAutocast (Tag unit_tag, AbilityID ability)=0 |
|
virtual void | ToggleAutocast (const std::vector< Tag > &unit_tags, AbilityID ability)=0 |
|
virtual void | SendChat (const std::string &message, ChatChannel channel=ChatChannel::All)=0 |
|
virtual void | SendActions ()=0 |
|
The ActionInterface issues actions to units in a game. Not available in replays. Guaranteed to be valid when the OnStep event is called.
virtual const std::vector<Tag>& sc2::ActionInterface::Commands |
( |
| ) |
const |
|
pure virtual |
Returns a list of unit tags that have sent commands out in the last call to SendActions. This will be used to determine if a unit actually has a command when the observation is received.
- Returns
- Array of units that have sent commands.
virtual void sc2::ActionInterface::SendActions |
( |
| ) |
|
|
pure virtual |
This function sends out all batched 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. For example, if you wanted to move 20 marines to some position on the map you'd want to batch all of those unit commands and send them at once.
virtual void sc2::ActionInterface::SendChat |
( |
const std::string & |
message, |
|
|
ChatChannel |
channel = ChatChannel::All |
|
) |
| |
|
pure virtual |
Sends a message to the game chat.
- Parameters
-
message | Text of message to send. |
channel | Which players will see the message. |
virtual void sc2::ActionInterface::ToggleAutocast |
( |
Tag |
unit_tag, |
|
|
AbilityID |
ability |
|
) |
| |
|
pure virtual |
Enables or disables autocast of an ability on a unit.
- Parameters
-
unit_tag | The unit to toggle the ability on. |
ability | The ability to be toggled. |
virtual void sc2::ActionInterface::ToggleAutocast |
( |
const std::vector< Tag > & |
unit_tags, |
|
|
AbilityID |
ability |
|
) |
| |
|
pure virtual |
Enables or disables autocast of an ability on a list of units.
- Parameters
-
unit_tags | The units to toggle the ability on. |
ability | The ability to be toggled. |
virtual void sc2::ActionInterface::UnitCommand |
( |
const Unit * |
unit, |
|
|
AbilityID |
ability, |
|
|
bool |
queued_command = false |
|
) |
| |
|
pure virtual |
Issues a command to a unit. Self targeting.
- Parameters
-
unit | The unit to send the command to. |
ability | The ability id of the command. |
virtual void sc2::ActionInterface::UnitCommand |
( |
const Unit * |
unit, |
|
|
AbilityID |
ability, |
|
|
const Point2D & |
point, |
|
|
bool |
queued_command = false |
|
) |
| |
|
pure virtual |
Issues a command to a unit. Targets a point.
- Parameters
-
unit | The unit to send the command to. |
ability | The ability id of the command. |
point | The 2D world position to target. |
virtual void sc2::ActionInterface::UnitCommand |
( |
const Unit * |
unit, |
|
|
AbilityID |
ability, |
|
|
const Unit * |
target, |
|
|
bool |
queued_command = false |
|
) |
| |
|
pure virtual |
Issues a command to a unit. Targets another unit.
- Parameters
-
unit | The unit to send the command to. |
ability | The ability id of the command. |
target | The unit that is a target of the unit getting the command. |
The documentation for this class was generated from the following file: