Class header file: BWAPI/UnitCommand.h
UnitCommand objects are currently used only as arguments to one function - Unit::issueCommand. While units can be issued commands the normal way via the Unit methods (i.e. Unit::attack), in some cases you may want to have a function that can process any unit command, such as when you're writing a proxy for BWAPI.
Named Constructors
- attack(Unit* unit, Position target, bool shiftQueueCommand = false);
- attack(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- build(Unit* unit, TilePosition target, UnitType type);
- buildAddon(Unit* unit, UnitType type);
- train(Unit* unit, UnitType type);
- morph(Unit* unit, UnitType type);
- research(Unit* unit, TechType tech);
- upgrade(Unit* unit, UpgradeType upgrade);
- setRallyPointPosition(Unit* unit, Position target);
- setRallyPoint(Unit* unit, Unit* target);
- move(Unit* unit, Position target, bool shiftQueueCommand = false);
- patrol(Unit* unit, Position target, bool shiftQueueCommand = false);
- holdPosition(Unit* unit, bool shiftQueueCommand = false);
- stop(Unit* unit, bool shiftQueueCommand = false);
- follow(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- gather(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- returnCargo(Unit* unit, bool shiftQueueCommand = false);
- repair(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- burrow(Unit* unit);
- unburrow(Unit* unit);
- cloak(Unit* unit);
- decloak(Unit* unit);
- siege(Unit* unit);
- unsiege(Unit* unit);
- lift(Unit* unit);
- land(Unit* unit, TilePosition target);
- load(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- unload(Unit* unit, Unit* target);
- unloadAll(Unit* unit, bool shiftQueueCommand = false);
- unloadAll(Unit* unit, Position target, bool shiftQueueCommand = false);
- rightClick(Unit* unit, Position target, bool shiftQueueCommand = false);
- rightClick(Unit* unit, Unit* target, bool shiftQueueCommand = false);
- haltConstruction(Unit* unit);
- cancelConstruction(Unit* unit);
- cancelAddon(Unit* unit);
- cancelTrain(Unit* unit, int slot = -2);
- cancelMorph(Unit* unit);
- cancelResearch(Unit* unit);
- cancelUpgrade(Unit* unit);
- useTech(Unit* unit,TechType tech);
- useTech(Unit* unit,TechType tech, Position target);
- useTech(Unit* unit,TechType tech, Unit* target);
- placeCOP(Unit* unit, TilePosition target);
Methods
getType
UnitCommandType getType() const;
Returns the type of the command
getUnit
Unit* getUnit() const;
Returns the unit to which the command has been issued.
getTarget
Unit* getTarget() const;
Returns the target unit of the command, or null if there is no target unit.
getTargetPosition
Position getTargetPosition() const;
Returns the target position of the command, or Positions::None if there is no target position.
getTargetTilePosition
TilePosition getTargetTilePosition() const;
Returns the target tile position of the command, or Positions::None if there is no target tile position.
getUnitType
UnitType getUnitType() const;
Returns the unit type of the command, or UnitTypes::None if the command is not of type Build, Build_Addon?, Train, or Morph.
getTechType
TechType getTechType() const;
Returns the tech type of the command, or TechTypes::None if the command is not of type Research, Use_Tech, Use_Tech_Position, or Use_Tech_Unit.
getUpgradeType
UpgradeType getUpgradeType() const;
Returns the upgrade type of the command, or UpgradeTypes::None if the command is not of type Upgrade.
getSlot
int getSlot() const;
Returns the slot of the command, or -1 if the command is not of type Cancel_Train_Slot.
isQueued
bool isQueued() const;
Returns true if the command is a queued command.