MCPcopy Create free account
hub / github.com/bwapi/bwapi / onUnitMorph

Method onUnitMorph

bwapi/ExampleAIModule/Source/ExampleAIModule.cpp:272–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void ExampleAIModule::onUnitMorph(BWAPI::Unit unit)
273{
274 if ( Broodwar->isReplay() )
275 {
276 // if we are in a replay, then we will print out the build order of the structures
277 if ( unit->getType().isBuilding() && !unit->getPlayer()->isNeutral() )
278 {
279 int seconds = Broodwar->getFrameCount()/24;
280 int minutes = seconds/60;
281 seconds %= 60;
282 Broodwar->sendText("%.2d:%.2d: %s morphs a %s", minutes, seconds, unit->getPlayer()->getName().c_str(), unit->getType().c_str());
283 }
284 }
285}
286
287void ExampleAIModule::onUnitRenegade(BWAPI::Unit unit)
288{

Callers

nothing calls this directly

Calls 9

isBuildingMethod · 0.80
sendTextMethod · 0.80
c_strMethod · 0.80
isReplayMethod · 0.45
getTypeMethod · 0.45
isNeutralMethod · 0.45
getPlayerMethod · 0.45
getFrameCountMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected