| 41 | stopped = false; |
| 42 | } |
| 43 | void RepairTest::update() |
| 44 | { |
| 45 | if (running == false) return; |
| 46 | if (fail) |
| 47 | { |
| 48 | running = false; |
| 49 | return; |
| 50 | } |
| 51 | int thisFrame = Broodwar->getFrameCount(); |
| 52 | BWAssert(thisFrame==nextFrame); |
| 53 | nextFrame++; |
| 54 | Broodwar->setScreenPosition(unit->getPosition() - Position(320,240)); |
| 55 | |
| 56 | if (target->getHitPoints()==targetType.maxHitPoints() && !stopped) |
| 57 | { |
| 58 | stopped=true; |
| 59 | startFrame=thisFrame; |
| 60 | } |
| 61 | if (!stopped) |
| 62 | { |
| 63 | BWAssertF(unit->getOrder()==Orders::Repair,{Broodwar->printf("%s",unit->getOrder().c_str());fail=true;return;}); |
| 64 | BWAssertF(unit->getTarget()==target || unit->getOrderTarget()==target,{fail=true;return;}); |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | if (thisFrame>startFrame+20) |
| 69 | { |
| 70 | BWAssertF(unit->isIdle()==true,{fail=true;return;}); |
| 71 | BWAssertF(unit->isRepairing()==false,{fail=true;return;}); |
| 72 | } |
| 73 | if (thisFrame>startFrame+60) |
| 74 | { |
| 75 | running = false; |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | void RepairTest::stop() |
| 81 | { |
nothing calls this directly
no test coverage detected