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

Method RunMilitaryController

bwapi/BWScriptEmulator/Military.cpp:263–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261
262
263void UnitWrap::RunMilitaryController()
264{
265 // Run bunker tasks
266 if ( (pUnit->getType() == UnitTypes::Terran_Marine || pUnit->getType() == UnitTypes::Terran_Firebat) &&
267 TaskBunkerDefender() )
268 return;
269
270 // Run spellcaster tasks
271 if ( TaskSpellcaster(false) )
272 return;
273
274 // Run aggressive unit tasks (large)
275 if ( TaskAggression() )
276 return;
277
278 // @TODO
279 Region targetRgn = nullptr;
280 // Get targetRgn from captain destination or slowest unit in group
281
282 if ( pUnit->getRegion() == targetRgn )
283 pUnit->holdPosition();
284 else
285 pUnit->attack(targetRgn->getCenter());
286}

Callers

nothing calls this directly

Calls 5

getTypeMethod · 0.45
getRegionMethod · 0.45
holdPositionMethod · 0.45
attackMethod · 0.45
getCenterMethod · 0.45

Tested by

no test coverage detected