Update: Translations from eints
[openttd-github.git] / src / water.h
blob94a7db342b937f5d93b710104febd0734dcfe57b
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file water.h Functions related to water (management) */
10 #ifndef WATER_H
11 #define WATER_H
13 #include "water_map.h"
14 #include "economy_func.h"
16 /**
17 * Describes the behaviour of a tile during flooding.
19 enum FloodingBehaviour {
20 FLOOD_NONE, ///< The tile does not flood neighboured tiles.
21 FLOOD_ACTIVE, ///< The tile floods neighboured tiles.
22 FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up.
23 FLOOD_DRYUP, ///< The tile drys up if it is not constantly flooded from neighboured tiles.
26 FloodingBehaviour GetFloodingBehaviour(TileIndex tile);
28 void TileLoop_Water(TileIndex tile);
29 bool FloodHalftile(TileIndex t);
31 void ConvertGroundTilesIntoWaterTiles();
33 void DrawShipDepotSprite(int x, int y, Axis axis, DepotPart part);
34 void DrawWaterClassGround(const struct TileInfo *ti);
35 void DrawShoreTile(Slope tileh);
37 void MakeWaterKeepingClass(TileIndex tile, Owner o);
38 void CheckForDockingTile(TileIndex t);
40 void MakeRiverAndModifyDesertZoneAround(TileIndex tile);
41 static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Circular tile search radius to create non-desert around a river tile.
43 bool IsWateredTile(TileIndex tile, Direction from);
45 /**
46 * Calculates the maintenance cost of a number of canal tiles.
47 * @param num Number of canal tiles.
48 * @return Total cost.
50 inline Money CanalMaintenanceCost(uint32_t num)
52 return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling.
55 #endif /* WATER_H */