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

Method onFrame

bwapi/TestAIModule/Source/InterceptorTest.cpp:34–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33}
34void InterceptorTest::onFrame()
35{
36 for (Unit u : Broodwar->self()->getUnits())
37 {
38 if (u->getType()==UnitTypes::Protoss_Interceptor)
39 Broodwar->drawTextMap(u->getPosition(),"isLoaded = %d",u->isLoaded());
40 }
41 for (Unit u : Broodwar->self()->getUnits())
42 {
43 if (!u->isLoaded())
44 Broodwar->drawTextMap(u->getPosition().x,u->getPosition().y-20,"loaded unit count = %d",u->getLoadedUnits().size());
45 }
46 for (Unit u : Broodwar->self()->getUnits())
47 {
48 if (u->getType()==UnitTypes::Protoss_Carrier)
49 {
50 Unitset interceptors = u->getInterceptors();
51 for (Unit i : interceptors)
52 {
53 Unit c=i->getCarrier();
54 Broodwar->drawLineMap(i->getPosition(),c->getPosition(),Colors::White);
55 }
56 }
57 }
58}

Callers

nothing calls this directly

Calls 11

drawTextMapMethod · 0.80
isLoadedMethod · 0.80
getCarrierMethod · 0.80
drawLineMapMethod · 0.80
getUnitsMethod · 0.45
selfMethod · 0.45
getTypeMethod · 0.45
getPositionMethod · 0.45
sizeMethod · 0.45
getLoadedUnitsMethod · 0.45
getInterceptorsMethod · 0.45

Tested by

no test coverage detected