diff options
author | glx22 <glx@openttd.org> | 2021-06-13 02:41:41 +0200 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-07-09 21:36:09 +0200 |
commit | 5844027eb8588197d82fe896f027182621c4f923 (patch) | |
tree | 1c7def8d614ade7d98ab97d42651a152b34eafe7 /src/cargotype.h | |
parent | 87eb997be0ffb8a62f31ed222e41a10a2622437f (diff) | |
download | openttd-5844027eb8588197d82fe896f027182621c4f923.tar.xz |
Codechange: Remove FOR_ALL_SORTED_STANDARD_CARGOSPECS
Diffstat (limited to 'src/cargotype.h')
-rw-r--r-- | src/cargotype.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/cargotype.h b/src/cargotype.h index e411d5312..c93feea75 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -15,6 +15,7 @@ #include "gfx_type.h" #include "strings_type.h" #include "landscape_type.h" +#include "core/span_type.hpp" #include <vector> /** Globally unique label of a cargo type. */ @@ -181,7 +182,7 @@ CargoID GetDefaultCargoID(LandscapeID l, CargoType ct); void InitializeSortedCargoSpecs(); extern std::vector<const CargoSpec *> _sorted_cargo_specs; -extern uint8 _sorted_standard_cargo_specs_size; +extern span<const CargoSpec *> _sorted_standard_cargo_specs; /** * Does cargo \a c have cargo class \a cc? @@ -196,11 +197,4 @@ static inline bool IsCargoInClass(CargoID c, CargoClass cc) #define FOR_EACH_SET_CARGO_ID(var, cargo_bits) FOR_EACH_SET_BIT_EX(CargoID, var, CargoTypes, cargo_bits) -/** - * Loop header for iterating over 'real' cargoes, sorted by name. Phony cargoes like regearing cargoes are skipped. - * @param var Reference getting the cargospec. - * @see CargoSpec - */ -#define FOR_ALL_SORTED_STANDARD_CARGOSPECS(var) for (uint8 index = 0; index < _sorted_standard_cargo_specs_size && (var = _sorted_cargo_specs[index], true); index++) - #endif /* CARGOTYPE_H */ |