BWAPI 4.2.0 An API for interacting with Starcraft: Broodwar (1.16.1) |
Public Member Functions | |
virtual bool | exists () const =0 |
virtual int | getAcidSporeCount () const =0 |
virtual Unit | getAddon () const =0 |
virtual int | getAirWeaponCooldown () const =0 |
virtual double | getAngle () const =0 |
int | getBottom () const |
virtual UnitType | getBuildType () const =0 |
virtual Unit | getBuildUnit () const =0 |
virtual Unit | getCarrier () const =0 |
Unit | getClosestUnit (const UnitFilter &pred=nullptr, int radius=999999) const |
virtual int | getDefenseMatrixPoints () const =0 |
virtual int | getDefenseMatrixTimer () const =0 |
int | getDistance (Position target) const |
int | getDistance (Unit target) const |
virtual int | getEnergy () const =0 |
virtual int | getEnsnareTimer () const =0 |
virtual int | getGroundWeaponCooldown () const =0 |
virtual Unit | getHatchery () const =0 |
virtual int | getHitPoints () const =0 |
virtual int | getID () const =0 |
virtual int | getInitialHitPoints () const =0 |
virtual Position | getInitialPosition () const =0 |
virtual int | getInitialResources () const =0 |
virtual TilePosition | getInitialTilePosition () const =0 |
virtual UnitType | getInitialType () const =0 |
virtual int | getInterceptorCount () const =0 |
virtual Unitset | getInterceptors () const =0 |
virtual int | getIrradiateTimer () const =0 |
virtual int | getKillCount () const =0 |
virtual Unitset | getLarva () const =0 |
virtual BWAPI::Player | getLastAttackingPlayer () const =0 |
virtual UnitCommand | getLastCommand () const =0 |
virtual int | getLastCommandFrame () const =0 |
int | getLeft () const |
virtual Unitset | getLoadedUnits () const =0 |
virtual int | getLockdownTimer () const =0 |
virtual int | getMaelstromTimer () const =0 |
virtual Unit | getNydusExit () const =0 |
virtual Order | getOrder () const =0 |
virtual Unit | getOrderTarget () const =0 |
virtual Position | getOrderTargetPosition () const =0 |
virtual int | getOrderTimer () const =0 |
virtual int | getPlagueTimer () const =0 |
virtual Player | getPlayer () const =0 |
virtual Position | getPosition () const =0 |
virtual Unit | getPowerUp () const =0 |
virtual Position | getRallyPosition () const =0 |
virtual Unit | getRallyUnit () const =0 |
BWAPI::Region | getRegion () const |
virtual int | getRemainingBuildTime () const =0 |
virtual int | getRemainingResearchTime () const =0 |
virtual int | getRemainingTrainTime () const =0 |
virtual int | getRemainingUpgradeTime () const =0 |
virtual int | getRemoveTimer () const =0 |
virtual int | getReplayID () const =0 |
virtual int | getResourceGroup () const =0 |
virtual int | getResources () const =0 |
int | getRight () const |
virtual int | getScarabCount () const =0 |
virtual Order | getSecondaryOrder () const =0 |
virtual int | getShields () const =0 |
int | getSpaceRemaining () const |
virtual int | getSpellCooldown () const =0 |
virtual int | getSpiderMineCount () const =0 |
virtual int | getStasisTimer () const =0 |
virtual int | getStimTimer () const =0 |
virtual Unit | getTarget () const =0 |
virtual Position | getTargetPosition () const =0 |
virtual TechType | getTech () const =0 |
TilePosition | getTilePosition () const |
int | getTop () const |
virtual UnitType::list | getTrainingQueue () const =0 |
virtual Unit | getTransport () const =0 |
virtual UnitType | getType () const =0 |
Unitset | getUnitsInRadius (int radius, const UnitFilter &pred=nullptr) const |
Unitset | getUnitsInWeaponRange (WeaponType weapon, const UnitFilter &pred=nullptr) const |
virtual UpgradeType | getUpgrade () const =0 |
virtual double | getVelocityX () const =0 |
virtual double | getVelocityY () const =0 |
virtual bool | hasNuke () const =0 |
bool | hasPath (Position target) const |
bool | hasPath (Unit target) const |
virtual bool | isAccelerating () const =0 |
virtual bool | isAttackFrame () const =0 |
virtual bool | isAttacking () const =0 |
bool | isBeingConstructed () const |
virtual bool | isBeingGathered () const =0 |
virtual bool | isBeingHealed () const =0 |
virtual bool | isBlind () const =0 |
virtual bool | isBraking () const =0 |
virtual bool | isBurrowed () const =0 |
virtual bool | isCarryingGas () const =0 |
virtual bool | isCarryingMinerals () const =0 |
virtual bool | isCloaked () const =0 |
virtual bool | isCompleted () const =0 |
virtual bool | isConstructing () const =0 |
bool | isDefenseMatrixed () const |
virtual bool | isDetected () const =0 |
bool | isEnsnared () const |
bool | isFlying () const |
bool | isFollowing () const |
virtual bool | isGatheringGas () const =0 |
virtual bool | isGatheringMinerals () const =0 |
virtual bool | isHallucination () const =0 |
bool | isHoldingPosition () const |
virtual bool | isIdle () const =0 |
virtual bool | isInterruptible () const =0 |
virtual bool | isInvincible () const =0 |
bool | isInWeaponRange (Unit target) const |
bool | isIrradiated () const |
virtual bool | isLifted () const =0 |
bool | isLoaded () const |
bool | isLockedDown () const |
bool | isMaelstrommed () const |
virtual bool | isMorphing () const =0 |
virtual bool | isMoving () const =0 |
virtual bool | isParasited () const =0 |
bool | isPatrolling () const |
bool | isPlagued () const |
virtual bool | isPowered () const =0 |
bool | isRepairing () const |
bool | isResearching () const |
virtual bool | isSelected () const =0 |
bool | isSieged () const |
virtual bool | isStartingAttack () const =0 |
bool | isStasised () const |
bool | isStimmed () const |
virtual bool | isStuck () const =0 |
virtual bool | isTargetable () const =0 |
virtual bool | isTraining () const =0 |
virtual bool | isUnderAttack () const =0 |
virtual bool | isUnderDarkSwarm () const =0 |
virtual bool | isUnderDisruptionWeb () const =0 |
virtual bool | isUnderStorm () const =0 |
bool | isUpgrading () const |
virtual bool | isVisible (Player player=nullptr) const =0 |
Unit Commands | |
virtual bool | issueCommand (UnitCommand command)=0 |
bool | attack (Position target, bool shiftQueueCommand=false) |
bool | attack (Unit target, bool shiftQueueCommand=false) |
bool | build (UnitType type, TilePosition target=TilePositions::None) |
bool | buildAddon (UnitType type) |
bool | train (UnitType type=UnitTypes::None) |
bool | morph (UnitType type) |
bool | research (TechType tech) |
bool | upgrade (UpgradeType upgrade) |
bool | setRallyPoint (Position target) |
bool | setRallyPoint (Unit target) |
bool | move (Position target, bool shiftQueueCommand=false) |
bool | patrol (Position target, bool shiftQueueCommand=false) |
bool | holdPosition (bool shiftQueueCommand=false) |
bool | stop (bool shiftQueueCommand=false) |
bool | follow (Unit target, bool shiftQueueCommand=false) |
bool | gather (Unit target, bool shiftQueueCommand=false) |
bool | returnCargo (bool shiftQueueCommand=false) |
bool | repair (Unit target, bool shiftQueueCommand=false) |
bool | burrow () |
bool | unburrow () |
bool | cloak () |
bool | decloak () |
bool | siege () |
bool | unsiege () |
bool | lift () |
bool | land (TilePosition target) |
bool | load (Unit target, bool shiftQueueCommand=false) |
bool | unload (Unit target) |
bool | unloadAll (bool shiftQueueCommand=false) |
bool | unloadAll (Position target, bool shiftQueueCommand=false) |
bool | rightClick (Position target, bool shiftQueueCommand=false) |
bool | rightClick (Unit target, bool shiftQueueCommand=false) |
bool | haltConstruction () |
bool | cancelConstruction () |
bool | cancelAddon () |
bool | cancelTrain (int slot=-2) |
bool | cancelMorph () |
bool | cancelResearch () |
bool | cancelUpgrade () |
bool | useTech (TechType tech, Position target) |
bool | useTech (TechType tech, Unit target=nullptr) |
bool | placeCOP (TilePosition target) |
Command Verifiers | |
virtual bool | canIssueCommand (UnitCommand command, bool checkCanUseTechPositionOnPositions=true, bool checkCanUseTechUnitOnUnits=true, bool checkCanBuildUnitType=true, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canIssueCommandGrouped (UnitCommand command, bool checkCanUseTechPositionOnPositions=true, bool checkCanUseTechUnitOnUnits=true, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canCommand () const =0 |
virtual bool | canCommandGrouped (bool checkCommandibility=true) const =0 |
virtual bool | canIssueCommandType (UnitCommandType ct, bool checkCommandibility=true) const =0 |
virtual bool | canIssueCommandTypeGrouped (UnitCommandType ct, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canTargetUnit (Unit targetUnit, bool checkCommandibility=true) const =0 |
virtual bool | canAttack (bool checkCommandibility=true) const =0 |
virtual bool | canAttack (Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttack (Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackGrouped (Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackGrouped (Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackMove (bool checkCommandibility=true) const =0 |
virtual bool | canAttackMoveGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackUnit (bool checkCommandibility=true) const =0 |
virtual bool | canAttackUnit (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackUnitGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canAttackUnitGrouped (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canBuild (bool checkCommandibility=true) const =0 |
virtual bool | canBuild (UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canBuild (UnitType uType, BWAPI::TilePosition tilePos, bool checkTargetUnitType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canBuildAddon (bool checkCommandibility=true) const =0 |
virtual bool | canBuildAddon (UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canTrain (bool checkCommandibility=true) const =0 |
virtual bool | canTrain (UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canMorph (bool checkCommandibility=true) const =0 |
virtual bool | canMorph (UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canResearch (bool checkCommandibility=true) const =0 |
virtual bool | canResearch (TechType type, bool checkCanIssueCommandType=true) const =0 |
virtual bool | canUpgrade (bool checkCommandibility=true) const =0 |
virtual bool | canUpgrade (UpgradeType type, bool checkCanIssueCommandType=true) const =0 |
virtual bool | canSetRallyPoint (bool checkCommandibility=true) const =0 |
virtual bool | canSetRallyPoint (Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canSetRallyPoint (Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canSetRallyPosition (bool checkCommandibility=true) const =0 |
virtual bool | canSetRallyUnit (bool checkCommandibility=true) const =0 |
virtual bool | canSetRallyUnit (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canMove (bool checkCommandibility=true) const =0 |
virtual bool | canMoveGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canPatrol (bool checkCommandibility=true) const =0 |
virtual bool | canPatrolGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canFollow (bool checkCommandibility=true) const =0 |
virtual bool | canFollow (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canGather (bool checkCommandibility=true) const =0 |
virtual bool | canGather (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canReturnCargo (bool checkCommandibility=true) const =0 |
virtual bool | canHoldPosition (bool checkCommandibility=true) const =0 |
virtual bool | canStop (bool checkCommandibility=true) const =0 |
virtual bool | canRepair (bool checkCommandibility=true) const =0 |
virtual bool | canRepair (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canBurrow (bool checkCommandibility=true) const =0 |
virtual bool | canUnburrow (bool checkCommandibility=true) const =0 |
virtual bool | canCloak (bool checkCommandibility=true) const =0 |
virtual bool | canDecloak (bool checkCommandibility=true) const =0 |
virtual bool | canSiege (bool checkCommandibility=true) const =0 |
virtual bool | canUnsiege (bool checkCommandibility=true) const =0 |
virtual bool | canLift (bool checkCommandibility=true) const =0 |
virtual bool | canLand (bool checkCommandibility=true) const =0 |
virtual bool | canLand (TilePosition target, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canLoad (bool checkCommandibility=true) const =0 |
virtual bool | canLoad (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUnloadWithOrWithoutTarget (bool checkCommandibility=true) const =0 |
virtual bool | canUnloadAtPosition (Position targDropPos, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUnload (bool checkCommandibility=true) const =0 |
virtual bool | canUnload (Unit targetUnit, bool checkCanTargetUnit=true, bool checkPosition=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUnloadAll (bool checkCommandibility=true) const =0 |
virtual bool | canUnloadAllPosition (bool checkCommandibility=true) const =0 |
virtual bool | canUnloadAllPosition (Position targDropPos, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClick (bool checkCommandibility=true) const =0 |
virtual bool | canRightClick (Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClick (Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickGrouped (Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickGrouped (Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickPosition (bool checkCommandibility=true) const =0 |
virtual bool | canRightClickPositionGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickUnit (bool checkCommandibility=true) const =0 |
virtual bool | canRightClickUnit (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickUnitGrouped (bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canRightClickUnitGrouped (Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const =0 |
virtual bool | canHaltConstruction (bool checkCommandibility=true) const =0 |
virtual bool | canCancelConstruction (bool checkCommandibility=true) const =0 |
virtual bool | canCancelAddon (bool checkCommandibility=true) const =0 |
virtual bool | canCancelTrain (bool checkCommandibility=true) const =0 |
virtual bool | canCancelTrainSlot (bool checkCommandibility=true) const =0 |
virtual bool | canCancelTrainSlot (int slot, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canCancelMorph (bool checkCommandibility=true) const =0 |
virtual bool | canCancelResearch (bool checkCommandibility=true) const =0 |
virtual bool | canCancelUpgrade (bool checkCommandibility=true) const =0 |
virtual bool | canUseTechWithOrWithoutTarget (bool checkCommandibility=true) const =0 |
virtual bool | canUseTechWithOrWithoutTarget (BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTech (BWAPI::TechType tech, Position target, bool checkCanTargetUnit=true, bool checkTargetsType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTech (BWAPI::TechType tech, Unit target=nullptr, bool checkCanTargetUnit=true, bool checkTargetsType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTechWithoutTarget (BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTechUnit (BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTechUnit (BWAPI::TechType tech, Unit targetUnit, bool checkCanTargetUnit=true, bool checkTargetsUnits=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTechPosition (BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canUseTechPosition (BWAPI::TechType tech, Position target, bool checkTargetsPositions=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
virtual bool | canPlaceCOP (bool checkCommandibility=true) const =0 |
virtual bool | canPlaceCOP (TilePosition target, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const =0 |
The Unit class is used to get information about individual units as well as issue orders to units.
Each unit in the game has a unique Unit object, and Unit objects are not deleted until the end of the match (so you don't need to worry about unit pointers becoming invalid).
Every Unit in the game is either accessible or inaccessible. To determine if an AI can access a particular unit, BWAPI checks to see if Flag::CompleteMapInformation is enabled. So there are two cases to consider - either the flag is enabled, or it is disabled:
If Flag::CompleteMapInformation is disabled, then a unit is accessible if and only if it is visible.
If Flag::CompleteMapInformation is enabled, then all units that exist in the game are accessible, and UnitInterface::exists is accurate for all units. Similarly AIModule::onUnitDestroy messages are generated for all units that get destroyed, not just visible ones.
If a Unit is not accessible, then only the getInitial__ functions will be available to the AI. However for units that were owned by the player, getPlayer and getType will continue to work for units that have been destroyed.
Retrieves a unique identifier for this unit.
Checks if the Unit exists in the view of the BWAPI player.
This is used primarily to check if BWAPI has access to a specific unit, or if the unit is alive. This function is more general and would be synonymous to an isAlive function if such a function were necessary.
true | If the unit exists on the map and is visible according to BWAPI. |
false | If the unit is not accessible or the unit is dead. |
In the event that this function returns false, there are two cases to consider:
Retrieves the unit identifier for this unit as seen in replay data.
Retrieves the player that owns this unit.
Game::neutral() | If the unit is a neutral unit or inaccessible. |
Retrieves the unit's type.
UnitTypes::Unknown | if this unit is inaccessible or cannot be determined. |
Retrieves the unit's position from the upper left corner of the map in pixels.
The position returned is roughly the center if the unit.
Positions::Unknown | if this unit is inaccessible. |
Retrieves the unit's build position from the upper left corner of the map in tiles.
TilePositions::Unknown | if this unit is inaccessible. |
Retrieves the unit's facing direction in radians.
Retrieves the x component of the unit's velocity, measured in pixels per frame.
Retrieves the y component of the unit's velocity, measured in pixels per frame.
Retrieves the Region that the center of the unit is in.
nullptr | If the unit is inaccessible. |
Example
Retrieves the unit's current Hit Points (HP) as seen in the game.
Retrieves the unit's current Shield Points (Shields) as seen in the game.
Retrieves the unit's current Energy Points (Energy) as seen in the game.
Retrieves the resource amount from a resource container, such as a Mineral Field and Vespene Geyser.
If the unit is inaccessible, then the last known resource amount is returned.
Retrieves a grouping index from a resource container.
Other resource containers of the same value are considered part of one expansion location (group of resources that are close together).
Retrieves the distance between this unit and a target position.
target | A Position to calculate the distance to. |
target
. Retrieves the distance between this unit and a target unit.
target | A Unit to calculate the distance to. Calculate the distance to the edge of the target unit. |
target
. Using data provided by Starcraft, checks if there is a path available from this unit to the given target.
target | A Position or a Unit that is used to determine if this unit has a path to the target. |
Using data provided by Starcraft, checks if there is a path available from this unit to the given target.
target | A Position or a Unit that is used to determine if this unit has a path to the target. |
true | If there is a path between this unit and the target. |
false | If the target is on a different piece of land than this one (such as an island). |
Retrieves the frame number that sent the last successful command.
Retrieves the last successful command that was sent to BWAPI.
Retrieves the Player that last attacked this unit.
nullptr | If this unit was not attacked. |
Retrieves the initial type of the unit.
This is the type that the unit starts as in the beginning of the game. This is used to access the types of static neutral units such as mineral fields when they are not visible.
UnitTypes::Unknown | if this unit was not a static neutral unit in the beginning of the game. |
Retrieves the initial position of this unit.
This is the position that the unit starts at in the beginning of the game. This is used to access the positions of static neutral units such as mineral fields when they are not visible.
Positions::Unknown | if this unit was not a static neutral unit in the beginning of the game. |
Retrieves the initial build tile position of this unit.
This is the tile position that the unit starts at in the beginning of the game. This is used to access the tile positions of static neutral units such as mineral fields when they are not visible. The build tile position corresponds to the upper left corner of the unit.
TilePositions::Unknown | if this unit was not a static neutral unit in the beginning of the game. |
Retrieves the amount of hit points that this unit started off with at the beginning of the game.
The unit must be neutral.
0 | if this unit was not a neutral unit at the beginning of the game. |
Retrieves the amount of resources contained in the unit at the beginning of the game.
The unit must be a neutral resource container.
0 | if this unit was not a neutral unit at the beginning of the game, or if this unit does not contain resources. It is possible that the unit simply contains 0 resources. |
Retrieves the number of units that this unit has killed in total.
Retrieves the number of acid spores that this unit is inflicted with.
Retrieves the number of interceptors that this unit manages.
This function is only for the Carrier and its hero.
Retrieves the number of scarabs that this unit has for use.
This function is only for the Reaver.
Retrieves the amount of Spider Mines this unit has available.
This function is only for the Vulture.
Retrieves the unit's ground weapon cooldown.
This value decreases every frame, until it reaches 0. When the value is 0, this indicates that the unit is capable of using its ground weapon, otherwise it must wait until it reaches 0.
Retrieves the unit's air weapon cooldown.
This value decreases every frame, until it reaches 0. When the value is 0, this indicates that the unit is capable of using its air weapon, otherwise it must wait until it reaches 0.
Retrieves the unit's ability cooldown.
This value decreases every frame, until it reaches 0. When the value is 0, this indicates that the unit is capable of using one of its special abilities, otherwise it must wait until it reaches 0.
Retrieves the amount of hit points remaining on the Defensive Matrix created by a Science Vessel.
The Defensive Matrix ability starts with 250 hit points when it is used.
Retrieves the time, in frames, that the Defensive Matrix will remain active on the current unit.
Retrieves the time, in frames, that Ensnare will remain active on the current unit.
Retrieves the time, in frames, that Irradiate will remain active on the current unit.
Retrieves the time, in frames, that Lockdown will remain active on the current unit.
Retrieves the time, in frames, that Maelstrom will remain active on the current unit.
Retrieves an internal timer used for the primary order.
Its use is specific to the order type that is currently assigned to the unit.
Retrieves the time, in frames, until this temporary unit is destroyed or removed.
This is used to determine the remaining time for the following units that were created by abilities:
Once this value reaches 0, the unit is destroyed.
Retrieves the time, in frames, that Stasis Field will remain active on the current unit.
Retrieves the time, in frames, that Stim Packs will remain active on the current unit.
Retrieves the list of units queued up to be trained.
Retrieves the technology that this unit is currently researching.
TechTypes::None | if this unit is not researching anything. |
Retrieves the upgrade that this unit is currently upgrading.
UpgradeTypes::None | if this unit is not upgrading anything. |
Retrieves the remaining build time for a unit or structure that is being trained or constructed.
Retrieves the remaining time, in frames, of the unit that is currently being trained.
0 | If the unit is not training or has three larvae. |
Retrieves the amount of time until the unit is done researching its currently assigned TechType.
0 | If the unit is not researching anything. |
Retrieves the amount of time until the unit is done upgrading its current upgrade.
0 | If the unit is not upgrading anything. |
Retrieves the unit currently being trained, or the corresponding paired unit for SCVs and Terran structures, depending on the context.
For example, if this unit is a Factory under construction, this function will return the SCV that is constructing it. If this unit is a SCV, then it will return the structure it is currently constructing. If this unit is a Nexus, and it is training a Probe, then the probe will be returned.
nullptr | If there is no unit constructing this one, or this unit is not constructing another unit. |
Generally returns the appropriate target unit after issuing an order that accepts a target unit (i.e.
attack, repair, gather, etc.).
To get a target that has been acquired automatically without issuing an order, use getOrderTarget.
Retrieves the target position the unit is moving to, provided a valid path to the target position exists.
Retrieves the primary Order that the unit is assigned.
Primary orders are distinct actions such as Orders::AttackUnit and Orders::PlayerGuard.
Retrieves the secondary Order that the unit is assigned.
Secondary orders are run in the background as a sub-order. An example would be Orders::TrainFighter, because a Carrier can move and train fighters at the same time.
Retrieves the unit's primary order target.
This is usually set when the low level unit AI acquires a new target automatically. For example if an enemy Probe comes in range of your Marine, the Marine will start attacking it, and getOrderTarget will be set in this case, but not getTarget.
Retrieves the target position for the unit's order.
For example, when Orders::Move is assigned, getTargetPosition returns the end of the unit's path, but this returns the location that the unit is trying to move to.
Retrieves the position the structure is rallying units to once they are completed.
Positions::None | If this building does not produce units. |
Retrieves the unit the structure is rallying units to once they are completed.
Units will then follow the targetted unit.
nullptr | If the structure is not rallied to a unit or it does not produce units. |
Retrieves the add-on that is attached to this unit.
nullptr | if this unit does not have an add-on. |
Retrieves the Nydus Canal that is attached to this one.
Every Nydus Canal can place a "Nydus Exit" which, when connected, can be travelled through by Zerg units.
nullptr | if the unit is not a Nydus Canal, is not owned, or has not placed a Nydus Exit. |
Retrieves the power-up that the worker unit is holding.
Power-ups are special units such as the Flag in the Capture The Flag game type, which can be picked up by worker units.
nullptr | If the unit is not carrying anything. |
Example
Retrieves the remaining unit-space available for Bunkers and Transports(Dropships, Shuttles, Overlords ).
Retrieves the parent Carrier that owns this Interceptor.
nullptr | if the current unit is not an Interceptor. |
Retrieves the set of Interceptors controlled by this unit.
This is intended for Carriers and its hero.
Retrieves the set of Larvae that were spawned by this unit.
Only Hatcheries, Lairs, and Hives are capable of spawning Larvae. This is like clicking the "Select Larva" button and getting the selection of Larvae.
nullptr
) constRetrieves the set of all units in a given radius of the current unit.
Takes into account this unit's dimensions. Can optionally specify a filter that is composed using BWAPIFilter semantics to include only specific units (such as only ground units, etc.)
radius | The radius, in pixels, to search for units. |
pred | (optional) The composed function predicate to include only specific (desired) units in the set. Defaults to nullptr, which means no filter. |
Example usage:
nullptr
) constObtains the set of units within weapon range of this unit.
weapon | The weapon type to use as a filter for distance and units that can be hit by it. |
pred | (optional) A predicate used as an additional filter. If omitted, no additional filter is used. |
nullptr
, int radius = 999999
) constRetrieves the closest unit to this one.
pred | (optional) A function predicate used to identify which conditions must be matched for a unit to be considered. If omitted, then the closest unit owned by any player will be returned. |
radius | (optional) The maximum radius to check for the closest unit. For performance reasons, a developer can limit the radius that is checked. If omitted, then the entire map is checked. |
Checks if the current unit is housing a Nuke.
This is only available for Nuclear Silos.
Checks if the current unit is accelerating.
Checks if this unit is currently attacking something.
Checks if this unit is currently playing an attack animation.
Issuing commands while this returns true may interrupt the unit's next attack sequence.
Checks if the current unit is being constructed.
This is mostly applicable to Terran structures which require an SCV to be constructing a structure.
true | if this is either a Protoss structure, Zerg structure, or Terran structure being constructed by an attached SCV. |
false | if this is either completed, not a structure, or has no SCV constructing it |
Checks this Mineral Field or Refinery is currently being gathered from.
Checks if this unit is currently blinded by a Medic 's Optical Flare ability.
Blinded units have reduced sight range and cannot detect other units.
Checks if the current unit is slowing down to come to a stop.
Checks if the current unit is burrowed, either using the Burrow ability, or is an armed Spider Mine.
Checks if this worker unit is carrying some vespene gas.
Example
Checks if this worker unit is carrying some minerals.
Example
Checks if this unit has finished being constructed, trained, morphed, or warped in, and can now receive orders.
Checks if a unit is either constructing something or moving to construct something.
Checks if this unit has the Defensive Matrix effect.
Checks if this unit is visible or revealed by a detector unit.
If this is false and isVisible is true, then the unit is only partially visible and requires a detector in order to be targetted.
This macro function checks if this unit is in the air.
That is, the unit is either a flyer or a flying building.
Checks if this unit is following another unit.
When a unit is following another unit, it simply moves where the other unit does, and does not attack enemies when it is following.
Checks if this unit is currently gathering gas.
That is, the unit is either moving to a refinery, waiting to enter a refinery, harvesting from the refinery, or returning gas to a resource depot.
Checks if this unit is currently harvesting minerals.
That is, the unit is either moving to a Mineral Field, waiting to mine, mining minerals, or returning minerals to a resource depot.
Checks if this unit is a hallucination.
Hallucinations are created by the High Templar using the Hallucination ability. Enemy hallucinations are unknown if Flag::CompleteMapInformation is disabled. Hallucinations have a time limit until they are destroyed (see UnitInterface::getRemoveTimer).
Checks if the unit is currently holding position.
A unit that is holding position will attack other units, but will not chase after them.
Checks if this unit is running an idle order.
This function is particularly useful when checking for units that aren't doing any tasks that you assigned.
A unit is considered idle if it is not doing any of the following:
In addition to running one of the following orders:
Checks if the unit can be interrupted.
Checks the invincibility state for this unit.
Checks if the target unit can immediately be attacked by this unit in the current frame.
target | The target unit to use in this check. |
target
is within weapon range of this unit's appropriate weapon, and false otherwise. false | if target is invalid, inaccessible, too close, too far, or this unit does not have a weapon that can attack target . |
Checks if this unit is irradiated by a Science Vessel 's Irradiate ability.
Example usage:
Checks if this unit is a Terran building and lifted off the ground.
This function generally implies this->getType().isBuilding() and this->isCompleted() both return true.
Checks if this unit is currently loaded into another unit such as a Transport(Dropship, Shuttle, Overlord ).
Checks if this unit is currently locked by a Ghost.
Checks if this unit has been maelstrommed by a Dark Archon.
Finds out if the current unit is morphing or not.
Zerg units and structures often have the ability to morph into different types of units. This function allows you to identify when this process is occurring.
true | if the unit is currently morphing. |
false | if the unit is not morphing |
Checks if this unit is currently moving.
Checks if this unit has been parasited by some other player.
Checks if this unit is patrolling between two positions.
Checks if this unit has been been plagued by a Defiler.
Checks if this unit is a structure that is currently researching a technology.
See TechTypes for a complete list of technologies in Broodwar.
Checks if this unit has been selected in the user interface.
This function is only available if the flag Flag::UserInput is enabled.
Checks if this unit is currently sieged.
This is only applicable to Siege Tanks.
Checks if the unit is starting to attack.
Checks if this unit is inflicted with Stasis Field by an Arbiter.
Checks if this unit is currently under the influence of a Stim Packs.
Checks if this unit is currently trying to resolve a collision by randomly moving around.
Checks if this unit is training a new unit.
For example, a Barracks training a Marine.
Checks if the current unit is being attacked.
Has a small delay before this returns false again when the unit is no longer being attacked.
Checks if this unit is under the cover of a Dark Swarm.
Checks if this unit is currently being affected by a Disruption Web.
Checks if this unit is currently taking damage from a Psionic Storm.
Checks if this unit is a structure that is currently upgrading an upgrade.
See UpgradeTypes for a full list of upgrades in Broodwar.
Checks if this unit is visible.
player | (optional) The player to check visibility for. If this parameter is omitted, then the BWAPI player obtained from Game::self will be used. |
player
, and false if it is not.Performs some cheap checks to attempt to quickly detect whether the unit is unable to be targetted as the target unit of an unspecified command.
true | if BWAPI was unable to determine whether the unit can be a target. |
false | if an error occurred and the unit can not be a target. |
This function issues a command to the unit(s), however it is used for interfacing only, and is recommended to use one of the more specific command functions when writing an AI.
command | A UnitCommand containing command parameters such as the type, position, target, etc. |
Orders the unit(s) to attack move to the specified position.
target | A Position to designate as the target. The unit will perform an Attack Move command. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit(s) to attack the specified target unit.
target | A Unit to designate as the target. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the worker unit(s) to construct a structure at a target position.
type | The UnitType to build. |
target | A TilePosition to specify the build location, specifically the upper-left corner of the location. If the target is not specified, then the function call will be redirected to the train command. |
Orders the Terran structure(s) to construct an add-on.
type | The add-on UnitType to construct. |
UnitTypes::None
)Orders the unit(s) to add a UnitType to its training queue, or morphs into the UnitType if it is Zerg.
type | The UnitType to train. |
Orders the unit to upgrade the given upgrade type.
upgrade | The UpgradeType to upgrade. |
Orders the unit to set its rally position.
target | The target position that this structure will rally completed units to. |
Orders the unit to set its rally position to the specified unit.
target | The target unit that this structure will rally completed units to. |
Orders the unit to move from its current position to the specified position.
target | The target position to move to. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to patrol between its current position and the specified position.
While patrolling, units will attack and chase enemy units that they encounter, and then return to its patrol route. Medics will automatically heal units and then return to their patrol route.
target | The position to patrol to. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
false
)Orders the unit to hold its position.
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
false
)Orders the unit to stop.
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to follow the specified unit.
Units that are following other units will not perform any other actions such as attacking. They will ignore attackers.
target | The target unit to start following. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to gather the specified unit (must be mineral or refinery type).
target | The target unit to gather from. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
false
)Orders the unit to return its cargo to a nearby resource depot such as a Command Center.
Only workers that are carrying minerals or gas can be ordered to return cargo.
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to repair the specified unit.
Only Terran SCVs can be ordered to repair, and the target must be a mechanical Terran unit or building.
target | The unit to repair. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to burrow.
Either the unit must be a Lurker, or the unit must be a Zerg ground unit that is capable of Burrowing, and Burrow technology must be researched.
Orders a burrowed unit to unburrow.
Orders a cloaked unit to decloak.
Orders the unit to unsiege.
Only works for sieged Siege Tanks.
Orders the unit to land.
Only works for Terran structures that are currently lifted.
target | The tile position to land this structure at. |
Orders the unit to load the target unit.
Only works if this unit is a Transport(Dropship, Shuttle, Overlord ) or Bunker type.
target | The target unit to load into this Transport(Dropship, Shuttle, Overlord ) or Bunker. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to unload the target unit.
Only works for Transports(Dropships, Shuttles, Overlords ) and Bunkers.
target | Unloads the target unit from this Transport(Dropship, Shuttle, Overlord ) or Bunker. |
false
)Orders the unit to unload all loaded units at the unit's current position.
Only works for Transports(Dropships, Shuttles, Overlords ) and Bunkers.
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders the unit to unload all loaded units at the specified location.
Only works for Transports(Dropships, Shuttles, Overlords ). Not applicable to Bunkers.
target | The target position to unload the units at. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Performs a right click action as it would work in StarCraft.
target | The target position to right click. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Performs a right click action as it would work in StarCraft.
target | The target unit to right click. |
shiftQueueCommand | (optional) If this value is true, then the order will be queued instead of immediately executed. If this value is omitted, then the order will be executed immediately by default. |
Orders a SCV to stop constructing a structure.
This leaves the structure in an incomplete state until it is either cancelled, razed, or completed by another SCV.
Orders this unit to cancel and refund itself from begin constructed.
Orders this unit to cancel and refund an add-on that is being constructed.
-2
)Orders the unit to remove the specified unit from its training queue.
slot | (optional) Identifies the slot that will be cancelled. If the specified value is at least 0, then the unit in the corresponding slot from the list provided by getTrainingQueue will be cancelled. If the value is either omitted or -2, then the last slot is cancelled. |
Orders this unit to cancel and refund a unit that is morphing.
Orders this unit to cancel and refund a research that is in progress.
Orders this unit to cancel and refund an upgrade that is in progress.
Orders the unit to use a technology.
tech | The technology type to use. |
target | (optional) If specified, indicates the target unit to use the tech on. If unspecified, causes the tech to be used without a target (i.e. Stim Packs). |
Moves a Flag Beacon to a different location.
This is only used for Capture The Flag or Use Map Settings game types.
target | The target tile position to place the Flag Beacon. |
true
, bool checkCanUseTechUnitOnUnits = true
, bool checkCanBuildUnitType = true
, bool checkCanTargetUnit = true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute the given command.
If you are calling this function repeatedly (e.g. to generate a collection of valid commands), you can avoid repeating the same kinds of checks by specifying false for some of the optional boolean arguments. Make sure that the state hasn't changed since the check was done though (eg a new frame/event, or a command issued). Also see the more specific functions.
command | A UnitCommand to check. |
checkCanUseTechPositionOnPositions | Only used if the command type is UnitCommandTypes::Enum::Use_Tech_Position. A boolean for whether to perform cheap checks for whether the unit is unable to target any positions using the command's TechType (i.e. regardless of what the other command parameters are). You can set this to false if you know this check has already just been performed. |
checkCanUseTechUnitOnUnits | Only used if the command type is UnitCommandTypes::Enum::Use_Tech_Unit. A boolean for whether to perform cheap checks for whether the unit is unable to target any units using the command's TechType (i.e. regardless of what the other command parameters are). You can set this to false if you know this check has already just been performed. |
checkCanBuildUnitType | Only used if the command type is UnitCommandTypes::Build. A boolean for whether to perform cheap checks for whether the unit is unable to build the specified UnitType (i.e. regardless of what the other command parameters are). You can set this to false if you know this check has already just been performed. |
checkCanTargetUnit | Only used for command types that can target a unit. A boolean for whether to perform UnitInterface::canTargetUnit as a check. You can set this to false if you know this check has already just been performed. |
checkCanIssueCommandType | A boolean for whether to perform UnitInterface::canIssueCommandType as a check. You can set this to false if you know this check has already just been performed. |
checkCommandibility | A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false if you know this check has already just been performed. |
true | if BWAPI determined that the command is valid. |
false | if an error occurred and the command is invalid. |
true
, bool checkCanUseTechUnitOnUnits = true
, bool checkCanTargetUnit = true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute the given command as part of a Unitset (even if none of the units in the Unitset are able to execute the command individually).
The reason this function exists is because some commands are valid for an individual unit but not for those individuals as a group (e.g. buildings, critters) and some commands are only valid for a unit if it is commanded as part of a unit group, e.g.:
Performs some cheap checks to attempt to quickly detect whether the unit is unable to execute any commands (eg the unit is stasised).
true | if BWAPI was unable to determine whether the unit can be commanded. |
false | if an error occurred and the unit can not be commanded. |
true
) const pure virtualPerforms some cheap checks to attempt to quickly detect whether the unit is unable to execute any commands as part of a Unitset (eg buildings, critters).
true | if BWAPI was unable to determine whether the unit can be commanded grouped. |
false | if an error occurred and the unit can not be commanded grouped. |
true
) const pure virtualPerforms some cheap checks to attempt to quickly detect whether the unit is unable to execute the given command type (i.e.
regardless of what other possible command parameters could be).
ct | A UnitCommandType. |
checkCommandibility | A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false if you know this check has already just been performed. |
true | if BWAPI was unable to determine whether the command type is invalid. |
false | if an error occurred and the command type is invalid. |
true
, bool checkCommandibility = true
) const pure virtualPerforms some cheap checks to attempt to quickly detect whether the unit is unable to execute the given command type (i.e.
regardless of what other possible command parameters could be) as part of a Unitset.
ct | A UnitCommandType. |
checkCommandibilityGrouped | A boolean for whether to perform UnitInterface::canCommandGrouped as a check. You can set this to false if you know this check has already just been performed. |
checkCommandibility | A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false if you know this check has already just been performed. |
true | if BWAPI was unable to determine whether the command type is invalid. |
false | if an error occurred and the command type is invalid. |
true
) const pure virtualPerforms some cheap checks to attempt to quickly detect whether the unit is unable to use the given unit as the target unit of an unspecified command.
targetUnit | A target unit for an unspecified command. |
checkCommandibility | A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false if you know this check has already just been performed. |
true | if BWAPI was unable to determine whether the unit can target the given unit. |
false | if an error occurred and the unit can not target the given unit. |
true
) const pure virtualCheap checks for whether the unit is able to execute an attack command to attack-move or attack a unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an attack command to attack-move or attack a (non-null) unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute an attack command to attack-move or attack a unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an attack command to attack-move or attack a (non-null) unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
true
) const pure virtualChecks whether the unit is able to execute an attack command to attack-move.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an attack command to attack-move, as part of a Unitset.
true
) const pure virtualCheap checks for whether the unit is able to execute an attack command to attack a unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an attack command to attack a unit.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute an attack command to attack a unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an attack command to attack a unit, as part of a Unitset.
true
) const pure virtualCheap checks for whether the unit is able to execute a build command.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute a build command for the given UnitType.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a build command.
true
) const pure virtualCheap checks for whether the unit is able to execute a buildAddon command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a buildAddon command.
true
) const pure virtualCheap checks for whether the unit is able to execute a train command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a train command.
true
) const pure virtualCheap checks for whether the unit is able to execute a morph command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a morph command.
true
) const pure virtualCheap checks for whether the unit is able to execute a research command.
true
) const pure virtualChecks whether the unit is able to execute a research command.
true
) const pure virtualCheap checks for whether the unit is able to execute an upgrade command.
true
) const pure virtualChecks whether the unit is able to execute an upgrade command.
true
) const pure virtualCheap checks for whether the unit is able to execute a setRallyPoint command to a position or unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a setRallyPoint command to a position or (non-null) unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
true
) const pure virtualChecks whether the unit is able to execute a setRallyPoint command to a position.
true
) const pure virtualCheap checks for whether the unit is able to execute a setRallyPoint command to a unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a setRallyPoint command to a unit.
true
) const pure virtualChecks whether the unit is able to execute a move command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a move command, as part of a Unitset.
true
) const pure virtualChecks whether the unit is able to execute a patrol command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a patrol command, as part of a Unitset.
true
) const pure virtualCheap checks for whether the unit is able to execute a follow command.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a follow command.
true
) const pure virtualCheap checks for whether the unit is able to execute a gather command.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a gather command.
true
) const pure virtualChecks whether the unit is able to execute a returnCargo command.
true
) const pure virtualChecks whether the unit is able to execute a holdPosition command.
true
) const pure virtualChecks whether the unit is able to execute a stop command.
true
) const pure virtualCheap checks for whether the unit is able to execute a repair command.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a repair command.
true
) const pure virtualChecks whether the unit is able to execute a burrow command.
true
) const pure virtualChecks whether the unit is able to execute an unburrow command.
true
) const pure virtualChecks whether the unit is able to execute a cloak command.
true
) const pure virtualChecks whether the unit is able to execute a decloak command.
true
) const pure virtualChecks whether the unit is able to execute a siege command.
true
) const pure virtualChecks whether the unit is able to execute an unsiege command.
true
) const pure virtualChecks whether the unit is able to execute a lift command.
true
) const pure virtualCheap checks for whether the unit is able to execute a land command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a land command.
true
) const pure virtualCheap checks for whether the unit is able to execute a load command.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a load command.
true
) const pure virtualCheap checks for whether the unit is able to execute an unload command or unloadAll at current position command or unloadAll at a different position command.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute an unload command or unloadAll at current position command or unloadAll at a different position command, for a given position.
true
) const pure virtualCheap checks for whether the unit is able to execute an unload command.
true
, bool checkPosition = true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an unload command.
true
) const pure virtualChecks whether the unit is able to execute an unloadAll command for the current position.
true
) const pure virtualCheap checks for whether the unit is able to execute an unloadAll command for a different position.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute an unloadAll command for a different position.
true
) const pure virtualCheap checks for whether the unit is able to execute a rightClick command to a position or unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a rightClick command to a position or (non-null) unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualtrue
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute a rightClick command to a position or unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a rightClick command to a position or (non-null) unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
true
) const pure virtualChecks whether the unit is able to execute a rightClick command for a position.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a rightClick command for a position, as part of a Unitset.
true
) const pure virtualCheap checks for whether the unit is able to execute a rightClick command to a unit.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a rightClick command to a unit.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute a rightClick command to a unit, as part of a Unitset.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibilityGrouped = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a rightClick command to a unit, as part of a Unitset.
true
) const pure virtualChecks whether the unit is able to execute a haltConstruction command.
true
) const pure virtualChecks whether the unit is able to execute a cancelConstruction command.
true
) const pure virtualChecks whether the unit is able to execute a cancelAddon command.
true
) const pure virtualChecks whether the unit is able to execute a cancelTrain command for any slot.
true
) const pure virtualCheap checks for whether the unit is able to execute a cancelTrain command for an unspecified slot.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a cancelTrain command for a specified slot.
true
) const pure virtualChecks whether the unit is able to execute a cancelMorph command.
true
) const pure virtualChecks whether the unit is able to execute a cancelResearch command.
true
) const pure virtualChecks whether the unit is able to execute a cancelUpgrade command.
true
) const pure virtualCheap checks for whether the unit is able to execute a useTech command without a target or or a useTech command with a target position or a useTech command with a target unit.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute a useTech command without a target or or a useTech command with a target position or a useTech command with a target unit, for a given TechType.
true
, bool checkTargetsType = true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a useTech command for a specified position or unit (only specify nullptr if the TechType does not target another position/unit).
nullptr
, bool checkCanTargetUnit = true
, bool checkTargetsType = true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a useTech command without a target.
true
, bool checkCommandibility = true
) const pure virtualCheap checks for whether the unit is able to execute a useTech command with an unspecified target unit.
true
, bool checkTargetsUnits = true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a useTech command with a target unit.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a useTech command with an unspecified target position.
true
, bool checkCanIssueCommandType = true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a useTech command with a target position.
true
) const pure virtualCheap checks for whether the unit is able to execute a placeCOP command.
true
, bool checkCommandibility = true
) const pure virtualChecks whether the unit is able to execute a placeCOP command.