* Check whether the tile is a forest. * @param tile the tile to investigate. * @return true if and only if the tile is a forest */
| 976 | * @return true if and only if the tile is a forest |
| 977 | */ |
| 978 | bool IsTileForestIndustry(TileIndex tile) |
| 979 | { |
| 980 | /* Check for industry tile */ |
| 981 | if (!IsTileType(tile, MP_INDUSTRY)) return false; |
| 982 | |
| 983 | const Industry *ind = Industry::GetByTile(tile); |
| 984 | |
| 985 | /* Check for organic industry (i.e. not processing or extractive) */ |
| 986 | if (!GetIndustrySpec(ind->type)->life_type.Test(IndustryLifeType::Organic)) return false; |
| 987 | |
| 988 | /* Check for wood production */ |
| 989 | return std::any_of(std::begin(ind->produced), std::end(ind->produced), [](const auto &p) { return IsValidCargoType(p.cargo) && CargoSpec::Get(p.cargo)->label == CT_WOOD; }); |
| 990 | } |
| 991 | |
| 992 | static const uint8_t _plantfarmfield_type[] = {1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6}; |
| 993 |
no test coverage detected