| 67 | // A more generic version of the vanilla function |
| 68 | template<typename TFunction> |
| 69 | static void applyToMultiTile(IndustryElement& el0, const World::Pos2& loc, bool isMultiTile, TFunction&& func) |
| 70 | { |
| 71 | for (auto& offset : getBuildingTileOffsets(isMultiTile)) |
| 72 | { |
| 73 | auto* elIndustry = &el0; |
| 74 | const auto pos = loc + offset.pos; |
| 75 | if (offset.index != 0) |
| 76 | { |
| 77 | auto tile = World::TileManager::get(pos); |
| 78 | for (auto& el : tile) |
| 79 | { |
| 80 | elIndustry = el.as<IndustryElement>(); |
| 81 | if (elIndustry == nullptr) |
| 82 | { |
| 83 | continue; |
| 84 | } |
| 85 | if (elIndustry->baseZ() != el0.baseZ()) |
| 86 | { |
| 87 | elIndustry = nullptr; |
| 88 | continue; |
| 89 | } |
| 90 | break; |
| 91 | } |
| 92 | } |
| 93 | if (elIndustry != nullptr) |
| 94 | { |
| 95 | func(*elIndustry, pos); |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // 0x00456FF7 |
| 101 | bool IndustryElement::update(const World::Pos2& loc) |
no test coverage detected