| 245 | } |
| 246 | |
| 247 | void Trap::activate(Tile* tile) |
| 248 | { |
| 249 | if (tile == nullptr) |
| 250 | return; |
| 251 | |
| 252 | TrapTileData* trapTileData = static_cast<TrapTileData*>(mTileData[tile]); |
| 253 | trapTileData->setActivated(true); |
| 254 | trapTileData->setNbShootsBeforeDeactivation(mNbShootsBeforeDeactivation); |
| 255 | trapTileData->setReloadTime(0); |
| 256 | |
| 257 | BuildingObject* entity = getBuildingObjectFromTile(tile); |
| 258 | if (entity == nullptr) |
| 259 | return; |
| 260 | |
| 261 | entity->setMeshOpacity(1.0f); |
| 262 | } |
| 263 | |
| 264 | void Trap::deactivate(Tile* tile) |
| 265 | { |
nothing calls this directly
no test coverage detected