diff options
author | Peter Nelson <peter1138@openttd.org> | 2019-02-14 21:07:15 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-09 16:33:47 +0000 |
commit | 8b1b3fd0f91fd30d09d3acaa65bd9a7d23d966cc (patch) | |
tree | d82e99507fa2035a84ccec7859c0267ade95cd35 /src/station_base.h | |
parent | 3542ed53d4b79df3018a3291db8d8e97e20db273 (diff) | |
download | openttd-8b1b3fd0f91fd30d09d3acaa65bd9a7d23d966cc.tar.xz |
Feature: Non-rectangular sparse station catchment area.
Diffstat (limited to 'src/station_base.h')
-rw-r--r-- | src/station_base.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/station_base.h b/src/station_base.h index d1e62f614..a48daa653 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -19,6 +19,7 @@ #include "industry_type.h" #include "linkgraph/linkgraph_type.h" #include "newgrf_storage.h" +#include "bitmap_type.h" #include <map> #include <set> @@ -467,6 +468,8 @@ public: IndustryType indtype; ///< Industry type to get the name from + BitmapTileArea catchment_tiles; ///< NOSAVE: Set of individual tiles covered by catchment area + StationHadVehicleOfTypeByte had_vehicle_of_type; byte time_since_load; @@ -493,11 +496,18 @@ public: /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const; /* virtual */ uint GetPlatformLength(TileIndex tile) const; - void RecomputeIndustriesNear(); - static void RecomputeIndustriesNearForAll(); + void RecomputeCatchment(); + static void RecomputeCatchmentForAll(); uint GetCatchmentRadius() const; Rect GetCatchmentRect() const; + bool CatchmentCoversTown(TownID t) const; + void RemoveFromAllNearbyLists(); + + inline bool TileIsInCatchment(TileIndex tile) const + { + return this->catchment_tiles.HasTile(tile); + } /* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const { |