(svn r18955) -Feature: [NoAI] introduce GetBuildCost functions in several classes to get easier cost estimations before you start building

This commit is contained in:
yexo
2010-01-29 23:56:42 +00:00
parent 93d93b3121
commit 16659e5516
15 changed files with 239 additions and 0 deletions

View File

@@ -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;
}
}