Feature: Non-rectangular sparse station catchment area.

This commit is contained in:
2019-02-14 21:07:15 +00:00
committed by PeterN
parent 3542ed53d4
commit 8b1b3fd0f9
13 changed files with 285 additions and 147 deletions

View File

@@ -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
{