| 320 | } |
| 321 | |
| 322 | static void bucket_tree(df::plant *plant, bool designate_clearcut, bool *designated, bool *can_chop, |
| 323 | map<int32_t, int32_t> *tree_counts, map<int32_t, int32_t> *designated_tree_counts, |
| 324 | map<int, PersistentDataItem *> &clearcut_burrows, |
| 325 | map<int, PersistentDataItem *> &chop_burrows) { |
| 326 | for (auto &burrow : plotinfo->burrows.list) { |
| 327 | if (!Burrows::isAssignedTile(burrow, plant->pos)) |
| 328 | continue; |
| 329 | |
| 330 | int id = burrow->id; |
| 331 | if (tree_counts) |
| 332 | ++(*tree_counts)[id]; |
| 333 | |
| 334 | if (*designated) { |
| 335 | if (designated_tree_counts) |
| 336 | ++(*designated_tree_counts)[id]; |
| 337 | } else if (clearcut_burrows.count(id) && !is_protected(plant, *clearcut_burrows[id])) { |
| 338 | if (designate_clearcut && Designations::markPlant(plant)) { |
| 339 | *designated = true; |
| 340 | if (designated_tree_counts) |
| 341 | ++(*designated_tree_counts)[id]; |
| 342 | } |
| 343 | } else if (chop_burrows.count(id) && !is_protected(plant, *chop_burrows[id])) { |
| 344 | *can_chop = true; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | if (!*designated && chop_burrows.empty()) |
| 349 | *can_chop = true; |
| 350 | } |
| 351 | |
| 352 | static void bucket_watched_burrows(color_ostream & out, |
| 353 | map<int, PersistentDataItem *> &clearcut_burrows, |
no test coverage detected