* Put down a forest tile. * @param mapH X coordinate of the tile. * @param mapV Y coordinate of the tile. * @return Tool result. * @todo Auto-bulldoze deducts always 1. */
| 356 | * @todo Auto-bulldoze deducts always 1. |
| 357 | */ |
| 358 | ToolResult Micropolis::putDownForest(short mapH, short mapV, |
| 359 | ToolEffects *effects) |
| 360 | { |
| 361 | static short dx[8] = { -1, 0, 1, -1, 1, -1, 0, 1, }; |
| 362 | static short dy[8] = { -1, -1, -1, 0, 0, 1, 1, 1, }; |
| 363 | |
| 364 | effects->setMapValue(mapH, mapV, WOODS | BLBNBIT); |
| 365 | |
| 366 | int i; |
| 367 | for (i = 0; i < 8; i++) { |
| 368 | int xx = mapH + dx[i]; |
| 369 | int yy = mapV + dy[i]; |
| 370 | if (testBounds(xx, yy)) { |
| 371 | smoothTreesAt(xx, yy, true, effects); |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | effects->addCost(gCostOf[TOOL_FOREST]); |
| 376 | |
| 377 | return TOOLRESULT_OK; |
| 378 | } |
| 379 | |
| 380 | |
| 381 | /** |
nothing calls this directly
no test coverage detected