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

Method onSendText

bwapi/DevAIModule/Source/DevAIModule.cpp:59–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void DevAIModule::onSendText(std::string text)
60{
61 if (text == "/morph")
62 {
63 BWAPI::Unitset larvae = self->getUnits();
64 larvae.erase_if(Filter::GetType != UnitTypes::Zerg_Larva);
65 if (!larvae.empty())
66 {
67 if (!(*larvae.begin())->morph(UnitTypes::Zerg_Mutalisk))
68 {
69 Broodwar << bw->getLastError() << ":" << self->incompleteUnitCount(UnitTypes::Zerg_Greater_Spire) << ":" << self->incompleteUnitCount(UnitTypes::Zerg_Spire) << std::endl;
70 }
71 }
72 }
73 Broodwar->sendText("%s", text.c_str());
74}
75
76void DevAIModule::onReceiveText(BWAPI::Player player, std::string text)
77{

Callers

nothing calls this directly

Calls 8

erase_ifMethod · 0.80
beginMethod · 0.80
getLastErrorMethod · 0.80
incompleteUnitCountMethod · 0.80
sendTextMethod · 0.80
c_strMethod · 0.80
getUnitsMethod · 0.45
morphMethod · 0.45

Tested by

no test coverage detected