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

Method execute

bwapi/BWScriptEmulator/Order_Region.cpp:10–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8Order_Region junkyard_dog_impl(Enum::JUNKYARD_DOG);
9
10bool Order_Region::execute(aithread &thread) const
11{
12 // Get units in region
13 Unitset rgnUnits( Broodwar->getUnitsInRectangle(thread.getLocation().topLeft, thread.getLocation().bottomRight,
14 GetPlayer == Broodwar->self() && IsCompleted) );
15
16 // Execute action
17 if ( this->getOpcode() == Enum::MAKE_PATROL )
18 {
19 rgnUnits.patrol( MainController.genCmdTarget.center() );
20 }
21 else if ( this->getOpcode() == Enum::JUNKYARD_DOG )
22 {
23 for each ( Unit u in rgnUnits )
24 UnitWrap(u).SetVirtualUnitOrder(Orders::Enum::JunkYardDog);
25 }
26
27 // Debug
28 thread.saveDebug(Text::Green, this->getOpcode());
29 return true;
30}

Callers

nothing calls this directly

Calls 9

UnitWrapClass · 0.85
getLocationMethod · 0.80
getOpcodeMethod · 0.80
centerMethod · 0.80
SetVirtualUnitOrderMethod · 0.80
saveDebugMethod · 0.80
getUnitsInRectangleMethod · 0.45
selfMethod · 0.45
patrolMethod · 0.45

Tested by

no test coverage detected