summaryrefslogtreecommitdiff
path: root/src/station_func.h
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-03 23:40:46 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-03 23:40:46 +0000
commitd3b7b89493e025654d218fb77da095649b4f6ba2 (patch)
tree6667e4164c5c8bda4c1b7092376872b315c65610 /src/station_func.h
parentf98312eb77e12cfa45de40a1b4e8359160b0d9ff (diff)
downloadopenttd-d3b7b89493e025654d218fb77da095649b4f6ba2.tar.xz
(svn r23415) -Feature: Infrastructure maintenance costs.
Diffstat (limited to 'src/station_func.h')
-rw-r--r--src/station_func.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/station_func.h b/src/station_func.h
index 0fe5b2f84..8f2901745 100644
--- a/src/station_func.h
+++ b/src/station_func.h
@@ -18,6 +18,7 @@
#include "road_type.h"
#include "cargo_type.h"
#include "company_type.h"
+#include "economy_func.h"
void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
@@ -46,4 +47,16 @@ bool IsStationTileElectrifiable(TileIndex tile);
void UpdateAirportsNoise();
+/**
+ * Calculates the maintenance cost of a number of station tiles.
+ * @param num Number of station tiles.
+ * @return Total cost.
+ */
+static inline Money StationMaintenanceCost(uint32 num)
+{
+ return (_price[PR_INFRASTRUCTURE_STATION] * num * (1 + IntSqrt(num))) >> 7; // 7 bits scaling.
+}
+
+Money AirportMaintenanceCost(Owner owner);
+
#endif /* STATION_FUNC_H */