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

Method isValid

bwapi/BWAPILIB/Source/Position.cpp:7–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5{
6 template<typename _T, int __Scale>
7 bool Point<_T,__Scale>::isValid() const
8 {
9 // Not valid if < 0
10 if ( this->x < 0 || this->y < 0 )
11 return false;
12
13 // If Broodwar pointer is not initialized, just assume maximum map size
14 if ( !BroodwarPtr )
15 return this->x < (256 * 32)/__Scale &&
16 this->y < (256 * 32)/__Scale;
17
18 // If BW ptr exists then compare with actual map size
19 return this->x < (Broodwar->mapWidth() * 32)/__Scale &&
20 this->y < (Broodwar->mapHeight() * 32)/__Scale;
21 }
22
23 template<typename _T, int __Scale>
24 Point<_T,__Scale> &Point<_T,__Scale>::makeValid()

Callers 14

PointClass · 0.95
ReservePlacementFunction · 0.45
hasPowerMethod · 0.45
getUnitsInRadiusMethod · 0.45
getClosestUnitMethod · 0.45
hasPathMethod · 0.45
getPositionMethod · 0.45
getUnitsInRadiusMethod · 0.45
getClosestUnitMethod · 0.45
getUnitsMethod · 0.45
redMethod · 0.45
greenMethod · 0.45

Calls 2

mapWidthMethod · 0.45
mapHeightMethod · 0.45

Tested by 1

TEST_METHODFunction · 0.36