script_airport.hpp

Go to the documentation of this file.
00001 /* $Id: script_airport.hpp 23633 2011-12-19 21:05:36Z truebrain $ */
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 SCRIPT_AIRPORT_HPP
00013 #define SCRIPT_AIRPORT_HPP
00014 
00015 #include "script_object.hpp"
00016 #include "../../airport.h"
00017 
00022 class ScriptAirport : public ScriptObject {
00023 public:
00027   enum AirportType {
00028     /* Note: these values represent part of the in-game AirportTypes enum */
00029     AT_SMALL         = ::AT_SMALL,         
00030     AT_LARGE         = ::AT_LARGE,         
00031     AT_METROPOLITAN  = ::AT_METROPOLITAN,  
00032     AT_INTERNATIONAL = ::AT_INTERNATIONAL, 
00033     AT_COMMUTER      = ::AT_COMMUTER,      
00034     AT_INTERCON      = ::AT_INTERCON,      
00035     AT_HELIPORT      = ::AT_HELIPORT,      
00036     AT_HELISTATION   = ::AT_HELISTATION,   
00037     AT_HELIDEPOT     = ::AT_HELIDEPOT,     
00038     AT_INVALID       = ::AT_INVALID,       
00039   };
00040 
00044   enum PlaneType {
00045     /* Note: these values represent part of the in-game values, which are not defined in an enum */
00046     PT_HELICOPTER    =   0, 
00047     PT_SMALL_PLANE   =   1, 
00048     PT_BIG_PLANE     =   3, 
00049 
00050     PT_INVALID       =  -1, 
00051   };
00052 
00059   static bool IsValidAirportType(AirportType type);
00060 
00069   static bool IsAirportInformationAvailable(AirportType type);
00070 
00077   static Money GetPrice(AirportType type);
00078 
00085   static bool IsHangarTile(TileIndex tile);
00086 
00093   static bool IsAirportTile(TileIndex tile);
00094 
00101   static int32 GetAirportWidth(AirportType type);
00102 
00109   static int32 GetAirportHeight(AirportType type);
00110 
00117   static int32 GetAirportCoverageRadius(AirportType type);
00118 
00125   static int32 GetNumHangars(TileIndex tile);
00126 
00137   static TileIndex GetHangarOfAirport(TileIndex tile);
00138 
00155   static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id);
00156 
00165   static bool RemoveAirport(TileIndex tile);
00166 
00174   static AirportType GetAirportType(TileIndex tile);
00175 
00185   static int GetNoiseLevelIncrease(TileIndex tile, AirportType type);
00186 
00195   static TownID GetNearestTown(TileIndex tile, AirportType type);
00196 
00203   static uint16 GetMaintenanceCostFactor(AirportType type);
00204 };
00205 
00206 #endif /* SCRIPT_AIRPORT_HPP */