Fix #10490: Allow ships to exit depots if another is not moving at the exit point...
[openttd-github.git] / src / water.h
blob8829d7700fe8cb4909887fa1258610aa28effca5
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);
30 void DoFloodTile(TileIndex target);
32 void ConvertGroundTilesIntoWaterTiles();
34 void DrawShipDepotSprite(int x, int y, Axis axis, DepotPart part);
35 void DrawWaterClassGround(const struct TileInfo *ti);
36 void DrawShoreTile(Slope tileh);
38 void MakeWaterKeepingClass(TileIndex tile, Owner o);
39 void CheckForDockingTile(TileIndex t);
41 bool RiverModifyDesertZone(TileIndex tile, void *data);
42 void MakeRiverAndModifyDesertZoneAround(TileIndex tile);
43 static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Circular tile search radius to create non-desert around a river tile.
45 bool IsWateredTile(TileIndex tile, Direction from);
47 /**
48 * Calculates the maintenance cost of a number of canal tiles.
49 * @param num Number of canal tiles.
50 * @return Total cost.
52 inline Money CanalMaintenanceCost(uint32_t num)
54 return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling.
57 #endif /* WATER_H */