| 251 | } |
| 252 | |
| 253 | void ExampleAIModule::onUnitCreate(BWAPI::Unit unit) |
| 254 | { |
| 255 | if ( Broodwar->isReplay() ) |
| 256 | { |
| 257 | // if we are in a replay, then we will print out the build order of the structures |
| 258 | if ( unit->getType().isBuilding() && !unit->getPlayer()->isNeutral() ) |
| 259 | { |
| 260 | int seconds = Broodwar->getFrameCount()/24; |
| 261 | int minutes = seconds/60; |
| 262 | seconds %= 60; |
| 263 | Broodwar->sendText("%.2d:%.2d: %s creates a %s", minutes, seconds, unit->getPlayer()->getName().c_str(), unit->getType().c_str()); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | void ExampleAIModule::onUnitDestroy(BWAPI::Unit unit) |
| 269 | { |
nothing calls this directly
no test coverage detected