src/rail.h
changeset 8226 c66a40c8e9bf
parent 8199 00ee9637c0a0
child 8267 c600379bd333
--- a/src/rail.h	Sun Oct 14 20:24:42 2007 +0000
+++ b/src/rail.h	Sun Oct 14 21:20:12 2007 +0000
@@ -8,6 +8,7 @@
 #include "gfx.h"
 #include "direction.h"
 #include "tile.h"
+#include "variables.h"
 
 /**
  * Enumeration for all possible railtypes.
@@ -791,6 +792,21 @@
 	return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT;
 }
 
+
+extern int _railtype_cost_multiplier[RAILTYPE_END];
+extern const int _default_railtype_cost_multiplier[RAILTYPE_END];
+
+/**
+ * Returns the cost of building the specified railtype.
+ * @param railtype The railtype being built.
+ * @return The cost multiplier.
+ */
+static inline Money RailBuildCost(RailType railtype)
+{
+	assert(railtype < RAILTYPE_END);
+	return (_price.build_rail * _railtype_cost_multiplier[railtype]) >> 3;
+}
+
 void *UpdateTrainPowerProc(Vehicle *v, void *data);
 void DrawTrainDepotSprite(int x, int y, int image, RailType railtype);
 void DrawDefaultWaypointSprite(int x, int y, RailType railtype);