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

Function canUseTechUnit

bwapi/Shared/Templates.h:2281–2297  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2279 }
2280 //------------------------------------------- CAN USE TECH UNIT ------------------------------------------
2281 static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true)
2282 {
2283 if ( !checkCommandibility )
2284 Broodwar->setLastError();
2285 else if ( !canCommand(thisUnit) )
2286 return false;
2287
2288 if ( checkCanIssueCommandType && !canUseTechWithOrWithoutTarget(thisUnit, false) )
2289 return false;
2290
2291 if ( !canUseTechWithOrWithoutTarget(thisUnit, tech, false, false) )
2292 return false;
2293 if ( !tech.targetsUnit() )
2294 return Broodwar->setLastError(Errors::Incompatible_TechType);
2295
2296 return true;
2297 }
2298 static inline bool canUseTechUnit(Unit thisUnit, BWAPI::TechType tech, Unit targetUnit, bool checkCanTargetUnit, bool checkTargetsUnits, bool checkCanIssueCommandType, bool checkCommandibility)
2299 {
2300 if ( !checkCommandibility )

Callers 4

canUseTechFunction · 0.85
canIssueCommandFunction · 0.85
canIssueCommandGroupedFunction · 0.85
canUseTechUnitMethod · 0.85

Calls 15

canCommandFunction · 0.85
canTargetUnitFunction · 0.85
setLastErrorMethod · 0.80
targetsUnitMethod · 0.80
isOrganicMethod · 0.80
isMechanicalMethod · 0.80
isRoboticMethod · 0.80
isFlyerMethod · 0.80
getHitPointsMethod · 0.80
maxHitPointsMethod · 0.80
isSpellcasterMethod · 0.80

Tested by

no test coverage detected