Translations update
[openttd/fttd.git] / src / water.h
blob66235da097ab3d08bae0b814408461e34557557b
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file water.h Functions related to water (management) */
12 #ifndef WATER_H
13 #define WATER_H
15 #include "direction_type.h"
16 #include "map/water.h"
17 #include "economy_func.h"
18 #include "gfx_func.h"
20 /**
21 * Describes the behaviour of a tile during flooding.
23 enum FloodingBehaviour {
24 FLOOD_NONE, ///< The tile does not flood neighboured tiles.
25 FLOOD_ACTIVE, ///< The tile floods neighboured tiles.
26 FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up.
27 FLOOD_DRYUP, ///< The tile drys up if it is not constantly flooded from neighboured tiles.
30 FloodingBehaviour GetFloodingBehaviour(TileIndex tile);
32 void TileLoop_Water(TileIndex tile);
33 bool FloodHalftile(TileIndex t);
34 void DoFloodTile(TileIndex target);
36 void ConvertGroundTilesIntoWaterTiles();
38 void DrawShipDepotSprite (BlitArea *dpi, int x, int y, DiagDirection dir);
39 void DrawWaterClassGround(const struct TileInfo *ti);
40 void DrawShoreTile (const struct TileInfo *ti);
42 void MakeWaterKeepingClass(TileIndex tile, Owner o);
44 void RiverModifyDesertZone (TileIndex tile);
46 bool IsWateredTile(TileIndex tile, Direction from);
48 /**
49 * Calculates the maintenance cost of a number of canal tiles.
50 * @param num Number of canal tiles.
51 * @return Total cost.
53 static inline Money CanalMaintenanceCost(uint32 num)
55 return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling.
58 #endif /* WATER_H */