diff options
author | yexo <yexo@openttd.org> | 2009-02-19 07:40:08 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-02-19 07:40:08 +0000 |
commit | c0e7ddeb9ee8892103a1314dac25e0d7250e6af4 (patch) | |
tree | fa0d25f1d5a2c7fdfd64122bd10dc5ee7291d2fe /src/ai/api/ai_rail.hpp | |
parent | c2d9c85c0fbb26b5db2ef20b7ac610e63de2b46b (diff) | |
download | openttd-c0e7ddeb9ee8892103a1314dac25e0d7250e6af4.tar.xz |
(svn r15519) -Add [NoAI]: support for waypoints by adding AIRail::Build/Remove RailWaypoint, AIWaypoint and AIWaypointList.
Diffstat (limited to 'src/ai/api/ai_rail.hpp')
-rw-r--r-- | src/ai/api/ai_rail.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ai/api/ai_rail.hpp b/src/ai/api/ai_rail.hpp index 7444907f2..0044d56a9 100644 --- a/src/ai/api/ai_rail.hpp +++ b/src/ai/api/ai_rail.hpp @@ -261,6 +261,27 @@ public: static bool BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station); /** + * Build a rail waypoint. + * @param tile Place to build the waypoint. + * @pre AIMap::IsValidTile(tile). + * @pre IsRailTile(tile). + * @pre GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE. + * @pre IsRailTypeAvailable(GetCurrentRailType()). + * @exception AIError::ERR_FLAT_LAND_REQUIRED + * @return Whether the rail waypoint has been/can be build or not. + */ + static bool BuildRailWaypoint(TileIndex tile); + + /** + * Remove a rail waypoint. + * @param tile Place to remove the waypoint from. + * @pre AIMap::IsValidTile(tile). + * @pre IsRailWaypointTile(tile). + * @return Whether the rail waypoint has been/can be removed or not. + */ + static bool RemoveRailWaypoint(TileIndex tile); + + /** * Remove a rectangle of platform pieces from a rail station. * @param tile One corner of the rectangle to clear. * @param tile2 The oppposite corner. |