(svn r23415) -Feature: Infrastructure maintenance costs.

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

View File

@@ -16,6 +16,8 @@
#include "company_type.h"
#include "slope_type.h"
#include "water_map.h"
#include "economy_func.h"
#include "core/math_func.hpp"
/**
* Describes the behaviour of a tile during flooding.
@@ -43,4 +45,14 @@ void MakeWaterKeepingClass(TileIndex tile, Owner o);
bool RiverModifyDesertZone(TileIndex tile, void *data);
/**
* Calculates the maintenance cost of a number of canal tiles.
* @param num Number of canal tiles.
* @return Total cost.
*/
static inline Money CanalMaintenanceCost(uint32 num)
{
return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling.
}
#endif /* WATER_H */