# ai_airport.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_airport.hpp 17591 2009-09-20 18:38:43Z yexo $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef AI_AIRPORT_HPP
    00013 #define AI_AIRPORT_HPP
    00014
    00015 #include "ai_object.hpp"
    00016
    00020 class AIAirport : public AIObject {
    00021 public:
    00022   static const char *GetClassName() { return "AIAirport"; }
    00023
    00027   enum AirportType {
    00028     /* Note: the values _are_ important as they represent an in-game value */
    00029     AT_SMALL         =   0,
    00030     AT_LARGE         =   1,
    00031     AT_METROPOLITAN  =   3,
    00032     AT_INTERNATIONAL =   4,
    00033     AT_COMMUTER      =   5,
    00034     AT_INTERCON      =   7,
    00035
    00036     /* Next are the airports which only have helicopter platforms */
    00037     AT_HELIPORT      =   2,
    00038     AT_HELISTATION   =   8,
    00039     AT_HELIDEPOT     =   6,
    00040
    00041     AT_INVALID       = 255,
    00042   };
    00043
    00047   enum PlaneType {
    00048     /* Note: the values _are_ important as they represent an in-game value */
    00049     PT_HELICOPTER    =   0,
    00050     PT_SMALL_PLANE   =   1,
    00051     PT_BIG_PLANE     =   3,
    00052
    00053     PT_INVALID       =  -1,
    00054   };
    00055
    00062   static bool IsValidAirportType(AirportType type);
    00063
    00072   static bool IsAirportInformationAvailable(AirportType type);
    00073
    00080   static Money GetPrice(AirportType type);
    00081
    00088   static bool IsHangarTile(TileIndex tile);
    00089
    00096   static bool IsAirportTile(TileIndex tile);
    00097
    00104   static int32 GetAirportWidth(AirportType type);
    00105
    00112   static int32 GetAirportHeight(AirportType type);
    00113
    00120   static int32 GetAirportCoverageRadius(AirportType type);
    00121
    00128   static int32 GetNumHangars(TileIndex tile);
    00129
    00140   static TileIndex GetHangarOfAirport(TileIndex tile);
    00141
    00157   static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id);
    00158
    00166   static bool RemoveAirport(TileIndex tile);
    00167
    00175   static AirportType GetAirportType(TileIndex tile);
    00176
    00185   static int GetNoiseLevelIncrease(TileIndex tile, AirportType type);
    00186
    00195   static TownID GetNearestTown(TileIndex tile, AirportType type);
    00196 };
    00197
    00198 #endif /* AI_AIRPORT_HPP */