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

Method isVisible

bwapi/Shared/BulletShared.cpp:67–87  ·  view source on GitHub ↗

----------------------------------------------- IS VISIBLE -----------------------------------------------

Source from the content-addressed store, hash-verified

65 }
66 //----------------------------------------------- IS VISIBLE -----------------------------------------------
67 bool BulletImpl::isVisible(BWAPI::Player player) const
68 {
69 if ( player == nullptr ) // Default to self
70 player = Broodwar->self();
71
72 if ( player != nullptr ) // Only if player is valid
73 {
74 int id = player->getID();
75 if ( id >= 0 && id < 9 ) // Check if ID is valid
76 return self->isVisible[id]; // return visibility
77 }
78 else // fallback for self also being null
79 {
80 for(int i = 0; i < 9; ++i) // check if the bullet is visible by ANY player
81 {
82 if ( self->isVisible[i] )
83 return true;
84 }
85 }
86 return false;
87 }
88}
89

Callers

nothing calls this directly

Calls 2

selfMethod · 0.45
getIDMethod · 0.45

Tested by

no test coverage detected