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

Method start

bwapi/TestAIModule/Source/RallyTest.cpp:30–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 running = false;
29}
30void RallyTest::start()
31{
32 if (fail) return;
33 running = true;
34
35 int userCount = Broodwar->self()->completedUnitCount(unitType);
36 FAILTEST(userCount>=1);
37 for (Unit u : Broodwar->self()->getUnits())
38 {
39 if (u->getType()==unitType)
40 {
41 unit = u;
42 }
43 if (u->getType().isWorker())
44 {
45 rallyUnit = u;
46 }
47 }
48
49 FAILTEST(rallyUnit!=NULL);
50 rallyPosition=rallyUnit->getPosition();
51
52 FAILTEST(unit!=NULL);
53 FAILTEST(unit->exists());
54 FAILTEST(unit->getType().isBuilding());
55 unit->setRallyPoint(rallyUnit);
56 FAILTEST(unit->getRallyUnit()==rallyUnit);
57 startFrame = Broodwar->getFrameCount();
58 nextFrame = Broodwar->getFrameCount();
59
60}
61void RallyTest::update()
62{
63 if (running == false) return;

Callers

nothing calls this directly

Calls 11

completedUnitCountMethod · 0.80
isWorkerMethod · 0.80
isBuildingMethod · 0.80
getRallyUnitMethod · 0.80
selfMethod · 0.45
getUnitsMethod · 0.45
getTypeMethod · 0.45
getPositionMethod · 0.45
existsMethod · 0.45
setRallyPointMethod · 0.45
getFrameCountMethod · 0.45

Tested by

no test coverage detected