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

Method indexToUnit

bwapi/BWAPI/Source/BWAPI/GameImpl.cpp:72–80  ·  view source on GitHub ↗

----------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

70 }
71 //----------------------------------------------------------------------------------------------------------
72 Unit GameImpl::indexToUnit(int unitIndex) const
73 {
74 if ( !this->isFlagEnabled(Flag::CompleteMapInformation) )
75 return nullptr;
76 int i = (unitIndex & 0x7FF);
77 if (i < BW::UNIT_ARRAY_MAX_LENGTH && this->unitArray[i]->canAccess())
78 return this->unitArray[i];
79 return nullptr;
80 }
81 //--------------------------------------------- GET GAME TYPE ----------------------------------------------
82 GameType GameImpl::getGameType() const
83 {

Callers 1

updateSharedMemoryMethod · 0.45

Calls 2

isFlagEnabledMethod · 0.95
canAccessMethod · 0.80

Tested by

no test coverage detected