summaryrefslogtreecommitdiff
path: root/src/station_func.h
diff options
context:
space:
mode:
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 */