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

Method start

bwapi/TestAIModule/Source/MPHSTest.cpp:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 running = false;
12}
13void MPHSTest::start()
14{
15 if (fail) return;
16 running = true;
17
18 int userCount = Broodwar->self()->completedUnitCount(unitType);
19 BWAssertF(userCount>=1,{fail=true;return;});
20 for (Unit u : Broodwar->self()->getUnits())
21 if (u->getType()==unitType)
22 unit = u;
23
24 BWAssertF(unit!=NULL,{fail=true;return;});
25 BWAssertF(unit->exists(),{fail=true;return;});
26 BWAssertF(unit->stop(),{Broodwar->printf("%s",Broodwar->getLastError().c_str());fail=true;return;});
27 startFrame = Broodwar->getFrameCount()+100;
28 nextFrame = Broodwar->getFrameCount();
29
30}
31void MPHSTest::update()
32{
33 if (running == false) return;

Callers 2

runTestCasesMethod · 0.45

Calls 10

completedUnitCountMethod · 0.80
printfMethod · 0.80
c_strMethod · 0.80
getLastErrorMethod · 0.80
selfMethod · 0.45
getUnitsMethod · 0.45
getTypeMethod · 0.45
existsMethod · 0.45
stopMethod · 0.45
getFrameCountMethod · 0.45

Tested by

no test coverage detected