src/airport.h
author Tero Marttila <terom@fixme.fi>
Fri, 18 Jul 2008 22:41:08 +0300
changeset 11177 6d9a43c48924
parent 10682 3b753d908205
permissions -rw-r--r--
set the GRFConfig's next ptr to NULL
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     2
6443
b8f06d8eb7be (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6367
diff changeset
     3
/** @file airport.h Various declarations for airports */
b8f06d8eb7be (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6367
diff changeset
     4
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#ifndef AIRPORT_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
#define AIRPORT_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8596
27646407e0bc (svn r11661) -Codechange: some header reworks in order to try to reduce the compile time of OpenTTD by reduce the amount of circular-ish dependencies.
rubidium
parents: 7644
diff changeset
     8
#include "direction_type.h"
8635
3bbb6f87fced (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents: 8634
diff changeset
     9
#include "map_type.h"
10682
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
    10
#include "tile_type.h"
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    11
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    12
enum {MAX_TERMINALS =  10};
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    13
enum {MAX_HELIPADS  =   4};
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    14
enum {MAX_ELEMENTS  = 255};
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    15
enum {MAX_HEADINGS  =  22};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
    17
/* Airport types */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
enum {
6890
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    19
	AT_SMALL         =   0,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    20
	AT_LARGE         =   1,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    21
	AT_HELIPORT      =   2,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    22
	AT_METROPOLITAN  =   3,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    23
	AT_INTERNATIONAL =   4,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    24
	AT_COMMUTER      =   5,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    25
	AT_HELIDEPOT     =   6,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    26
	AT_INTERCON      =   7,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    27
	AT_HELISTATION   =   8,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    28
	AT_OILRIG        =  15,
6c53cd7ce903 (svn r9524) -Fix(FS#640,r8755): Implemented a "dummy" State Machine for stations who got their airport removed while there were still aircraft within the State Machine (and thus caused asserts)
celestar
parents: 6574
diff changeset
    29
	AT_DUMMY         = 255
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    32
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    33
enum {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    34
	AMED_NOSPDCLAMP = 1 << 0,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    35
	AMED_TAKEOFF    = 1 << 1,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    36
	AMED_SLOWTURN   = 1 << 2,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    37
	AMED_LAND       = 1 << 3,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    38
	AMED_EXACTPOS   = 1 << 4,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    39
	AMED_BRAKE      = 1 << 5,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    40
	AMED_HELI_RAISE = 1 << 6,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    41
	AMED_HELI_LOWER = 1 << 7,
6519
367d6f96e23f (svn r8973) -Feature/Codechange: Changed the internal unit for aircraft velocities to from 8mph to 1km/h (peter1138), also give aircraft realsitic velocities (so that 1km/h is 1km/h independent of vehicle type) (peter1138). Introduce a flag to reduce aircraft speed in holding patterns to some realistic velocity. Use this flag for the city airport for the time being and make use of the different entry points for this airport type.
celestar
parents: 6443
diff changeset
    42
	AMED_HOLD       = 1 << 8
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    43
};
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    44
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    45
/* Movement States on Airports (headings target) */
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    46
enum {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    47
	TO_ALL         =  0,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    48
	HANGAR         =  1,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    49
	TERM1          =  2,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    50
	TERM2          =  3,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    51
	TERM3          =  4,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    52
	TERM4          =  5,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    53
	TERM5          =  6,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    54
	TERM6          =  7,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    55
	HELIPAD1       =  8,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4171
diff changeset
    56
	HELIPAD2       =  9,
4059
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    57
	TAKEOFF        = 10,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    58
	STARTTAKEOFF   = 11,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    59
	ENDTAKEOFF     = 12,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    60
	HELITAKEOFF    = 13,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    61
	FLYING         = 14,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    62
	LANDING        = 15,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    63
	ENDLANDING     = 16,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    64
	HELILANDING    = 17,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    65
	HELIENDLANDING = 18,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    66
	TERM7          = 19,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    67
	TERM8          = 20,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    68
	HELIPAD3       = 21,
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    69
	HELIPAD4       = 22
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    70
};
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    71
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
    72
/* Movement Blocks on Airports */
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
    73
/* blocks (eg_airport_flags) */
6321
62564548351b (svn r8705) -Codechange: Increased the number of airport blocks to 64. This involves changing the enum of airport blocks to a static const uint64 as SOME platforms do not support 64-bit enums
celestar
parents: 6189
diff changeset
    74
static const uint64
7644
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    75
	TERM1_block              = 1ULL <<  0,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    76
	TERM2_block              = 1ULL <<  1,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    77
	TERM3_block              = 1ULL <<  2,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    78
	TERM4_block              = 1ULL <<  3,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    79
	TERM5_block              = 1ULL <<  4,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    80
	TERM6_block              = 1ULL <<  5,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    81
	HELIPAD1_block           = 1ULL <<  6,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    82
	HELIPAD2_block           = 1ULL <<  7,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    83
	RUNWAY_IN_OUT_block      = 1ULL <<  8,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    84
	RUNWAY_IN_block          = 1ULL <<  8,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    85
	AIRPORT_BUSY_block       = 1ULL <<  8,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    86
	RUNWAY_OUT_block         = 1ULL <<  9,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    87
	TAXIWAY_BUSY_block       = 1ULL << 10,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    88
	OUT_WAY_block            = 1ULL << 11,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    89
	IN_WAY_block             = 1ULL << 12,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    90
	AIRPORT_ENTRANCE_block   = 1ULL << 13,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    91
	TERM_GROUP1_block        = 1ULL << 14,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    92
	TERM_GROUP2_block        = 1ULL << 15,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    93
	HANGAR2_AREA_block       = 1ULL << 16,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    94
	TERM_GROUP2_ENTER1_block = 1ULL << 17,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    95
	TERM_GROUP2_ENTER2_block = 1ULL << 18,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    96
	TERM_GROUP2_EXIT1_block  = 1ULL << 19,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    97
	TERM_GROUP2_EXIT2_block  = 1ULL << 20,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
    98
	PRE_HELIPAD_block        = 1ULL << 21,
4059
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
    99
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   100
/* blocks for new airports */
7644
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   101
	TERM7_block              = 1ULL << 22,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   102
	TERM8_block              = 1ULL << 23,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   103
	TERM9_block              = 1ULL << 24,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   104
	HELIPAD3_block           = 1ULL << 24,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   105
	TERM10_block             = 1ULL << 25,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   106
	HELIPAD4_block           = 1ULL << 25,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   107
	HANGAR1_AREA_block       = 1ULL << 26,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   108
	OUT_WAY2_block           = 1ULL << 27,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   109
	IN_WAY2_block            = 1ULL << 28,
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   110
	RUNWAY_IN2_block         = 1ULL << 29,
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   111
	RUNWAY_OUT2_block        = 1ULL << 10,   ///< note re-uses TAXIWAY_BUSY
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   112
	HELIPAD_GROUP_block      = 1ULL << 13,   ///< note re-uses AIRPORT_ENTRANCE
7644
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   113
	OUT_WAY_block2           = 1ULL << 31,
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   114
/* end of new blocks */
4059
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3876
diff changeset
   115
7644
3e6b33796055 (svn r10422) -Fix: VC8 Code Analyzer warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
KUDr
parents: 6890
diff changeset
   116
	NOTHING_block            = 1ULL << 30;
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
   117
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   118
struct AirportMovingData {
6189
2b1ae5e373e9 (svn r8582) -Fix
tron
parents: 6183
diff changeset
   119
	int16 x;
2b1ae5e373e9 (svn r8582) -Fix
tron
parents: 6183
diff changeset
   120
	int16 y;
6519
367d6f96e23f (svn r8973) -Feature/Codechange: Changed the internal unit for aircraft velocities to from 8mph to 1km/h (peter1138), also give aircraft realsitic velocities (so that 1km/h is 1km/h independent of vehicle type) (peter1138). Introduce a flag to reduce aircraft speed in holding patterns to some realistic velocity. Use this flag for the city airport for the time being and make use of the different entry points for this airport type.
celestar
parents: 6443
diff changeset
   121
	uint16 flag;
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   122
	DirectionByte direction;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   123
};
3701
13911c5df3e7 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere.
peter1138
parents: 3697
diff changeset
   124
6183
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   125
struct AirportFTAbuildup;
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   126
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   127
/** Finite sTate mAchine --> FTA */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   128
struct AirportFTAClass {
6175
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   129
	public:
6350
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   130
		enum Flags {
6353
75b086ef8ef1 (svn r8750) -Fix (r8747): PLANES defined in wingdi.h caused compilation error under Win32. Changed to AIRPLANES
KUDr
parents: 6351
diff changeset
   131
			AIRPLANES   = 0x1,
6350
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   132
			HELICOPTERS = 0x2,
6353
75b086ef8ef1 (svn r8750) -Fix (r8747): PLANES defined in wingdi.h caused compilation error under Win32. Changed to AIRPLANES
KUDr
parents: 6351
diff changeset
   133
			ALL         = AIRPLANES | HELICOPTERS,
6351
afb1e3960181 (svn r8748) -Fix
tron
parents: 6350
diff changeset
   134
			SHORT_STRIP = 0x4
6350
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   135
		};
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   136
6183
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   137
		AirportFTAClass(
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   138
			const AirportMovingData *moving_data,
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   139
			const byte *terminals,
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   140
			const byte *helipads,
6362
f4de72f0abea (svn r8759) -Feature: Allow airports to have up to 4 entry points depending on approach direction. Note: they're not yet used, but will be soon
celestar
parents: 6353
diff changeset
   141
			const byte *entry_points,
6350
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   142
			Flags flags,
6183
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   143
			const AirportFTAbuildup *apFA,
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   144
			const TileIndexDiffC *depots,
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   145
			byte nof_depots,
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   146
			uint size_x,
6346
4aad704385e1 (svn r8743) -Fix
tron
parents: 6337
diff changeset
   147
			uint size_y,
10682
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   148
			uint8 noise_level,
6367
2f569d554980 (svn r8767) -Fix
tron
parents: 6362
diff changeset
   149
			byte delta_z,
2f569d554980 (svn r8767) -Fix
tron
parents: 6362
diff changeset
   150
			byte catchment
6183
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   151
		);
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   152
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   153
		~AirportFTAClass();
5d864a25ae2b (svn r8570) -Fix
tron
parents: 6175
diff changeset
   154
6175
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   155
		const AirportMovingData *MovingData(byte position) const
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   156
		{
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   157
			assert(position < nofelements);
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   158
			return &moving_data[position];
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   159
		}
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   160
26674ca57aac (svn r8559) -Fix
tron
parents: 6005
diff changeset
   161
	const AirportMovingData *moving_data;
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   162
	struct AirportFTA *layout;            ///< state machine for airport
950
1f6546ea35a3 (svn r1440) -Feature: Allows more flexible airport layouts now, as the number of
celestar
parents: 909
diff changeset
   163
	const byte *terminals;
1f6546ea35a3 (svn r1440) -Feature: Allows more flexible airport layouts now, as the number of
celestar
parents: 909
diff changeset
   164
	const byte *helipads;
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   165
	const TileIndexDiffC *airport_depots; ///< gives the position of the depots on the airports
6350
c644e180cdf8 (svn r8747) -Fix
tron
parents: 6346
diff changeset
   166
	Flags flags;
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   167
	byte nof_depots;                      ///< number of depots this airport has
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   168
	byte nofelements;                     ///< number of positions the airport consists of
6362
f4de72f0abea (svn r8759) -Feature: Allow airports to have up to 4 entry points depending on approach direction. Note: they're not yet used, but will be soon
celestar
parents: 6353
diff changeset
   169
	const byte *entry_points;             ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction
3876
c0d426e78b56 (svn r4918) Move the information about the size of airports from an global array into the struct which describes an airport
tron
parents: 3701
diff changeset
   170
	byte size_x;
c0d426e78b56 (svn r4918) Move the information about the size of airports from an global array into the struct which describes an airport
tron
parents: 3701
diff changeset
   171
	byte size_y;
10682
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   172
	uint8 noise_level;                    ///< noise that this airport generates
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   173
	byte delta_z;                         ///< Z adjustment for helicopter pads
6367
2f569d554980 (svn r8767) -Fix
tron
parents: 6362
diff changeset
   174
	byte catchment;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   175
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
6351
afb1e3960181 (svn r8748) -Fix
tron
parents: 6350
diff changeset
   177
DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
afb1e3960181 (svn r8748) -Fix
tron
parents: 6350
diff changeset
   178
afb1e3960181 (svn r8748) -Fix
tron
parents: 6350
diff changeset
   179
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   180
/** internal structure used in openttd - Finite sTate mAchine --> FTA */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   181
struct AirportFTA {
10131
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   182
	AirportFTA *next;        ///< possible extra movement choices from this position
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   183
	uint64 block;            ///< 64 bit blocks (st->airport_flags), should be enough for the most complex airports
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   184
	byte position;           ///< the position that an airplane is at
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   185
	byte next_position;      ///< next position from this position
eac377878aa0 (svn r12662) -Codechange: Comment-code style application
belugas
parents: 8635
diff changeset
   186
	byte heading;            ///< heading (current orders), guiding an airplane to its target on an airport
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   187
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6519
diff changeset
   189
void InitializeAirports();
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6519
diff changeset
   190
void UnInitializeAirports();
4171
3fadda3afe70 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4059
diff changeset
   191
const AirportFTAClass *GetAirport(const byte airport_type);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
1784
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   193
/** Get buildable airport bitmask.
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   194
 * @return get all buildable airports at this given time, bitmasked.
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   195
 * Bit 0 means the small airport is buildable, etc.
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   196
 * @todo set availability of airports by year, instead of airplane
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   197
 */
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6519
diff changeset
   198
uint32 GetValidAirports();
1784
6eb3ab1bc33c (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
Darkvater
parents: 1093
diff changeset
   199
10682
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   200
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   201
/* Calculate the noise this type airport will generate */
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   202
uint8 GetAirportNoiseLevelForTown(const AirportFTAClass *afc, TileIndex town_tile, TileIndex tile);
3b753d908205 (svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
belugas
parents: 10131
diff changeset
   203
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   204
#endif /* AIRPORT_H */