src/road_func.h
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6872 1c4a4a609f85
--- a/src/road_func.h	Mon Apr 14 20:32:36 2008 +0000
+++ b/src/road_func.h	Tue Apr 15 00:47:19 2008 +0000
@@ -101,6 +101,17 @@
 }
 
 /**
+ * Check if we've got a straight road
+ *
+ * @param r The given RoadBits
+ * @return true if we've got a straight road
+ */
+static inline bool IsStraightRoad(RoadBits r)
+{
+	return (r == ROAD_X || r == ROAD_Y);
+}
+
+/**
  * Create the road-part which belongs to the given DiagDirection
  *
  * This function returns a RoadBits value which belongs to
@@ -115,6 +126,20 @@
 }
 
 /**
+ * Create the road-part which belongs to the given Axis
+ *
+ * This function returns a RoadBits value which belongs to
+ * the given Axis.
+ *
+ * @param a The Axis
+ * @return The result RoadBits which the selected road-part set
+ */
+static inline RoadBits AxisToRoadBits(Axis a)
+{
+	return a == AXIS_X ? ROAD_X : ROAD_Y;
+}
+
+/**
  * Finds out, whether given player has all given RoadTypes available
  * @param PlayerID ID of player
  * @param rts RoadTypes to test