(svn r16654) -Codechange: cache industries in station's coverage area instead of searching them everytime payment is made
This commit is contained in:
@@ -77,6 +77,8 @@ struct StationRect : public Rect {
|
||||
StationRect& operator = (Rect src);
|
||||
};
|
||||
|
||||
typedef SmallVector<Industry *, 2> IndustryVector;
|
||||
|
||||
/** Station data structure */
|
||||
struct Station : StationPool::PoolItem<&_station_pool> {
|
||||
public:
|
||||
@@ -132,6 +134,8 @@ public:
|
||||
std::list<Vehicle *> loading_vehicles;
|
||||
GoodsEntry goods[NUM_CARGO]; ///< Goods at this station
|
||||
|
||||
IndustryVector industries_near; ///< Cached list of industries near the station that can accept cargo, @see DeliverGoodsToIndustry()
|
||||
|
||||
uint16 random_bits;
|
||||
byte waiting_triggers;
|
||||
uint8 cached_anim_triggers; ///< Combined animation trigger bitmask, used to determine if trigger processing should happen.
|
||||
@@ -161,6 +165,9 @@ public:
|
||||
uint GetPlatformLength(TileIndex tile) const;
|
||||
bool IsBuoy() const;
|
||||
|
||||
void RecomputeIndustriesNear();
|
||||
static void RecomputeIndustriesNearForAll();
|
||||
|
||||
uint GetCatchmentRadius() const;
|
||||
|
||||
static FORCEINLINE Station *GetByTile(TileIndex tile)
|
||||
|
Reference in New Issue
Block a user