| 13 | Broodwar->sendText("operation cwal"); |
| 14 | } |
| 15 | void DefaultTestModule::onFrame() |
| 16 | { |
| 17 | if (Broodwar->getFrameCount()==0) return; |
| 18 | Broodwar->drawTextScreen(0,0,"FPS: %d",Broodwar->getFPS()); |
| 19 | for (Unit u : Broodwar->getAllUnits()) |
| 20 | { |
| 21 | Broodwar->drawTextMap(u->getPosition().x,u->getPosition().y-16,"%s",u->getOrder().c_str()); |
| 22 | Broodwar->drawTextMap(u->getPosition().x,u->getPosition().y,"%s",u->getType().c_str()); |
| 23 | } |
| 24 | for (Unit u : Broodwar->getAllUnits()) |
| 25 | { |
| 26 | if (lastOrder.find(u)==lastOrder.end()) |
| 27 | { |
| 28 | lastOrder[u]=Orders::None; |
| 29 | } |
| 30 | } |
| 31 | for (Unit u : Broodwar->getAllUnits()) |
| 32 | { |
| 33 | if (lastOrder[u]!=u->getOrder()) |
| 34 | { |
| 35 | lastDistinctOrders[u].push_front(lastOrder[u]); |
| 36 | if (lastDistinctOrders[u].size()>5) |
| 37 | lastDistinctOrders[u].pop_back(); |
| 38 | lastOrder[u]=u->getOrder(); |
| 39 | } |
| 40 | } |
| 41 | for (Unit u : Broodwar->getAllUnits()) |
| 42 | { |
| 43 | int y=-32; |
| 44 | for (Order o : lastDistinctOrders[u]) |
| 45 | { |
| 46 | Broodwar->drawTextMap(u->getPosition().x,u->getPosition().y+y,"%s",o.c_str()); |
| 47 | y-=16; |
| 48 | } |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected