From c4a88ce0225a57243a79e28d133c2ecd884bee68 Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 18 Mar 2010 21:02:20 +0000 Subject: (svn r19455) -Codechange: split all airport information in Station to a seperate class --- src/ai/api/ai_airport.cpp | 4 ++-- src/ai/api/ai_depotlist.cpp | 2 +- src/ai/api/ai_order.cpp | 2 +- src/ai/api/ai_town.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ai') 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); } -- cgit v1.2.3-54-g00ecf