| 46 | |
| 47 | } |
| 48 | void BurrowTest::update() |
| 49 | { |
| 50 | if (running == false) return; |
| 51 | if (fail) |
| 52 | { |
| 53 | running = false; |
| 54 | return; |
| 55 | } |
| 56 | int thisFrame = Broodwar->getFrameCount(); |
| 57 | BWAssert(thisFrame==nextFrame); |
| 58 | nextFrame++; |
| 59 | Broodwar->setScreenPosition(unit->getPosition() - Position(320,240)); |
| 60 | |
| 61 | if (completedBurrow==false) |
| 62 | { |
| 63 | if (unit->getOrder()!=Orders::Burrowing && thisFrame>startFrame+60) |
| 64 | { |
| 65 | FAILTEST(unit->isBurrowed()==true); |
| 66 | completedBurrow=true; |
| 67 | unit->unburrow(); |
| 68 | FAILTEST(unit->getOrder()==Orders::Unburrowing); |
| 69 | startFrame=thisFrame; |
| 70 | } |
| 71 | else |
| 72 | { |
| 73 | if (thisFrame>startFrame+300) |
| 74 | fail = true; |
| 75 | } |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | if (unit->getOrder()!=Orders::Unburrowing && thisFrame>startFrame+60) |
| 80 | { |
| 81 | FAILTEST(unit->isBurrowed()==false); |
| 82 | running = false; |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | if (thisFrame>startFrame+300) |
| 87 | fail = true; |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void BurrowTest::stop() |
| 93 | { |
nothing calls this directly
no test coverage detected