* Get the cargo translation table to use for the given GRF file. * @param grffile GRF file. * @returns Readonly cargo translation table to use. */
| 519 | * @returns Readonly cargo translation table to use. |
| 520 | */ |
| 521 | std::span<const CargoLabel> GetCargoTranslationTable(const GRFFile &grffile) |
| 522 | { |
| 523 | /* Always use the translation table if it's installed. */ |
| 524 | if (!grffile.cargo_list.empty()) return grffile.cargo_list; |
| 525 | |
| 526 | /* Pre-v7 use climate-dependent "slot" table. */ |
| 527 | if (grffile.grf_version < 7) return GetClimateDependentCargoTranslationTable(); |
| 528 | |
| 529 | /* Otherwise use climate-independent "bitnum" table. */ |
| 530 | return GetClimateIndependentCargoTranslationTable(); |
| 531 | } |
| 532 | |
| 533 | /** |
| 534 | * Construct the Cargo Mapping |
no test coverage detected