diff options
author | yexo <yexo@openttd.org> | 2010-01-29 23:56:42 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-29 23:56:42 +0000 |
commit | 15016e3511b075e999cdb0db45936d5e6b223aa4 (patch) | |
tree | d053d2759a7c64b76e429d0367216567ec051534 /src/ai/api/ai_rail.hpp | |
parent | 54f958c8e5c99804d1e46c2fe6b3b5ef5cae3db6 (diff) | |
download | openttd-15016e3511b075e999cdb0db45936d5e6b223aa4.tar.xz |
(svn r18955) -Feature: [NoAI] introduce GetBuildCost functions in several classes to get easier cost estimations before you start building
Diffstat (limited to 'src/ai/api/ai_rail.hpp')
-rw-r--r-- | src/ai/api/ai_rail.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ai/api/ai_rail.hpp b/src/ai/api/ai_rail.hpp index 2b662bc38..7170412ba 100644 --- a/src/ai/api/ai_rail.hpp +++ b/src/ai/api/ai_rail.hpp @@ -82,6 +82,17 @@ public: }; /** + * Types of rail-related objects in the game. + */ + enum BuildType { + BT_TRACK, //!< Build a track + BT_SIGNAL, //!< Build a signal + BT_DEPOT, //!< Build a depot + BT_STATION, //!< Build a station + BT_WAYPOINT, //!< Build a rail waypoint + }; + + /** * Checks whether the given tile is actually a tile with rail that can be * used to traverse a tile. This excludes rail depots but includes * stations and waypoints. @@ -419,6 +430,15 @@ public: * @return Whether the signal has been/can be removed or not. */ static bool RemoveSignal(TileIndex tile, TileIndex front); + + /** + * Get the baseprice of building a rail-related object. + * @param railtype the railtype that is build (on) + * @param build_type the type of object to build + * @pre IsRailTypeAvailable(railtype) + * @return The baseprice of building the given object. + */ + static Money GetBuildCost(RailType railtype, BuildType build_type); }; #endif /* AI_RAIL_HPP */ |