summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_road.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-29 23:56:42 +0000
committeryexo <yexo@openttd.org>2010-01-29 23:56:42 +0000
commit15016e3511b075e999cdb0db45936d5e6b223aa4 (patch)
treed053d2759a7c64b76e429d0367216567ec051534 /src/ai/api/ai_road.hpp
parent54f958c8e5c99804d1e46c2fe6b3b5ef5cae3db6 (diff)
downloadopenttd-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_road.hpp')
-rw-r--r--src/ai/api/ai_road.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ai/api/ai_road.hpp b/src/ai/api/ai_road.hpp
index 970b833dd..a0bc131e6 100644
--- a/src/ai/api/ai_road.hpp
+++ b/src/ai/api/ai_road.hpp
@@ -64,6 +64,16 @@ public:
};
/**
+ * Types of road-related objects in the game.
+ */
+ enum BuildType {
+ BT_ROAD, //!< Build a piece of road
+ BT_DEPOT, //!< Build a road depot
+ BT_BUS_STOP, //!< Build a bus stop
+ BT_TRUCK_STOP, //!< Build a truck stop
+ };
+
+ /**
* Determines whether a busstop or a truckstop is needed to transport a certain cargo.
* @param cargo_type The cargo to test.
* @pre AICargo::IsValidCargo(cargo_type).
@@ -451,6 +461,15 @@ public:
*/
static bool RemoveRoadStation(TileIndex tile);
+ /**
+ * Get the baseprice of building a road-related object.
+ * @param roadtype the roadtype that is build (on)
+ * @param build_type the type of object to build
+ * @pre IsRoadTypeAvailable(railtype)
+ * @return The baseprice of building the given object.
+ */
+ static Money GetBuildCost(RoadType roadtype, BuildType build_type);
+
private:
/**