(svn r16252) -Add [NoAI]: AIAirport::GetPrice, returning the building cost of an airport

This commit is contained in:
yexo
2009-05-07 21:30:18 +00:00
parent 04c74c1095
commit 0ad4f31658
5 changed files with 19 additions and 0 deletions

View File

@@ -8,12 +8,21 @@
#include "../../company_func.h"
#include "../../command_type.h"
#include "../../town.h"
#include "../../economy_func.h"
/* static */ bool AIAirport::IsValidAirportType(AirportType type)
{
return type >= AT_SMALL && type <= AT_HELISTATION && HasBit(::GetValidAirports(), type);
}
/* static */ Money AIAirport::GetPrice(AirportType type)
{
if (!IsValidAirportType(type)) return -1;
const AirportFTAClass *afc = ::GetAirport(type);
return _price.build_airport * afc->size_x * afc->size_y;
}
/* static */ bool AIAirport::IsHangarTile(TileIndex tile)
{
if (!::IsValidTile(tile)) return false;