truelight@9654: /* $Id$ */ truelight@9654: truelight@9654: /** @file ai_airport.hpp Everything to query and build airports */ truelight@9654: truelight@9654: #ifndef AI_AIRPORT_HPP truelight@9654: #define AI_AIRPORT_HPP truelight@9654: truelight@9654: #include "ai_object.hpp" truelight@9654: truelight@9654: /** truelight@9654: * Class that handles all airport related functions. truelight@9654: */ truelight@9654: class AIAirport : public AIObject { truelight@9654: public: truelight@9669: /** truelight@9669: * The types of airports available in the game. truelight@9669: */ truelight@9654: enum AirportType { truelight@9681: /* Note: the values _are_ important as they represent an in-game value */ truelight@9654: AT_SMALL = 0, truelight@9654: AT_LARGE = 1, truelight@9654: AT_HELIPORT = 2, truelight@9654: AT_METROPOLITAN = 3, truelight@9654: AT_INTERNATIONAL = 4, truelight@9654: AT_COMMUTER = 5, truelight@9654: AT_HELIDEPOT = 6, truelight@9654: AT_INTERCON = 7, truelight@9654: AT_HELISTATION = 8, truelight@9654: }; truelight@9654: truelight@9654: /** truelight@9654: * The name of the class, needed by several sub-processes. truelight@9654: */ truelight@9654: static const char *GetClassName() { return "AIAirport"; } truelight@9654: truelight@9654: /** truelight@9654: * Checks whether the given tile is actually a tile with a hangar. truelight@9654: * @param tile the tile to check. truelight@9654: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9654: * @return true if and only if the tile has a hangar. truelight@9654: */ truelight@9670: static bool IsHangarTile(TileIndex tile); truelight@9654: truelight@9654: /** truelight@9654: * Checks whether the given tile is actually a tile with a airport. truelight@9654: * @param tile the tile to check. truelight@9654: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9654: * @return true if and only if the tile has a airport. truelight@9654: */ truelight@9670: static bool IsAirportTile(TileIndex tile); truelight@9654: truelight@9654: /** truelight@9654: * Check if a certain airport type is already available. truelight@9654: * @param type the type of airport to check. truelight@9654: */ truelight@9670: static bool AiportAvailable(AirportType type); truelight@9670: truelight@9670: /** truelight@9670: * Get the width of this type of airport. truelight@9670: * @param type the type of airport. truelight@9670: * @return the width in tiles. truelight@9670: */ truelight@9670: static int32 GetAirportWidth(AirportType type); truelight@9670: truelight@9670: /** truelight@9670: * Get the height of this type of airport. truelight@9670: * @param type the type of airport. truelight@9670: * @return the height in tiles. truelight@9670: */ truelight@9670: static int32 GetAirportHeight(AirportType type); truelight@9670: truelight@9670: /** truelight@9670: * Get the coverage radius of this type of airport. truelight@9670: * @param type the type of airport. truelight@9670: * @return the radius in tiles. truelight@9670: */ truelight@9670: static int32 GetAirportCoverageRadius(AirportType type); truelight@9654: truelight@9654: /** truelight@9654: * Builds a airport with tile at the topleft corner. truelight@9654: * @param tile the topleft corner of the airport. truelight@9654: * @param type the type of airport to build. truelight@9654: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9654: * @return whether the airport has been/can be build or not. truelight@9654: */ truebrain@9737: static bool BuildAirport(TileIndex tile, AirportType type); truelight@9654: truelight@9654: /** truelight@9654: * Removes a airport. truelight@9654: * @param tile any tile of the airport. truelight@9654: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9654: * @return whether the airport has been/can be removed or not. truelight@9654: */ truebrain@9737: static bool RemoveAirport(TileIndex tile); truelight@9654: truelight@9654: /** truelight@9654: * Get the first hanger tile of the airport. truelight@9654: * @param tile any tile of the airport. truelight@9654: * @pre tile is always positive and smaller than AIMap::GetMapSize(). truelight@9654: * @return the first hanger tile of the airport. truelight@9654: */ truebrain@9737: static TileIndex GetHangarOfAirport(TileIndex tile); truelight@9654: }; truelight@9654: truelight@9654: #endif /* AI_AIRPORT_HPP */