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

Method execute

bwapi/BWScriptEmulator/Train.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8Train train_impl(AISCRIPT::Enum::TRAIN);
9
10bool Train::execute(aithread &thread) const
11{
12 // Parameters
13 BYTE bCount;
14 WORD wUnitType;
15 thread.readTuple( std::tie(bCount, wUnitType) );
16
17 // Debug
18 thread.saveDebug(Text::Green, this->getOpcode(), "%u %s", bCount, AISCRIPT::getUnitName(wUnitType) );
19
20 // Perform actions
21 if ( GetStandardUnitCount(wUnitType, this->getOpcode() != AISCRIPT::Enum::TRAIN) < bCount )
22 {
23 MainController.wWaitForType = (int)wUnitType + 1;
24 if ( this->getOpcode() != AISCRIPT::Enum::DO_MORPH )
25 return thread.retry();
26 }
27 return thread.noretry();
28}

Callers

nothing calls this directly

Calls 7

getUnitNameFunction · 0.85
GetStandardUnitCountFunction · 0.85
saveDebugMethod · 0.80
getOpcodeMethod · 0.80
retryMethod · 0.80
noretryMethod · 0.80
readTupleMethod · 0.45

Tested by

no test coverage detected