| 17 | BWAssertF(researcherType!=UnitTypes::Unknown,{fail=true;return;}); |
| 18 | } |
| 19 | void CancelResearchTest::start() |
| 20 | { |
| 21 | if (fail) return; |
| 22 | running = true; |
| 23 | |
| 24 | int researcherCount = Broodwar->self()->completedUnitCount(researcherType); |
| 25 | BWAssertF(researcherCount>=1,{fail=true;return;}); |
| 26 | for (Unit u : Broodwar->self()->getUnits()) |
| 27 | { |
| 28 | if (u->getType()==researcherType) |
| 29 | { |
| 30 | researcher = u; |
| 31 | break; |
| 32 | } |
| 33 | } |
| 34 | correctMineralCount = Broodwar->self()->minerals(); |
| 35 | correctGasCount = Broodwar->self()->gas(); |
| 36 | correctSupplyUsedCount = Broodwar->self()->supplyUsed(); |
| 37 | researcher->research(techType); |
| 38 | |
| 39 | startFrame = Broodwar->getFrameCount(); |
| 40 | nextFrame = startFrame; |
| 41 | |
| 42 | } |
| 43 | void CancelResearchTest::update() |
| 44 | { |
| 45 | if (running == false) return; |
nothing calls this directly
no test coverage detected