virtual */
| 60 | } |
| 61 | |
| 62 | /* virtual */ uint32_t IndustryTileScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const |
| 63 | { |
| 64 | switch (variable) { |
| 65 | /* Construction state of the tile: a value between 0 and 3 */ |
| 66 | case 0x40: return (IsTileType(this->tile, MP_INDUSTRY)) ? GetIndustryConstructionStage(this->tile) : 0; |
| 67 | |
| 68 | /* Terrain type */ |
| 69 | case 0x41: return GetTerrainType(this->tile); |
| 70 | |
| 71 | /* Current town zone of the tile in the nearest town */ |
| 72 | case 0x42: return to_underlying(GetTownRadiusGroup(ClosestTownFromTile(this->tile, UINT_MAX), this->tile)); |
| 73 | |
| 74 | /* Relative position */ |
| 75 | case 0x43: return GetRelativePosition(this->tile, this->industry->location.tile); |
| 76 | |
| 77 | /* Animation frame. Like house variable 46 but can contain anything 0..FF. */ |
| 78 | case 0x44: return IsTileType(this->tile, MP_INDUSTRY) ? GetAnimationFrame(this->tile) : 0; |
| 79 | |
| 80 | /* Land info of nearby tiles */ |
| 81 | case 0x60: return GetNearbyIndustryTileInformation(parameter, this->tile, |
| 82 | this->industry == nullptr ? (IndustryID)IndustryID::Invalid() : this->industry->index, true, this->ro.grffile->grf_version >= 8); |
| 83 | |
| 84 | /* Animation stage of nearby tiles */ |
| 85 | case 0x61: { |
| 86 | TileIndex tile = GetNearbyTile(parameter, this->tile); |
| 87 | if (IsTileType(tile, MP_INDUSTRY) && Industry::GetByTile(tile) == this->industry) { |
| 88 | return GetAnimationFrame(tile); |
| 89 | } |
| 90 | return UINT_MAX; |
| 91 | } |
| 92 | |
| 93 | /* Get industry tile ID at offset */ |
| 94 | case 0x62: return GetIndustryIDAtOffset(GetNearbyTile(parameter, this->tile), this->industry, this->ro.grffile->grfid); |
| 95 | |
| 96 | case 0x7A: return GetBadgeVariableResult(*this->ro.grffile, GetIndustryTileSpec(GetIndustryGfx(this->tile))->badges, parameter); |
| 97 | } |
| 98 | |
| 99 | Debug(grf, 1, "Unhandled industry tile variable 0x{:X}", variable); |
| 100 | |
| 101 | available = false; |
| 102 | return UINT_MAX; |
| 103 | } |
| 104 | |
| 105 | /* virtual */ uint32_t IndustryTileScopeResolver::GetRandomBits() const |
| 106 | { |
nothing calls this directly
no test coverage detected