MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / notifyVisionOnTile

Method notifyVisionOnTile

source/game/Seat.cpp:245–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void Seat::notifyVisionOnTile(Tile* tile)
246{
247 if(mPlayer == nullptr)
248 return;
249 if(!mPlayer->getIsHuman())
250 return;
251
252 if(tile->getX() >= static_cast<int>(mTilesStates.size()))
253 {
254 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
255 return;
256 }
257 if(tile->getY() >= static_cast<int>(mTilesStates[tile->getX()].size()))
258 {
259 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
260 return;
261 }
262
263 TileStateNotified& tileState = mTilesStates[tile->getX()][tile->getY()];
264 tileState.mVisionTurnCurrent = true;
265}
266
267void Seat::notifyTileClaimedByEnemy(Tile* tile)
268{

Callers 1

notifyVisionMethod · 0.80

Calls 3

getIsHumanMethod · 0.80
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected