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

Method notifyTileClaimedByEnemy

source/game/Seat.cpp:267–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void Seat::notifyTileClaimedByEnemy(Tile* tile)
268{
269 if(mPlayer == nullptr)
270 return;
271 if(!mPlayer->getIsHuman())
272 return;
273
274 if(tile->getX() >= static_cast<int>(mTilesStates.size()))
275 {
276 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
277 return;
278 }
279 if(tile->getY() >= static_cast<int>(mTilesStates[tile->getX()].size()))
280 {
281 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
282 return;
283 }
284
285 TileStateNotified& tileState = mTilesStates[tile->getX()][tile->getY()];
286
287 // By default, we set the tile like if it was not claimed anymore
288 tileState.mSeatIdOwner = -1;
289 tileState.mTileVisual = TileVisual::dirtGround;
290 tileState.mVisionTurnCurrent = true;
291}
292
293const std::string Seat::getFactionFromLine(const std::string& line)
294{

Callers 1

claimForSeatMethod · 0.80

Calls 3

getIsHumanMethod · 0.80
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected