(svn r25213) -Fix [FS#5537]: clarify on which tiles IsDesertTile and IsSnowTile work, i.e. the ones without infrastructure or buildings

-Feature: introduce GetTerrainType which allows one to get that information for tiles with buildings and infrastructure as well
This commit is contained in:
rubidium
2013-04-30 17:16:32 +00:00
parent 5b55afb7bd
commit 5730e63a10
11 changed files with 60 additions and 4 deletions

View File

@@ -120,6 +120,19 @@ public:
BT_CLEAR_HOUSE, ///< Clear a tile with a house
};
/**
* The types of terrain a tile can have.
*
* @note When a desert or rainforest tile are changed, their terrain type will remain the same. In other words, a sea tile can be of the desert terrain type.
* @note The snow terrain type can change to the normal terrain type and vice versa based on landscaping or variable snow lines from NewGRFs.
*/
enum TerrainType {
TERRAIN_NORMAL, ///< A normal tile (default); not desert, rainforest or snow.
TERRAIN_DESERT, ///< A tile in the desert (manually set in in scenarios, below certain height and certain distance from water in random games).
TERRAIN_RAINFOREST, ///< A tile in the rainforest (manually set in scenarios, certain distance away from deserts in random games),
TERRAIN_SNOW ///< A tile on or above the snowline level.
};
/**
* Check if this tile is buildable, i.e. no things on it that needs
* demolishing.
@@ -222,7 +235,8 @@ public:
static bool IsRoughTile(TileIndex tile);
/**
* Check if the tile is a snow tile.
* Check if the tile without buildings or infrastructure is a snow tile.
* @note If you want to know if a tile (with or without buildings and infrastructure) is on or above the snowline, use ScriptTile::GetTerrainType(tile).
* @param tile The tile to check on.
* @pre ScriptMap::IsValidTile(tile).
* @return True if and only if the tile is snow tile.
@@ -230,13 +244,24 @@ public:
static bool IsSnowTile(TileIndex tile);
/**
* Check if the tile is a desert tile.
* Check if the tile without buildings or infrastructure is a desert tile.
* @note If you want to know if a tile (with or without buildings and infrastructure) is in a desert, use ScriptTile::GetTerrainType(tile).
* @param tile The tile to check on.
* @pre ScriptMap::IsValidTile(tile).
* @return True if and only if the tile is desert tile.
*/
static bool IsDesertTile(TileIndex tile);
/**
* Get the type of terrain regardless of buildings or infrastructure.
* @note When a desert or rainforest tile are changed, their terrain type will remain the same. In other words, a sea tile can be of the desert terrain type.
* @note The snow terrain type can change to the normal terrain type and vice versa based on landscaping or variable snow lines from NewGRFs.
* @param tile The tile to check on.
* @pre ScriptMap::IsValidTile(tile).
* @return The #TerrainType.
*/
static TerrainType GetTerrainType(TileIndex tile);
/**
* Get the slope of a tile.
* This is the slope of the bare tile. A possible foundation on the tile does not influence this slope.