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

Function isScannerVisible

bwapi/BWAPI/Source/BWAPI/UnitUpdate.cpp:31–46  ·  view source on GitHub ↗

Just hardcode some values that encompass the majority of the scanner graphic (as a hack for now) Note that scanner sweeps are tricky, since the scanning graphic isn't associated with the scanner unit

Source from the content-addressed store, hash-verified

29 // Just hardcode some values that encompass the majority of the scanner graphic (as a hack for now)
30 // Note that scanner sweeps are tricky, since the scanning graphic isn't associated with the scanner unit
31 bool isScannerVisible(BW::Position position)
32 {
33 int left = (position.x - 64) / 32;
34 int top = (position.y - 64) / 32;
35 int right = (position.x + 64) / 32;
36 int bottom = (position.y + 64) / 32;
37 for (int x = left; x <= right; ++x)
38 {
39 for (int y = top; y <= bottom; ++y)
40 {
41 if (BroodwarImpl.isVisible(x, y))
42 return true;
43 }
44 }
45 return false;
46 }
47
48 void UnitImpl::updateInternalData()
49 {

Callers 1

updateInternalDataMethod · 0.85

Calls 1

isVisibleMethod · 0.45

Tested by

no test coverage detected