diff options
author | peter1138 <peter1138@openttd.org> | 2019-02-24 19:16:24 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-09 16:33:47 +0000 |
commit | 94b40fd530f8ef348434d14a1c85fde66e25c98a (patch) | |
tree | 0c9bdb846d86e484077cf4d997422567b7599246 /src/station_base.h | |
parent | ed6084523d546641d4ec9ff5f560387d7c40670f (diff) | |
download | openttd-94b40fd530f8ef348434d14a1c85fde66e25c98a.tar.xz |
Codechange: Convert IndustryVector to a std::set.
Diffstat (limited to 'src/station_base.h')
-rw-r--r-- | src/station_base.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/station_base.h b/src/station_base.h index 0ea960bb1..d1e62f614 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -20,6 +20,7 @@ #include "linkgraph/linkgraph_type.h" #include "newgrf_storage.h" #include <map> +#include <set> typedef Pool<BaseStation, StationID, 32, 64000> StationPool; extern StationPool _station_pool; @@ -440,7 +441,11 @@ private: } }; -typedef SmallVector<Industry *, 2> IndustryVector; +struct IndustryCompare { + bool operator() (const Industry *lhs, const Industry *rhs) const; +}; + +typedef std::set<Industry *, IndustryCompare> IndustryList; /** Station data structure */ struct Station FINAL : SpecializedStation<Station, false> { @@ -472,8 +477,8 @@ public: GoodsEntry goods[NUM_CARGO]; ///< Goods at this station CargoTypes always_accepted; ///< Bitmask of always accepted cargo types (by houses, HQs, industry tiles when industry doesn't accept cargo) - IndustryVector industries_near; ///< Cached list of industries near the station that can accept cargo, @see DeliverGoodsToIndustry() - Industry *industry; ///< NOSAVE: Associated industry for neutral stations. (Rebuilt on load from Industry->st) + IndustryList industries_near; ///< Cached list of industries near the station that can accept cargo, @see DeliverGoodsToIndustry() + Industry *industry; ///< NOSAVE: Associated industry for neutral stations. (Rebuilt on load from Industry->st) Station(TileIndex tile = INVALID_TILE); ~Station(); |