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_marine.cpp | |
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_marine.cpp')
-rw-r--r-- | src/ai/api/ai_marine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ai/api/ai_marine.cpp b/src/ai/api/ai_marine.cpp index 8aea6cbd4..07de889da 100644 --- a/src/ai/api/ai_marine.cpp +++ b/src/ai/api/ai_marine.cpp @@ -13,6 +13,7 @@ #include "ai_station.hpp" #include "../../station_base.h" #include "../../tile_cmd.h" +#include "../../economy_func.h" /* static */ bool AIMarine::IsWaterDepotTile(TileIndex tile) @@ -149,3 +150,13 @@ return AIObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); } + +/* static */ Money AIMarine::GetBuildCost(BuildType build_type) +{ + switch (build_type) { + case BT_DOCK: return ::GetPrice(PR_BUILD_STATION_DOCK, 1, NULL); + case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_SHIP, 1, NULL); + case BT_BUOY: return ::GetPrice(PR_BUILD_WAYPOINT_BUOY, 1, NULL); + default: return -1; + } +} |