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

Method start

bwapi/TestAIModule/Source/SiegeTest.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 running = false;
12}
13void SiegeTest::start()
14{
15 if (fail) return;
16 running = true;
17
18 int userCount = Broodwar->self()->completedUnitCount(UnitTypes::Terran_Siege_Tank_Tank_Mode);
19 BWAssertF(userCount>=1,{fail=true;return;});
20 for (Unit u : Broodwar->self()->getUnits())
21 if (u->getType()==UnitTypes::Terran_Siege_Tank_Tank_Mode)
22 unit = u;
23
24 BWAssertF(unit!=NULL,{fail=true;return;});
25 BWAssertF(unit->exists(),{fail=true;return;});
26 BWAssertF(unit->isSieged()==false,{fail=true;return;});
27 unit->siege();
28 BWAssertF(unit->getOrder()==Orders::Sieging,{fail=true;return;});
29 startFrame = Broodwar->getFrameCount();
30 nextFrame = Broodwar->getFrameCount();
31
32}
33void SiegeTest::update()
34{
35 if (running == false) return;

Callers

nothing calls this directly

Calls 9

completedUnitCountMethod · 0.80
isSiegedMethod · 0.80
selfMethod · 0.45
getUnitsMethod · 0.45
getTypeMethod · 0.45
existsMethod · 0.45
siegeMethod · 0.45
getOrderMethod · 0.45
getFrameCountMethod · 0.45

Tested by

no test coverage detected