* Put down a communication network. * @param mapH X coordinate of the tile. * @param mapV Y coordinate of the tile. * @return Tool result. * @param effects Storage of effects of putting down the park. * @todo Auto-bulldoze costs should be pulled from a table/constant. */
| 272 | * @todo Auto-bulldoze costs should be pulled from a table/constant. |
| 273 | */ |
| 274 | ToolResult Micropolis::putDownNetwork(short mapH, short mapV, |
| 275 | ToolEffects *effects) |
| 276 | { |
| 277 | MapTile tile = effects->getMapTile(mapH, mapV); |
| 278 | |
| 279 | if (tile != DIRT && tally(tile)) { |
| 280 | effects->addCost(gCostOf[TOOL_BULLDOZER]); |
| 281 | effects->setMapValue(mapH, mapV, DIRT); |
| 282 | tile = DIRT; |
| 283 | } |
| 284 | |
| 285 | if (tile != DIRT) return TOOLRESULT_NEED_BULLDOZE; |
| 286 | |
| 287 | effects->setMapValue(mapH, mapV, |
| 288 | TELEBASE | CONDBIT | BURNBIT | BULLBIT | ANIMBIT); |
| 289 | |
| 290 | effects->addCost(gCostOf[TOOL_NETWORK]); |
| 291 | |
| 292 | return TOOLRESULT_OK; |
| 293 | } |
| 294 | |
| 295 | |
| 296 | /** |
nothing calls this directly
no test coverage detected