summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_road.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-08-16 10:33:36 +0000
committeryexo <yexo@openttd.org>2009-08-16 10:33:36 +0000
commitc89621540cff7a9a61e1769c8c465858324cc039 (patch)
treea560dceb18f4478d8ed63bdea154981cb39436d0 /src/ai/api/ai_road.hpp
parentb03e758d2577b17c31a443b9423440bc3c8dfbaf (diff)
downloadopenttd-c89621540cff7a9a61e1769c8c465858324cc039.tar.xz
(svn r17203) -Change [NoAI]: Add IsRoadTypeAvailable(GetCurrentRoadType()) as precondition for several AIRoad::* functions
Diffstat (limited to 'src/ai/api/ai_road.hpp')
-rw-r--r--src/ai/api/ai_road.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ai/api/ai_road.hpp b/src/ai/api/ai_road.hpp
index 9f8474838..e65655e4a 100644
--- a/src/ai/api/ai_road.hpp
+++ b/src/ai/api/ai_road.hpp
@@ -134,6 +134,7 @@ public:
* center of the second tile.
* @param tile_from The source tile.
* @param tile_to The destination tile.
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @pre AIMap::IsValidTile(tile_from).
* @pre AIMap::IsValidTile(tile_to).
* @pre 'tile_from' and 'tile_to' are directly neighbouring tiles.
@@ -197,6 +198,7 @@ public:
* Count how many neighbours are road.
* @param tile The tile to check on.
* @pre AIMap::IsValidTile(tile).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @return 0 means no neighbour road; max value is 4.
*/
static int32 GetNeighbourRoadCount(TileIndex tile);
@@ -237,6 +239,7 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_ALREADY_BUILT
* @exception AIError::ERR_LAND_SLOPED_WRONG
* @exception AIError::ERR_AREA_NOT_CLEAR
@@ -284,6 +287,7 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_ALREADY_BUILT
* @exception AIError::ERR_LAND_SLOPED_WRONG
* @exception AIError::ERR_AREA_NOT_CLEAR
@@ -328,6 +332,7 @@ public:
* @pre AIMap::IsValidTile(tile).
* @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it.
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_FLAT_LAND_REQUIRED
* @exception AIError::ERR_AREA_NOT_CLEAR
* @return Whether the road depot has been/can be build or not.
@@ -344,6 +349,7 @@ public:
* @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
+ * @pre GetCurrentRoadType() == ROADTYPE_ROAD.
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_FLAT_LAND_REQUIRED
@@ -367,6 +373,7 @@ public:
* @pre AIMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_FLAT_LAND_REQUIRED
@@ -389,6 +396,7 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
@@ -406,6 +414,7 @@ public:
* @pre 'start' and 'end' are in a straight line, i.e.
* AIMap::GetTileX(start) == AIMap::GetTileX(end) or
* AIMap::GetTileY(start) == AIMap::GetTileY(end).
+ * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception AIError::ERR_VEHICLE_IN_THE_WAY
* @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS