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

Method update

bwapi/TestAIModule/Source/RallyTest.cpp:61–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60}
61void RallyTest::update()
62{
63 if (running == false) return;
64 if (fail)
65 {
66 running = false;
67 return;
68 }
69 int thisFrame = Broodwar->getFrameCount();
70 BWAssert(thisFrame==nextFrame);
71 nextFrame++;
72 Broodwar->setScreenPosition(unit->getPosition() - Position(320,240));
73
74 if (thisFrame<startFrame+100)
75 {
76 FAILTEST(unit->getRallyUnit()==rallyUnit);
77 }
78 else if (thisFrame==startFrame+100)
79 {
80 FAILTEST(unit->getRallyUnit()==rallyUnit);
81 unit->setRallyPoint(rallyPosition);
82 FAILTEST(unit->getRallyPosition()==rallyPosition);
83 FAILTEST(unit->getRallyUnit()==NULL);
84 }
85 else if (thisFrame<startFrame+200)
86 {
87 FAILTEST(unit->getRallyPosition()==rallyPosition);
88 FAILTEST(unit->getRallyUnit()==NULL);
89 }
90 else
91 {
92 unit->setRallyPoint(unit);
93 running=false;
94 }
95}
96
97void RallyTest::stop()
98{

Callers

nothing calls this directly

Calls 7

getRallyUnitMethod · 0.80
getRallyPositionMethod · 0.80
PositionClass · 0.50
getFrameCountMethod · 0.45
setScreenPositionMethod · 0.45
getPositionMethod · 0.45
setRallyPointMethod · 0.45

Tested by

no test coverage detected