| 1528 | static int GetClassIdFromHouseZone(HouseZones zones) { return FindFirstBit((zones & HZ_ZONE_ALL).base()) - to_underlying(HouseZone::TownEdge); } |
| 1529 | |
| 1530 | StringID GetTypeName(int cls_id, int id) const override |
| 1531 | { |
| 1532 | const HouseSpec *spec = HouseSpec::Get(id); |
| 1533 | if (spec == nullptr) return INVALID_STRING_ID; |
| 1534 | if (!spec->enabled) return INVALID_STRING_ID; |
| 1535 | if (!spec->building_availability.Any(climate_mask)) return INVALID_STRING_ID; |
| 1536 | if (!spec->building_availability.Test(GetHouseZoneFromClassId(cls_id))) return INVALID_STRING_ID; |
| 1537 | for (int i = 0; i < cls_id; i++) { |
| 1538 | /* Don't include if it's already included in an earlier zone. */ |
| 1539 | if (spec->building_availability.Test(GetHouseZoneFromClassId(i))) return INVALID_STRING_ID; |
| 1540 | } |
| 1541 | |
| 1542 | return GetHouseName(spec); |
| 1543 | } |
| 1544 | |
| 1545 | std::span<const BadgeID> GetTypeBadges(int cls_id, int id) const override |
| 1546 | { |
no test coverage detected