| 408 | } |
| 409 | |
| 410 | bool Trap::isAttackable(Tile* tile, Seat* seat) const |
| 411 | { |
| 412 | if(!Building::isAttackable(tile, seat)) |
| 413 | return false; |
| 414 | |
| 415 | // We check if the trap is hidden for this seat |
| 416 | auto it = mTileData.find(tile); |
| 417 | if(it == mTileData.end()) |
| 418 | { |
| 419 | OD_LOG_ERR("name=" + getName() + ", tile=" + Tile::displayAsString(tile)); |
| 420 | return false; |
| 421 | } |
| 422 | |
| 423 | TrapTileData* trapTileData = static_cast<TrapTileData*>(it->second); |
| 424 | if(std::find(trapTileData->mSeatsVision.begin(), trapTileData->mSeatsVision.end(), seat) == trapTileData->mSeatsVision.end()) |
| 425 | return false; |
| 426 | |
| 427 | return true; |
| 428 | } |
| 429 | |
| 430 | void Trap::restoreInitialEntityState() |
| 431 | { |
no outgoing calls
no test coverage detected