Mercurial > hg > openttd
changeset 15460:e4312d30348a draft
(svn r20109) -Codechange: Make GetFloodingBehaviour() globally usable.
author | alberth <alberth@openttd.org> |
---|---|
date | Sat, 10 Jul 2010 12:45:34 +0000 |
parents | 5815672c4374 |
children | 3f7f8e8a342e |
files | src/water.h src/water_cmd.cpp |
diffstat | 2 files changed, 13 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/water.h +++ b/src/water.h @@ -16,6 +16,18 @@ #include "company_type.h" #include "slope_type.h" +/** + * Describes the behaviour of a tile during flooding. + */ +enum FloodingBehaviour { + FLOOD_NONE, ///< The tile does not flood neighboured tiles. + FLOOD_ACTIVE, ///< The tile floods neighboured tiles. + FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up. + FLOOD_DRYUP, ///< The tile drys up if it is not constantly flooded from neighboured tiles. +}; + +FloodingBehaviour GetFloodingBehaviour(TileIndex tile); + void TileLoop_Water(TileIndex tile); bool FloodHalftile(TileIndex t); void DoFloodTile(TileIndex target);
--- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -41,16 +41,6 @@ #include "table/strings.h" /** - * Describes the behaviour of a tile during flooding. - */ -enum FloodingBehaviour { - FLOOD_NONE, ///< The tile does not flood neighboured tiles. - FLOOD_ACTIVE, ///< The tile floods neighboured tiles. - FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up. - FLOOD_DRYUP, ///< The tile drys up if it is not constantly flooded from neighboured tiles. -}; - -/** * Describes from which directions a specific slope can be flooded (if the tile is floodable at all). */ static const uint8 _flood_from_dirs[] = { @@ -839,7 +829,7 @@ * * @return Behaviour of the tile */ -static FloodingBehaviour GetFloodingBehaviour(TileIndex tile) +FloodingBehaviour GetFloodingBehaviour(TileIndex tile) { /* FLOOD_ACTIVE: 'single-corner-raised'-coast, sea, sea-shipdepots, sea-buoys, sea-docks (water part), rail with flooded halftile, sea-water-industries, sea-oilrigs * FLOOD_DRYUP: coast with more than one corner raised, coast with rail-track, coast with trees