(svn r17294) -Add [NoAI]: AITown::GetLastMonthTransportedPercentage and AIIndustry::GetLastMonthTransportedPercentage
This commit is contained in:
@@ -92,6 +92,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 AITown::GetLastMonthTransportedPercentage(TownID town_id, CargoID cargo_id)
|
||||
{
|
||||
if (!IsValidTown(town_id)) return -1;
|
||||
if (!AICargo::IsValidCargo(cargo_id)) return -1;
|
||||
|
||||
const Town *t = ::Town::Get(town_id);
|
||||
|
||||
switch (AICargo::GetTownEffect(cargo_id)) {
|
||||
case AICargo::TE_PASSENGERS: return ::ToPercent8(t->pct_pass_transported);
|
||||
case AICargo::TE_MAIL: return ::ToPercent8(t->pct_mail_transported);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 AITown::GetDistanceManhattanToTile(TownID town_id, TileIndex tile)
|
||||
{
|
||||
return AIMap::DistanceManhattan(tile, GetLocation(town_id));
|
||||
|
Reference in New Issue
Block a user