diff src/station_map.h @ 12501:44606771f552 draft

(svn r16938) -Codechange: introduce helper function to tell whether a tile is either a rail station or rail waypoint tile
author rubidium <rubidium@openttd.org>
date Fri, 24 Jul 2009 11:15:11 +0000
parents 604a2cfc77ab
children 9472b49c61a1
line wrap: on
line diff
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -109,6 +109,28 @@
 	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)
 {