Rework ChoosePylonPosition to simplify the loop
[openttd/fttd.git] / src / airport.cpp
blob547c094cd6a8308879f23309b3f392ddfca4dd7b
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file airport.cpp Functions related to airports. */
12 #include "stdafx.h"
13 #include "newgrf_airport.h"
14 #include "table/strings.h"
15 #include "table/airport_movement.h"
16 #include "table/airporttile_ids.h"
19 /**
20 * Define a generic airport.
21 * @param name Suffix of the names of the airport data.
22 * @param terminals The terminals.
23 * @param num_helipads Number of heli pads.
24 * @param flags Information about the class of FTA.
25 * @param delta_z Height of the airport above the land.
27 #define AIRPORT_GENERIC(name, terminals, num_helipads, ...) \
28 static const AirportFTA _airportfta_ ## name (_airport_fta_ ## name, terminals, \
29 num_helipads, _airport_entries_ ## name, __VA_ARGS__);
31 /**
32 * Define an airport.
33 * @param name Suffix of the names of the airport data.
34 * @param num_helipads Number of heli pads.
35 * @param short_strip Airport has a short land/take-off strip.
37 #define AIRPORT(name, num_helipads, short_strip) \
38 AIRPORT_GENERIC(name, _airport_terminal_ ## name, num_helipads, \
39 AirportFTA::ALL | (short_strip ? AirportFTA::SHORT_STRIP : \
40 (AirportFTA::Flags)0), 0, _airport_depots_ ## name)
42 /**
43 * Define a heliport.
44 * @param name Suffix of the names of the helipad data.
45 * @param num_helipads Number of heli pads.
46 * @param delta_z Height of the airport above the land.
48 #define HELIPORT(name, num_helipads, ...) \
49 AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTA::HELICOPTERS, __VA_ARGS__)
51 AIRPORT(country, 0, true)
52 AIRPORT(city, 0, false)
53 HELIPORT(heliport, 1, 60)
54 AIRPORT(metropolitan, 0, false)
55 AIRPORT(international, 2, false)
56 AIRPORT(commuter, 2, true)
57 HELIPORT(helidepot, 1, 0, _airport_depots_helidepot)
58 AIRPORT(intercontinental, 2, false)
59 HELIPORT(helistation, 3, 0, _airport_depots_helistation)
60 HELIPORT(oilrig, 1, 54)
62 #undef HELIPORT
63 #undef AIRPORT
64 #undef AIRPORT_GENERIC
66 #include "table/airport_defaults.h"
68 const AirportFTA AirportFTA::dummy (_airport_fta_dummy, NULL, 0,
69 _airport_entries_dummy, AirportFTA::ALL, 0);