summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-18 21:02:20 +0000
committeryexo <yexo@openttd.org>2010-03-18 21:02:20 +0000
commitc4a88ce0225a57243a79e28d133c2ecd884bee68 (patch)
tree766e1e5469d2c9d2956f5d6c79fd5bba787cf2ca /src/ai/api
parent0eb5709c86f8dbfdcf7f91a178e46be4a1bc53d0 (diff)
downloadopenttd-c4a88ce0225a57243a79e28d133c2ecd884bee68.tar.xz
(svn r19455) -Codechange: split all airport information in Station to a seperate class
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_airport.cpp4
-rw-r--r--src/ai/api/ai_depotlist.cpp2
-rw-r--r--src/ai/api/ai_order.cpp2
-rw-r--r--src/ai/api/ai_town.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp
index 7b1119765..8f3b5430b 100644
--- a/src/ai/api/ai_airport.cpp
+++ b/src/ai/api/ai_airport.cpp
@@ -96,7 +96,7 @@
if (st->owner != _current_company) return -1;
if ((st->facilities & FACIL_AIRPORT) == 0) return -1;
- return st->GetAirportSpec()->nof_depots;
+ return st->airport.GetSpec()->nof_depots;
}
/* static */ TileIndex AIAirport::GetHangarOfAirport(TileIndex tile)
@@ -120,7 +120,7 @@
if (!AIStation::HasStationType(station_id, AIStation::STATION_AIRPORT)) return AT_INVALID;
- return (AirportType)::Station::Get(station_id)->airport_type;
+ return (AirportType)::Station::Get(station_id)->airport.type;
}
diff --git a/src/ai/api/ai_depotlist.cpp b/src/ai/api/ai_depotlist.cpp
index a40c13a31..3a58c2c45 100644
--- a/src/ai/api/ai_depotlist.cpp
+++ b/src/ai/api/ai_depotlist.cpp
@@ -29,7 +29,7 @@ AIDepotList::AIDepotList(AITile::TransportType transport_type)
const Station *st;
FOR_ALL_STATIONS(st) {
if (st->owner == ::_current_company) {
- const AirportSpec *as = st->GetAirportSpec();
+ const AirportSpec *as = st->airport.GetSpec();
for (uint i = 0; i < as->nof_depots; i++) {
this->AddItem(st->GetHangarTile(i));
}
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index 71b111f8a..6290525d5 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -181,7 +181,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
if (v->type != VEH_AIRCRAFT) return ::Depot::Get(order->GetDestination())->xy;
/* Aircraft's hangars are referenced by StationID, not DepotID */
const Station *st = ::Station::Get(order->GetDestination());
- if (st->GetAirportSpec()->nof_depots == 0) return INVALID_TILE;
+ if (st->airport.GetSpec()->nof_depots == 0) return INVALID_TILE;
return st->GetHangarTile(0);
}
diff --git a/src/ai/api/ai_town.cpp b/src/ai/api/ai_town.cpp
index 7f8dc3090..a11e374e8 100644
--- a/src/ai/api/ai_town.cpp
+++ b/src/ai/api/ai_town.cpp
@@ -188,7 +188,7 @@
int num = 0;
const Station *st;
FOR_ALL_STATIONS(st) {
- if (st->town == t && (st->facilities & FACIL_AIRPORT) && st->airport_type != AT_OILRIG) num++;
+ if (st->town == t && (st->facilities & FACIL_AIRPORT) && st->airport.type != AT_OILRIG) num++;
}
return max(0, 2 - num);
}