#include <UnitImpl.h>
Public Member Functions | |
void | clear () |
void | saveInitialState () |
UnitImpl (int id) | |
virtual int | getID () const |
virtual Player * | getPlayer () const |
virtual UnitType | getType () const |
virtual Position | getPosition () const |
virtual TilePosition | getTilePosition () const |
virtual double | getAngle () const |
virtual double | getVelocityX () const |
virtual double | getVelocityY () const |
virtual int | getHitPoints () const |
virtual int | getShields () const |
virtual int | getEnergy () const |
virtual int | getResources () const |
virtual int | getResourceGroup () const |
virtual int | getDistance (Unit *target) const |
virtual int | getDistance (Position target) const |
virtual bool | hasPath (Unit *target) const |
virtual bool | hasPath (Position target) const |
virtual int | getLastCommandFrame () const |
virtual UnitCommand | getLastCommand () const |
virtual int | getUpgradeLevel (UpgradeType upgrade) const |
virtual UnitType | getInitialType () const |
virtual Position | getInitialPosition () const |
virtual TilePosition | getInitialTilePosition () const |
virtual int | getInitialHitPoints () const |
virtual int | getInitialResources () const |
virtual int | getKillCount () const |
virtual int | getAcidSporeCount () const |
virtual int | getInterceptorCount () const |
virtual int | getScarabCount () const |
virtual int | getSpiderMineCount () const |
virtual int | getGroundWeaponCooldown () const |
virtual int | getAirWeaponCooldown () const |
virtual int | getSpellCooldown () const |
virtual int | getDefenseMatrixPoints () const |
virtual int | getDefenseMatrixTimer () const |
virtual int | getEnsnareTimer () const |
virtual int | getIrradiateTimer () const |
virtual int | getLockdownTimer () const |
virtual int | getMaelstromTimer () const |
virtual int | getOrderTimer () const |
virtual int | getPlagueTimer () const |
virtual int | getRemoveTimer () const |
virtual int | getStasisTimer () const |
virtual int | getStimTimer () const |
virtual UnitType | getBuildType () const |
virtual std::list< UnitType > | getTrainingQueue () const |
virtual TechType | getTech () const |
virtual UpgradeType | getUpgrade () const |
virtual int | getRemainingBuildTime () const |
virtual int | getRemainingTrainTime () const |
virtual int | getRemainingResearchTime () const |
virtual int | getRemainingUpgradeTime () const |
virtual Unit * | getBuildUnit () const |
virtual Unit * | getTarget () const |
virtual Position | getTargetPosition () const |
virtual Order | getOrder () const |
virtual Unit * | getOrderTarget () const |
virtual Position | getOrderTargetPosition () const |
virtual Order | getSecondaryOrder () const |
virtual Position | getRallyPosition () const |
virtual Unit * | getRallyUnit () const |
virtual Unit * | getAddon () const |
virtual Unit * | getNydusExit () const |
virtual Unit * | getPowerUp () const |
virtual Unit * | getTransport () const |
virtual std::set< Unit * > | getLoadedUnits () const |
virtual Unit * | getCarrier () const |
virtual std::set< Unit * > | getInterceptors () const |
virtual Unit * | getHatchery () const |
virtual std::set< Unit * > | getLarva () const |
virtual std::set< Unit * > & | getUnitsInRadius (int radius) const |
virtual std::set< Unit * > & | getUnitsInWeaponRange (WeaponType weapon) const |
virtual bool | exists () const |
virtual bool | hasNuke () const |
virtual bool | isAccelerating () const |
virtual bool | isAttacking () const |
virtual bool | isAttackFrame () const |
virtual bool | isBeingConstructed () const |
virtual bool | isBeingGathered () const |
virtual bool | isBeingHealed () const |
virtual bool | isBlind () const |
virtual bool | isBraking () const |
virtual bool | isBurrowed () const |
virtual bool | isCarryingGas () const |
virtual bool | isCarryingMinerals () const |
virtual bool | isCloaked () const |
virtual bool | isCompleted () const |
virtual bool | isConstructing () const |
virtual bool | isDefenseMatrixed () const |
virtual bool | isDetected () const |
virtual bool | isEnsnared () const |
virtual bool | isFollowing () const |
virtual bool | isGatheringGas () const |
virtual bool | isGatheringMinerals () const |
virtual bool | isHallucination () const |
virtual bool | isHoldingPosition () const |
virtual bool | isIdle () const |
virtual bool | isInterruptible () const |
virtual bool | isInvincible () const |
virtual bool | isInWeaponRange (Unit *target) const |
virtual bool | isIrradiated () const |
virtual bool | isLifted () const |
virtual bool | isLoaded () const |
virtual bool | isLockedDown () const |
virtual bool | isMaelstrommed () const |
virtual bool | isMorphing () const |
virtual bool | isMoving () const |
virtual bool | isParasited () const |
virtual bool | isPatrolling () const |
virtual bool | isPlagued () const |
virtual bool | isRepairing () const |
virtual bool | isResearching () const |
virtual bool | isSelected () const |
virtual bool | isSieged () const |
virtual bool | isStartingAttack () const |
virtual bool | isStasised () const |
virtual bool | isStimmed () const |
virtual bool | isStuck () const |
virtual bool | isTraining () const |
virtual bool | isUnderStorm () const |
virtual bool | isUnderDarkSwarm () const |
virtual bool | isUnderDisruptionWeb () const |
virtual bool | isUnpowered () const |
virtual bool | isUpgrading () const |
virtual bool | isVisible () const |
virtual bool | isVisible (Player *player) const |
virtual bool | canIssueCommand (UnitCommand command) const |
virtual bool | issueCommand (UnitCommand command) |
virtual bool | attack (Position target, bool shiftQueueCommand=false) |
virtual bool | attack (Unit *target, bool shiftQueueCommand=false) |
virtual bool | build (TilePosition target, UnitType type) |
virtual bool | buildAddon (UnitType type) |
virtual bool | train (UnitType type) |
virtual bool | morph (UnitType type) |
virtual bool | research (TechType tech) |
virtual bool | upgrade (UpgradeType upgrade) |
virtual bool | setRallyPoint (Position target) |
virtual bool | setRallyPoint (Unit *target) |
virtual bool | move (Position target, bool shiftQueueCommand=false) |
virtual bool | patrol (Position target, bool shiftQueueCommand=false) |
virtual bool | holdPosition (bool shiftQueueCommand=false) |
virtual bool | stop (bool shiftQueueCommand=false) |
virtual bool | follow (Unit *target, bool shiftQueueCommand=false) |
virtual bool | gather (Unit *target, bool shiftQueueCommand=false) |
virtual bool | returnCargo (bool shiftQueueCommand=false) |
virtual bool | repair (Unit *target, bool shiftQueueCommand=false) |
virtual bool | burrow () |
virtual bool | unburrow () |
virtual bool | cloak () |
virtual bool | decloak () |
virtual bool | siege () |
virtual bool | unsiege () |
virtual bool | lift () |
virtual bool | land (TilePosition target) |
virtual bool | load (Unit *target, bool shiftQueueCommand=false) |
virtual bool | unload (Unit *target) |
virtual bool | unloadAll (bool shiftQueueCommand=false) |
virtual bool | unloadAll (Position target, bool shiftQueueCommand=false) |
virtual bool | rightClick (Position target, bool shiftQueueCommand=false) |
virtual bool | rightClick (Unit *target, bool shiftQueueCommand=false) |
virtual bool | haltConstruction () |
virtual bool | cancelConstruction () |
virtual bool | cancelAddon () |
virtual bool | cancelTrain (int slot=-2) |
virtual bool | cancelMorph () |
virtual bool | cancelResearch () |
virtual bool | cancelUpgrade () |
virtual bool | useTech (TechType tech) |
virtual bool | useTech (TechType tech, Position target) |
virtual bool | useTech (TechType tech, Unit *target) |
virtual void | setClientInfo (void *clientinfo) |
virtual void * | getClientInfo () const |
virtual bool | placeCOP (TilePosition target) |
virtual bool | isUnderAttack () const |
virtual BWAPI::Player * | getLastAttackingPlayer () const |
Public Attributes | |
UnitData * | self |
std::set< Unit * > | connectedUnits |
std::set< Unit * > | loadedUnits |
BWAPI::UnitImpl::UnitImpl | ( | int | id | ) |
virtual bool BWAPI::UnitImpl::attack | ( | Position | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to attack move to the specified location.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::attack | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to attack the specified unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::build | ( | TilePosition | target, |
UnitType | type | ||
) | [virtual] |
Orders the unit to build the given unit type at the given position. Note that if the player does not have enough resources when the unit attempts to place the building down, the order will fail. The tile position specifies where the top left corner of the building will be placed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::buildAddon | ( | UnitType | type | ) | [virtual] |
Orders the unit to build the given addon. The unit must be a Terran building that can have an addon and the specified unit type must be an addon unit type.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::burrow | ( | ) | [virtual] |
Orders the unit to burrow. Either the unit must be a Zerg Lurker, or the unit must be a Zerg ground unit and burrow tech must be researched.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::cancelAddon | ( | ) | [virtual] |
Orders the unit to stop making the addon.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::cancelConstruction | ( | ) | [virtual] |
Orders the building to stop being constructed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::cancelMorph | ( | ) | [virtual] |
virtual bool BWAPI::UnitImpl::cancelResearch | ( | ) | [virtual] |
Orders the unit to cancel a research in progress.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::cancelTrain | ( | int | slot = -2 | ) | [virtual] |
Orders the unit to remove the specified unit from its training queue.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::cancelUpgrade | ( | ) | [virtual] |
Orders the unit to cancel an upgrade in progress.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::canIssueCommand | ( | UnitCommand | command | ) | const [virtual] |
Returns true if the unit is able to execute the given command, or false if there is an error
Implements BWAPI::Unit.
void BWAPI::UnitImpl::clear | ( | ) |
virtual bool BWAPI::UnitImpl::cloak | ( | ) | [virtual] |
virtual bool BWAPI::UnitImpl::decloak | ( | ) | [virtual] |
virtual bool BWAPI::UnitImpl::exists | ( | ) | const [virtual] |
3 cases to consider:
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::follow | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
virtual bool BWAPI::UnitImpl::gather | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to gather the specified unit (must be mineral or refinery type).
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getAcidSporeCount | ( | ) | const [virtual] |
Returns the unit's acid spore count.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getAddon | ( | ) | const [virtual] |
Returns the add-on of this unit, or NULL if the unit doesn't have an add-on.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getAirWeaponCooldown | ( | ) | const [virtual] |
Returns unit's air weapon cooldown. It is 0 if the unit is ready to attack.
Implements BWAPI::Unit.
virtual double BWAPI::UnitImpl::getAngle | ( | ) | const [virtual] |
Returns the direction the unit is facing, measured in radians. An angle of 0 means the unit is facing east.
Implements BWAPI::Unit.
virtual UnitType BWAPI::UnitImpl::getBuildType | ( | ) | const [virtual] |
Returns the building type a worker is about to construct. If the unit is a morphing Zerg unit or an incomplete building, this returns the UnitType the unit is about to become upon completion.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getBuildUnit | ( | ) | const [virtual] |
If the unit is an SCV that is constructing a building, this will return the building it is constructing. If the unit is a Terran building that is being constructed, this will return the SCV that is constructing it.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getCarrier | ( | ) | const [virtual] |
For Protoss Interceptors, this returns the Carrier unit this Interceptor is controlled by. For all other unit types this function returns NULL.
Implements BWAPI::Unit.
virtual void* BWAPI::UnitImpl::getClientInfo | ( | ) | const [virtual] |
Returns the unit's custom client info. The client is responsible for deallocation.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getDefenseMatrixPoints | ( | ) | const [virtual] |
Returns the remaining hit points of the defense matrix. Initially a defense Matrix has 250 points.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getDefenseMatrixTimer | ( | ) | const [virtual] |
Returns the time until the defense matrix wears off. 0 -> No defense Matrix present.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getDistance | ( | Unit * | target | ) | const [virtual] |
Returns the edge-to-edge distance between the current unit and the target unit.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getDistance | ( | Position | target | ) | const [virtual] |
Returns the distance from the edge of the current unit to the target position.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getEnergy | ( | ) | const [virtual] |
Returns the unit's current amount of energy.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getEnsnareTimer | ( | ) | const [virtual] |
Returns the time until the ensnare effect wears off. 0 -> No ensnare effect present.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getGroundWeaponCooldown | ( | ) | const [virtual] |
Returns unit's ground weapon cooldown. It is 0 if the unit is ready to attack.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getHatchery | ( | ) | const [virtual] |
For Zerg Larva, this returns the Hatchery, Lair, or Hive unit this Larva was spawned from. For all other unit types this function returns NULL.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getHitPoints | ( | ) | const [virtual] |
Returns the unit's current amount of hit points.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getID | ( | ) | const [virtual] |
Returns a unique ID for this unit. It simply casts the unit's address as an integer, since each unit has a unique address.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getInitialHitPoints | ( | ) | const [virtual] |
Returns the unit's initial amount of hit points, or 0 if it wasn't a neutral unit at the beginning of the game.
Implements BWAPI::Unit.
virtual Position BWAPI::UnitImpl::getInitialPosition | ( | ) | const [virtual] |
Returns the initial position of the unit on the map, or Positions::Unknown if the unit wasn't a neutral unit at the beginning of the game.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getInitialResources | ( | ) | const [virtual] |
Returns the unit's initial amount of containing resources, or 0 if the unit wasn't a neutral unit at the beginning of the game.
Implements BWAPI::Unit.
virtual TilePosition BWAPI::UnitImpl::getInitialTilePosition | ( | ) | const [virtual] |
Returns the initial build tile position of the unit on the map, or TilePositions::Unknown if the unit wasn't a neutral unit at the beginning of the game. The tile position is of the top left corner of the building.
Implements BWAPI::Unit.
virtual UnitType BWAPI::UnitImpl::getInitialType | ( | ) | const [virtual] |
Returns the initial type of the unit or Unknown if it wasn't a neutral unit at the beginning of the game.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getInterceptorCount | ( | ) | const [virtual] |
Returns the number of interceptors the Protoss Carrier has.
Implements BWAPI::Unit.
virtual std::set<Unit*> BWAPI::UnitImpl::getInterceptors | ( | ) | const [virtual] |
Returns the set of interceptors controlled by this unit. If the unit has no interceptors, or is not a Carrier, this function returns an empty set.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getIrradiateTimer | ( | ) | const [virtual] |
Returns the time until the radiation wears off. 0 -> No radiation present.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getKillCount | ( | ) | const [virtual] |
Returns the unit's current kill count.
Implements BWAPI::Unit.
virtual std::set<Unit*> BWAPI::UnitImpl::getLarva | ( | ) | const [virtual] |
Returns the set of larva spawned by this unit. If the unit has no larva, or is not a Hatchery, Lair, or Hive, this function returns an empty set. Equivalent to clicking "Select Larva" from the Starcraft GUI.
Implements BWAPI::Unit.
virtual BWAPI::Player* BWAPI::UnitImpl::getLastAttackingPlayer | ( | ) | const [virtual] |
Returns the player that last attacked this unit.
Implements BWAPI::Unit.
virtual UnitCommand BWAPI::UnitImpl::getLastCommand | ( | ) | const [virtual] |
Returns the last successful command.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getLastCommandFrame | ( | ) | const [virtual] |
Returns the frame of the last successful command. Frame is comparable to Game::getFrameCount().
Implements BWAPI::Unit.
virtual std::set<Unit*> BWAPI::UnitImpl::getLoadedUnits | ( | ) | const [virtual] |
Returns a list of the units loaded into a Terran Bunker, Terran Dropship, Protoss Shuttle, or Zerg Overlord.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getLockdownTimer | ( | ) | const [virtual] |
Returns the time until the lockdown wears off. 0 -> No lockdown present.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getMaelstromTimer | ( | ) | const [virtual] |
Returns the time until the maelstrom wears off. 0 -> No maelstrom present.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getNydusExit | ( | ) | const [virtual] |
Returns the corresponding connected nydus canal of this unit, or NULL if the unit does not have a connected nydus canal.
Implements BWAPI::Unit.
virtual Order BWAPI::UnitImpl::getOrder | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getOrderTarget | ( | ) | const [virtual] |
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.
Implements BWAPI::Unit.
virtual Position BWAPI::UnitImpl::getOrderTargetPosition | ( | ) | const [virtual] |
Returns the target position for the units order. For example for the move order getTargetPosition returns the end of the units path but this returns the location the unit is trying to move to.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getOrderTimer | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getPlagueTimer | ( | ) | const [virtual] |
Returns the time until the plague wears off. 0 -> No plague present.
Implements BWAPI::Unit.
virtual Player* BWAPI::UnitImpl::getPlayer | ( | ) | const [virtual] |
Returns a pointer to the player that owns this unit.
Implements BWAPI::Unit.
virtual Position BWAPI::UnitImpl::getPosition | ( | ) | const [virtual] |
Returns the position of the unit on the map.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getPowerUp | ( | ) | const [virtual] |
Returns the power up the unit is holding, or NULL if the unit is not holding a power up
Implements BWAPI::Unit.
virtual Position BWAPI::UnitImpl::getRallyPosition | ( | ) | const [virtual] |
Returns the position the building is rallied to. If the building does not produce units, Positions::None is returned.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getRallyUnit | ( | ) | const [virtual] |
Returns the unit the building is rallied to. If the building is not rallied to any unit, NULL is returned.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getRemainingBuildTime | ( | ) | const [virtual] |
Returns the remaining build time of a unit/building that is being constructed.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getRemainingResearchTime | ( | ) | const [virtual] |
Returns the amount of time until the unit is done researching its current tech. If the unit is not researching anything, 0 is returned.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getRemainingTrainTime | ( | ) | const [virtual] |
Returns the remaining time of the unit that is currently being trained. If the unit is a Hatchery, Lair, or Hive, this returns the amount of time until the next larva spawns, or 0 if the unit already has 3 larva.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getRemainingUpgradeTime | ( | ) | const [virtual] |
Returns the amount of time until the unit is done upgrading its current upgrade. If the unit is not upgrading anything, 0 is returned.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getRemoveTimer | ( | ) | const [virtual] |
Returns the amount of time until the unit is removed, or 0 if the unit does not have a remove timer. Used to determine how much time remains before hallucinated units, dark swarm, etc have until they are removed.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getResourceGroup | ( | ) | const [virtual] |
Retrieves the group ID of a resource. Can be used to identify which resources belong to an expansion.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getResources | ( | ) | const [virtual] |
Returns the unit's current amount of containing resources. Useful for determining how much minerals are left in a mineral patch, or how much gas is left in a geyser (can also be called on a refinery/assimilator/extractor).
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getScarabCount | ( | ) | const [virtual] |
Returns the number of scarabs in the Protoss Reaver.
Implements BWAPI::Unit.
virtual Order BWAPI::UnitImpl::getSecondaryOrder | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getShields | ( | ) | const [virtual] |
Returns the unit's current amount of shields.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getSpellCooldown | ( | ) | const [virtual] |
Returns unit's ground weapon cooldown. It is 0 if the unit is ready cast a spell.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getSpiderMineCount | ( | ) | const [virtual] |
Returns the number of spider mines in the Terran Vulture.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getStasisTimer | ( | ) | const [virtual] |
Returns the time until the stasis field wears off. 0 -> No stasis field present.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getStimTimer | ( | ) | const [virtual] |
Returns the time until the stimpack wears off. 0 -> No stimpack boost present.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getTarget | ( | ) | const [virtual] |
Generally returns the appropriate target unit after issuing an order that accepts a target unit (i.e. attack, repair, gather, follow, etc.). To check for a target that has been acquired automatically (without issuing an order) see getOrderTarget.
Implements BWAPI::Unit.
virtual Position BWAPI::UnitImpl::getTargetPosition | ( | ) | const [virtual] |
Returns the target position the unit is moving to (provided a valid path to the target position exists).
Implements BWAPI::Unit.
virtual TechType BWAPI::UnitImpl::getTech | ( | ) | const [virtual] |
Returns the tech that the unit is currently researching. If the unit is not researching anything, TechTypes::None is returned.
Implements BWAPI::Unit.
virtual TilePosition BWAPI::UnitImpl::getTilePosition | ( | ) | const [virtual] |
Returns the build tile position of the unit on the map. Useful if the unit is a building. The tile position is of the top left corner of the building.
Implements BWAPI::Unit.
virtual std::list<UnitType> BWAPI::UnitImpl::getTrainingQueue | ( | ) | const [virtual] |
Returns the list of units queued up to be trained.
Implements BWAPI::Unit.
virtual Unit* BWAPI::UnitImpl::getTransport | ( | ) | const [virtual] |
Returns the dropship, shuttle, overlord, or bunker that is this unit is loaded in to.
Implements BWAPI::Unit.
virtual UnitType BWAPI::UnitImpl::getType | ( | ) | const [virtual] |
Returns the current type of the unit.
Implements BWAPI::Unit.
virtual std::set<Unit*>& BWAPI::UnitImpl::getUnitsInRadius | ( | int | radius | ) | const [virtual] |
Returns the set of units within the given radius of this unit
Implements BWAPI::Unit.
virtual std::set<Unit*>& BWAPI::UnitImpl::getUnitsInWeaponRange | ( | WeaponType | weapon | ) | const [virtual] |
Returns the set of units within weapon range of this unit.
Implements BWAPI::Unit.
virtual UpgradeType BWAPI::UnitImpl::getUpgrade | ( | ) | const [virtual] |
Returns the upgrade that the unit is currently upgrading. If the unit is not upgrading anything, UpgradeTypes::None is returned.
Implements BWAPI::Unit.
virtual int BWAPI::UnitImpl::getUpgradeLevel | ( | UpgradeType | upgrade | ) | const [virtual] |
Returns the player's current upgrade level for the given upgrade, if the unit is affected by this upgrade.
Implements BWAPI::Unit.
virtual double BWAPI::UnitImpl::getVelocityX | ( | ) | const [virtual] |
Returns the x component of the unit's velocity, measured in pixels per frame.
Implements BWAPI::Unit.
virtual double BWAPI::UnitImpl::getVelocityY | ( | ) | const [virtual] |
Returns the y component of the unit's velocity, measured in pixels per frame.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::haltConstruction | ( | ) | [virtual] |
Orders the SCV to stop constructing the building, and the building is left in a partially complete state until it is canceled, destroyed, or completed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::hasNuke | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::hasPath | ( | Unit * | target | ) | const [virtual] |
Returns true if the unit is able to move to the target unit
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::hasPath | ( | Position | target | ) | const [virtual] |
Returns true if the unit is able to move to the target position
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::holdPosition | ( | bool | shiftQueueCommand = false | ) | [virtual] |
Orders the unit to hold its position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isAccelerating | ( | ) | const [virtual] |
Returns true if the unit is currently accelerating.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isAttackFrame | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isAttacking | ( | ) | const [virtual] |
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBeingConstructed | ( | ) | const [virtual] |
Returns true if the unit is being constructed. Always true for incomplete Protoss and Zerg buildings, and true for incomplete Terran buildings that have an SCV constructing them. If the SCV halts construction, isBeingConstructed will return false.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBeingGathered | ( | ) | const [virtual] |
Returns true if the unit is a mineral patch or refinery that is being gathered.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBeingHealed | ( | ) | const [virtual] |
Returns true if the unit is currently being healed by a Terran Medic, or repaired by a Terran SCV.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBlind | ( | ) | const [virtual] |
Returns true if the unit is currently blind from a Medic's Optical Flare.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBraking | ( | ) | const [virtual] |
Returns true if the unit is currently braking/slowing down.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isBurrowed | ( | ) | const [virtual] |
Returns true if the unit is a Zerg unit that is current burrowed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isCarryingGas | ( | ) | const [virtual] |
Returns true if the unit is a worker that is carrying gas.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isCarryingMinerals | ( | ) | const [virtual] |
Returns true if the unit is a worker that is carrying minerals.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isCloaked | ( | ) | const [virtual] |
virtual bool BWAPI::UnitImpl::isCompleted | ( | ) | const [virtual] |
Returns true if the unit has been completed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isConstructing | ( | ) | const [virtual] |
Returns true when a unit has been issued an order to build a structure and is moving to the build location. Also returns true for Terran SCVs while they construct a building.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isDefenseMatrixed | ( | ) | const [virtual] |
Returns true if the unit has a defense matrix from a Terran Science Vessel.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isDetected | ( | ) | const [virtual] |
Returns true if the unit is detected.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isEnsnared | ( | ) | const [virtual] |
Returns true if the unit has been ensnared by a Zerg Queen.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isFollowing | ( | ) | const [virtual] |
Returns true if the unit is following another unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isGatheringGas | ( | ) | const [virtual] |
Returns true if the unit is in one of the four states for gathering gas (MoveToGas, WaitForGas, HarvestGas, ReturnGas).
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isGatheringMinerals | ( | ) | const [virtual] |
Returns true if the unit is in one of the four states for gathering minerals (MoveToMinerals, WaitForMinerals, MiningMinerals, ReturnMinerals).
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isHallucination | ( | ) | const [virtual] |
Returns true for hallucinated units, false for normal units. Returns true for hallucinated enemy units only if Complete Map Information is enabled.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isHoldingPosition | ( | ) | const [virtual] |
virtual bool BWAPI::UnitImpl::isIdle | ( | ) | const [virtual] |
virtual bool BWAPI::UnitImpl::isInterruptible | ( | ) | const [virtual] |
Returns true if the unit can be interrupted.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isInvincible | ( | ) | const [virtual] |
Returns true if the unit is invincible.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isInWeaponRange | ( | Unit * | target | ) | const [virtual] |
Returns true if the unit can attack a specified target from its current position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isIrradiated | ( | ) | const [virtual] |
Returns true if the unit is being irradiated by a Terran Science Vessel.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isLifted | ( | ) | const [virtual] |
Returns true if the unit is a Terran building that is currently lifted off the ground.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isLoaded | ( | ) | const [virtual] |
Return true if the unit is loaded into a Terran Bunker, Terran Dropship, Protoss Shuttle, or Zerg Overlord.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isLockedDown | ( | ) | const [virtual] |
Returns true if the unit is locked down by a Terran Ghost.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isMaelstrommed | ( | ) | const [virtual] |
Returns true if the unit is being maelstrommed.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isMorphing | ( | ) | const [virtual] |
Returns true if the unit is a zerg unit that is morphing.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isMoving | ( | ) | const [virtual] |
virtual bool BWAPI::UnitImpl::isParasited | ( | ) | const [virtual] |
Returns true if the unit has been parasited by some other player.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isPatrolling | ( | ) | const [virtual] |
Returns true if the unit is patrolling between two positions.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isPlagued | ( | ) | const [virtual] |
Returns true if the unit has been plagued by a Zerg Defiler.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isRepairing | ( | ) | const [virtual] |
Returns true if the unit is a Terran SCV that is repairing or moving to repair another unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isResearching | ( | ) | const [virtual] |
Returns true if the unit is a building that is researching tech. See TechTypes for the complete list of available techs in Broodwar.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isSelected | ( | ) | const [virtual] |
Returns true if the unit has been selected by the user via the starcraft GUI. Only available if you enable Flag::UserInput during AIModule::onStart.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isSieged | ( | ) | const [virtual] |
Returns true if the unit is a Terran Siege Tank that is currently in Siege mode.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isStartingAttack | ( | ) | const [virtual] |
Returns true if the unit is starting to attack.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isStasised | ( | ) | const [virtual] |
Returns true if the unit has been stasised by a Protoss Arbiter.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isStimmed | ( | ) | const [virtual] |
virtual bool BWAPI::UnitImpl::isStuck | ( | ) | const [virtual] |
Returns true if the unit is being pushed off of another unit
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::issueCommand | ( | UnitCommand | command | ) | [virtual] |
Issues the give unit command, or returns false if there is an error
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isTraining | ( | ) | const [virtual] |
Returns true if the unit is training units (i.e. a Barracks training Marines).
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUnderAttack | ( | ) | const [virtual] |
Returns true if the unit was recently attacked.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUnderDarkSwarm | ( | ) | const [virtual] |
Returns true if the unit is under a Dark Swarm.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUnderDisruptionWeb | ( | ) | const [virtual] |
Returns true if the unit is under a Disruption Web.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUnderStorm | ( | ) | const [virtual] |
Returns true if the unit is under a Protoss Psionic Storm.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUnpowered | ( | ) | const [virtual] |
Returns true if the unit is a Protoss building that is unpowered because no pylons are in range.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isUpgrading | ( | ) | const [virtual] |
Returns true if the unit is a building that is upgrading. See UpgradeTypes for the complete list of available upgrades in Broodwar.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isVisible | ( | ) | const [virtual] |
Returns true if the unit is visible. If the CompleteMapInformation? cheat flag is enabled, existing units hidden by the fog of war will be accessible, but isVisible will still return false.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::isVisible | ( | Player * | player | ) | const [virtual] |
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::land | ( | TilePosition | target | ) | [virtual] |
Orders the unit to land. Note: unit must be a Terran building that is currently lifted.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::lift | ( | ) | [virtual] |
Orders the unit to lift. Note: unit must be a Terran building that can be lifted.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::load | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to load the target unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::morph | ( | UnitType | type | ) | [virtual] |
Orders the unit to morph into the specified unit type. Returns false if given a wrong type.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::move | ( | Position | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to move from its current position to the specified position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::patrol | ( | Position | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to patrol between its current position and the specified position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::placeCOP | ( | TilePosition | target | ) | [virtual] |
Moves a Flag Beacon to the target location.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::repair | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
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.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::research | ( | TechType | tech | ) | [virtual] |
Orders the unit to research the given tech type.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::returnCargo | ( | bool | shiftQueueCommand = false | ) | [virtual] |
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.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::rightClick | ( | Position | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Works like the right click in the GUI.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::rightClick | ( | Unit * | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Works like the right click in the GUI. Right click on a mineral patch to order a worker to mine, right click on an enemy to attack it.
Implements BWAPI::Unit.
void BWAPI::UnitImpl::saveInitialState | ( | ) |
virtual void BWAPI::UnitImpl::setClientInfo | ( | void * | clientinfo | ) | [virtual] |
Sets the unit's custom client info. The client is responsible for deallocation.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::setRallyPoint | ( | Position | target | ) | [virtual] |
Orders the unit to set its rally position to the specified position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::setRallyPoint | ( | Unit * | target | ) | [virtual] |
Orders the unit to set its rally unit to the specified unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::siege | ( | ) | [virtual] |
Orders the unit to siege. Note: unit must be a Terran siege tank.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::stop | ( | bool | shiftQueueCommand = false | ) | [virtual] |
Orders the unit to stop.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::train | ( | UnitType | type | ) | [virtual] |
Orders this unit to add the specified unit type to the training queue. Note that the player must have sufficient resources to train. If you wish to make units from a hatchery, use getLarva to get the larva associated with the hatchery and then call morph on the larva you want to morph. This command can also be used to make interceptors and scarabs.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::unburrow | ( | ) | [virtual] |
Orders the burrowed unit to unburrow.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::unload | ( | Unit * | target | ) | [virtual] |
Orders the unit to unload the target unit.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::unloadAll | ( | bool | shiftQueueCommand = false | ) | [virtual] |
Orders the unit to unload all loaded units at the unit's current position.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::unloadAll | ( | Position | target, |
bool | shiftQueueCommand = false |
||
) | [virtual] |
Orders the unit to unload all loaded units at the specified location. Unit should be a Terran Dropship, Protoss Shuttle, or Zerg Overlord. If the unit is a Terran Bunker, the units will be unloaded right outside the bunker, like in the first version of unloadAll.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::unsiege | ( | ) | [virtual] |
Orders the unit to unsiege. Note: unit must be a Terran siege tank.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::upgrade | ( | UpgradeType | upgrade | ) | [virtual] |
Orders the unit to upgrade the given upgrade type.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::useTech | ( | TechType | tech | ) | [virtual] |
Orders the unit to use a tech not requiring a target (ie Stim Pack). Returns true if it is a valid tech.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::useTech | ( | TechType | tech, |
Position | target | ||
) | [virtual] |
Orders the unit to use a tech requiring a position target (ie Dark Swarm). Returns true if it is a valid tech.
Implements BWAPI::Unit.
virtual bool BWAPI::UnitImpl::useTech | ( | TechType | tech, |
Unit * | target | ||
) | [virtual] |
Orders the unit to use a tech requiring a unit target (ie Irradiate). Returns true if it is a valid tech.
Implements BWAPI::Unit.
std::set<Unit*> BWAPI::UnitImpl::connectedUnits |
std::set<Unit*> BWAPI::UnitImpl::loadedUnits |