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

Method start

bwapi/TestAIModule/Source/CancelResearchTest.cpp:19–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 BWAssertF(researcherType!=UnitTypes::Unknown,{fail=true;return;});
18}
19void CancelResearchTest::start()
20{
21 if (fail) return;
22 running = true;
23
24 int researcherCount = Broodwar->self()->completedUnitCount(researcherType);
25 BWAssertF(researcherCount>=1,{fail=true;return;});
26 for (Unit u : Broodwar->self()->getUnits())
27 {
28 if (u->getType()==researcherType)
29 {
30 researcher = u;
31 break;
32 }
33 }
34 correctMineralCount = Broodwar->self()->minerals();
35 correctGasCount = Broodwar->self()->gas();
36 correctSupplyUsedCount = Broodwar->self()->supplyUsed();
37 researcher->research(techType);
38
39 startFrame = Broodwar->getFrameCount();
40 nextFrame = startFrame;
41
42}
43void CancelResearchTest::update()
44{
45 if (running == false) return;

Callers

nothing calls this directly

Calls 9

completedUnitCountMethod · 0.80
mineralsMethod · 0.80
gasMethod · 0.80
supplyUsedMethod · 0.80
selfMethod · 0.45
getUnitsMethod · 0.45
getTypeMethod · 0.45
researchMethod · 0.45
getFrameCountMethod · 0.45

Tested by

no test coverage detected