summaryrefslogtreecommitdiff
path: root/src/station_map.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-24 11:15:11 +0000
committerrubidium <rubidium@openttd.org>2009-07-24 11:15:11 +0000
commit2c6b5237f68b1ce444f35eef6e31e7c0ff49d7cc (patch)
treea327b740ebd6f71336780c857326fe41fbe56683 /src/station_map.h
parent07447a1766145231e97b39993ec55d01e9be7bca (diff)
downloadopenttd-2c6b5237f68b1ce444f35eef6e31e7c0ff49d7cc.tar.xz
(svn r16938) -Codechange: introduce helper function to tell whether a tile is either a rail station or rail waypoint tile
Diffstat (limited to 'src/station_map.h')
-rw-r--r--src/station_map.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/station_map.h b/src/station_map.h
index ef1a7a54f..b93154899 100644
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -109,6 +109,28 @@ static inline bool IsRailWaypointTile(TileIndex t)
return IsTileType(t, MP_STATION) && IsRailWaypoint(t);
}
+/**
+ * Has this station tile a rail? In other words, is this station
+ * tile a rail station or rail waypoint?
+ * @param t the tile to check
+ * @pre IsTileType(t, MP_STATION)
+ * @return true if and only if the tile has rail
+ */
+static inline bool HasStationRail(TileIndex t)
+{
+ return IsRailwayStation(t) || IsRailWaypoint(t);
+}
+
+/**
+ * Has this station tile a rail? In other words, is this station
+ * tile a rail station or rail waypoint?
+ * @param t the tile to check
+ * @return true if and only if the tile is a station tile and has rail
+ */
+static inline bool HasStationTileRail(TileIndex t)
+{
+ return IsTileType(t, MP_STATION) && HasStationRail(t);
+}
static inline bool IsAirport(TileIndex t)
{