| 38 | |
| 39 | } |
| 40 | void LiftTest::update() |
| 41 | { |
| 42 | if (running == false) return; |
| 43 | if (fail) |
| 44 | { |
| 45 | running = false; |
| 46 | return; |
| 47 | } |
| 48 | int thisFrame = Broodwar->getFrameCount(); |
| 49 | BWAssert(thisFrame==nextFrame); |
| 50 | nextFrame++; |
| 51 | Broodwar->setScreenPosition(unit->getPosition() - Position(320,240)); |
| 52 | |
| 53 | if (completedLift==false) |
| 54 | { |
| 55 | if (unit->getOrder()!=Orders::BuildingLiftOff && unit->getOrder()!=Orders::LiftingOff && thisFrame>startFrame+300) |
| 56 | { |
| 57 | BWAssertF(unit->isLifted()==true,{fail=true;return;}); |
| 58 | completedLift=true; |
| 59 | unit->land(originalTilePosition); |
| 60 | BWAssertF(unit->getOrder() == Orders::BuildingLand, { fail = true; log("originalTilePosition=(%d,%d)", originalTilePosition.x, originalTilePosition.y); return; }); |
| 61 | startFrame=thisFrame; |
| 62 | } |
| 63 | else |
| 64 | { |
| 65 | if (thisFrame>startFrame+600) |
| 66 | fail = true; |
| 67 | } |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | if (unit->getOrder()!=Orders::BuildingLand && thisFrame>startFrame+300) |
| 72 | { |
| 73 | BWAssertF(unit->isLifted()==false,{fail=true;return;}); |
| 74 | running = false; |
| 75 | } |
| 76 | else |
| 77 | { |
| 78 | if (thisFrame>startFrame+600) |
| 79 | fail = true; |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | void LiftTest::stop() |
| 85 | { |
nothing calls this directly
no test coverage detected