forked from mirror/OpenTTD
(svn r23415) -Feature: Infrastructure maintenance costs.
This commit is contained in:
12
src/water.h
12
src/water.h
@@ -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 */
|
||||
|
Reference in New Issue
Block a user