Destroys whatever is at the specified location, replacing it with fire, rubble, or water as appropriate.
(int xpos, int ypos)
| 174 | * replacing it with fire, rubble, or water as appropriate. |
| 175 | */ |
| 176 | final void destroyTile(int xpos, int ypos) |
| 177 | { |
| 178 | if (!city.testBounds(xpos, ypos)) |
| 179 | return; |
| 180 | |
| 181 | int t = city.getTile(xpos, ypos); |
| 182 | |
| 183 | if (t >= TREEBASE) { |
| 184 | if (isBridge(t)) { |
| 185 | city.setTile(xpos, ypos, RIVER); |
| 186 | return; |
| 187 | } |
| 188 | if (!isCombustible(t)) { |
| 189 | return; //cannot destroy it |
| 190 | } |
| 191 | if (isZoneCenter(t)) { |
| 192 | city.killZone(xpos, ypos, t); |
| 193 | if (t > RZB) { |
| 194 | city.makeExplosion(xpos, ypos); |
| 195 | } |
| 196 | } |
| 197 | if (checkWet(t)) { |
| 198 | city.setTile(xpos, ypos, RIVER); |
| 199 | } |
| 200 | else { |
| 201 | city.setTile(xpos, ypos, TINYEXP); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Helper function for rotating a sprite. |
no test coverage detected