MCPcopy Create free account
hub / github.com/bwapi/bwapi / canUseTechWithOrWithoutTarget

Function canUseTechWithOrWithoutTarget

bwapi/Shared/Templates.h:2152–2167  ·  view source on GitHub ↗

------------------------------------------- CAN USE TECH -----------------------------------------------

Source from the content-addressed store, hash-verified

2150 }
2151 //------------------------------------------- CAN USE TECH -----------------------------------------------
2152 static inline bool canUseTechWithOrWithoutTarget(Unit thisUnit, bool checkCommandibility = true)
2153 {
2154 if ( !checkCommandibility )
2155 Broodwar->setLastError();
2156 else if ( !canCommand(thisUnit) )
2157 return false;
2158
2159 if ( !thisUnit->getType().isBuilding() && !thisUnit->isInterruptible() )
2160 return Broodwar->setLastError(Errors::Unit_Busy);
2161 if ( !thisUnit->isCompleted() )
2162 return Broodwar->setLastError(Errors::Incompatible_State);
2163 if ( thisUnit->isHallucination() )
2164 return Broodwar->setLastError(Errors::Incompatible_UnitType);
2165
2166 return true;
2167 }
2168 static inline bool canUseTechWithOrWithoutTarget(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true)
2169 {
2170 if ( !checkCommandibility )

Callers 6

canUseTechWithoutTargetFunction · 0.85
canUseTechUnitFunction · 0.85
canUseTechPositionFunction · 0.85
canIssueCommandTypeFunction · 0.85

Calls 15

canCommandFunction · 0.85
setLastErrorMethod · 0.80
isBuildingMethod · 0.80
isInterruptibleMethod · 0.80
isCompletedMethod · 0.80
isHallucinationMethod · 0.80
isHeroMethod · 0.80
hasResearchedMethod · 0.80
getEnergyMethod · 0.80
energyCostMethod · 0.80
containsMethod · 0.80
whatUsesMethod · 0.80

Tested by

no test coverage detected