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

Function GetSuitableCaster

bwapi/BWScriptEmulator/Use_Ability.cpp:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8Use_Ability recall_location_impl(AISCRIPT::Enum::RECALL_LOCATION);
9
10Unit GetSuitableCaster(int minEnergy, UnitType type)
11{
12 Unitset myUnits( Broodwar->self()->getUnits() );
13 for ( auto u : myUnits )
14 {
15 if ( u->getType() == type && u->isIdle() && u->getEnergy() >= minEnergy )
16 return u;
17 }
18 return nullptr;
19}
20
21bool Use_Ability::execute(aithread &thread) const
22{

Callers 1

executeMethod · 0.85

Calls 5

isIdleMethod · 0.80
getEnergyMethod · 0.80
getUnitsMethod · 0.45
selfMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected