| 13 | running = false; |
| 14 | } |
| 15 | void FollowTest::start() |
| 16 | { |
| 17 | if (fail) return; |
| 18 | running = true; |
| 19 | |
| 20 | int userCount = Broodwar->self()->completedUnitCount(unitType); |
| 21 | BWAssertF(userCount>=1,{fail=true;return;}); |
| 22 | for (Unit u : Broodwar->self()->getUnits()) |
| 23 | if (u->getType()==unitType) |
| 24 | unit = u; |
| 25 | BWAssertF(unit!=NULL,{fail=true;return;}); |
| 26 | BWAssertF(unit->exists(),{fail=true;return;}); |
| 27 | |
| 28 | int targetCount = Broodwar->self()->completedUnitCount(targetType); |
| 29 | BWAssertF(targetCount>=1,{fail=true;return;}); |
| 30 | for (Unit u : Broodwar->self()->getUnits()) |
| 31 | if (u->getType()==targetType) |
| 32 | target = u; |
| 33 | BWAssertF(target!=NULL,{fail=true;return;}); |
| 34 | BWAssertF(target->exists(),{fail=true;return;}); |
| 35 | BWAssertF(unit->isIdle()==true,{fail=true;return;}); |
| 36 | BWAssertF(unit->rightClick(Position(target->getPosition().x-32*20,target->getPosition().y)),{Broodwar->printf("%s",Broodwar->getLastError().c_str());fail=true;return;}); |
| 37 | startFrame = Broodwar->getFrameCount(); |
| 38 | nextFrame = Broodwar->getFrameCount(); |
| 39 | started=false; |
| 40 | } |
| 41 | void FollowTest::update() |
| 42 | { |
| 43 | if (running == false) return; |
nothing calls this directly
no test coverage detected