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

Method start

bwapi/TestAIModule/Source/LiftTest.cpp:14–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 running = false;
13}
14void LiftTest::start()
15{
16 if (fail) return;
17 running = true;
18
19 int userCount = Broodwar->self()->completedUnitCount(unitType);
20 BWAssertF(userCount>=1,{fail=true;return;});
21 for (Unit u : Broodwar->self()->getUnits())
22 if (u->getType()==unitType)
23 unit = u;
24
25 BWAssertF(unit!=NULL,{fail=true;return;});
26 BWAssertF(unit->exists(),{fail=true;return;});
27 BWAssertF(unit->isLifted()==false,{fail=true;return;});
28 BWAssertF(unit->isIdle()==true,{fail=true;return;});
29 BWAssertF(unit->isTraining()==false,{fail=true;return;});
30 BWAssertF(unit->isResearching()==false,{fail=true;return;});
31 BWAssertF(unit->isUpgrading()==false,{fail=true;return;});
32 BWAssertF(unit->isConstructing()==false,{fail=true;return;});
33 originalTilePosition = unit->getTilePosition();
34 unit->lift();
35 BWAssertF(unit->getOrder()==Orders::BuildingLiftOff,{fail=true;return;});
36 startFrame = Broodwar->getFrameCount();
37 nextFrame = Broodwar->getFrameCount();
38
39}
40void LiftTest::update()
41{
42 if (running == false) return;

Callers

nothing calls this directly

Calls 15

completedUnitCountMethod · 0.80
isLiftedMethod · 0.80
isIdleMethod · 0.80
isTrainingMethod · 0.80
isConstructingMethod · 0.80
getTilePositionMethod · 0.80
selfMethod · 0.45
getUnitsMethod · 0.45
getTypeMethod · 0.45
existsMethod · 0.45
isResearchingMethod · 0.45
isUpgradingMethod · 0.45

Tested by

no test coverage detected