(svn r23415) -Feature: Infrastructure maintenance costs.

This commit is contained in:
michi_cc
2011-12-03 23:40:46 +00:00
parent bf5ef7537e
commit fc8633e1ac
21 changed files with 300 additions and 32 deletions

View File

@@ -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 */