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

Method getUnitID

bwapi/BWAPI/Source/BWAPI/Server.cpp:719–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717 }
718
719 int Server::getUnitID(Unit unit)
720 {
721 if ( !unit )
722 return -1;
723 if (unitLookup.find(unit) == unitLookup.end())
724 {
725 unitLookup[unit] = (int)(unitVector.size());
726 unitVector.push_back(unit);
727 }
728 return unitLookup[unit];
729 }
730 Unit Server::getUnit(int id) const
731 {
732 if (unitVector.size() <= static_cast<unsigned>(id))

Callers 3

updateDataMethod · 0.45
extractUnitDataMethod · 0.45
augmentUnitDataMethod · 0.45

Calls 2

endMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected