Mercurial > hg > openttd
annotate src/aircraft.h @ 10831:31f766ee053b draft
(svn r15166) -Codechange: reduce number of includes in afterload.cpp
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 20 Jan 2009 13:56:35 +0000 |
parents | 92ff04e7b1d9 |
children | ba2eab4caf4a |
rev | line source |
---|---|
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
2 |
9111
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
9070
diff
changeset
|
3 /** @file aircraft.h Base for aircraft. */ |
6117
6def6ecb1bf7
(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 <belugas@openttd.org>
parents:
6087
diff
changeset
|
4 |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
5 #ifndef AIRCRAFT_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
6 #define AIRCRAFT_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
7 |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
8 #include "station_map.h" |
8785
2a8950a812dc
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
rubidium <rubidium@openttd.org>
parents:
8467
diff
changeset
|
9 #include "station_base.h" |
8144
d18c8a0bb638
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium <rubidium@openttd.org>
parents:
7683
diff
changeset
|
10 #include "vehicle_base.h" |
8786
e2d4956b7251
(svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h.
rubidium <rubidium@openttd.org>
parents:
8785
diff
changeset
|
11 #include "engine_func.h" |
9070
11b5b3f4175d
(svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138 <peter1138@openttd.org>
parents:
9043
diff
changeset
|
12 #include "engine_base.h" |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
13 |
6415
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
14 /** An aircraft can be one ot those types */ |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6245
diff
changeset
|
15 enum AircraftSubType { |
6409
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
16 AIR_HELICOPTER = 0, ///< an helicopter |
6410
85277fb4f956
(svn r9546) -Fix (r9545): several typos...
rubidium <rubidium@openttd.org>
parents:
6409
diff
changeset
|
17 AIR_AIRCRAFT = 2, ///< an airplane |
6409
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
18 AIR_SHADOW = 4, ///< shadow of the aircraft |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
19 AIR_ROTOR = 6 ///< rotor of an helicopter |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6245
diff
changeset
|
20 }; |
5854
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
21 |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
22 |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
23 /** Check if the aircraft type is a normal flying device; eg |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
24 * not a rotor or a shadow |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
25 * @param v vehicle to check |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
26 * @return Returns true if the aircraft is a helicopter/airplane and |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
27 * false if it is a shadow or a rotor) */ |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
28 static inline bool IsNormalAircraft(const Vehicle *v) |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
29 { |
6259
4a39d6291d58
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium <rubidium@openttd.org>
parents:
6248
diff
changeset
|
30 assert(v->type == VEH_AIRCRAFT); |
5854
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
31 /* To be fully correct the commented out functionality is the proper one, |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
32 * but since value can only be 0 or 2, it is sufficient to only check <= 2 |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
33 * return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */ |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
34 return v->subtype <= AIR_AIRCRAFT; |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
35 } |
b52317eb405c
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Darkvater <Darkvater@openttd.org>
parents:
5780
diff
changeset
|
36 |
6409
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
37 /** |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
38 * Calculates cargo capacity based on an aircraft's passenger |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
39 * and mail capacities. |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
40 * @param cid Which cargo type to calculate a capacity for. |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
41 * @param avi Which engine to find a cargo capacity for. |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
42 * @return New cargo capacity value. |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
43 */ |
6410
85277fb4f956
(svn r9546) -Fix (r9545): several typos...
rubidium <rubidium@openttd.org>
parents:
6409
diff
changeset
|
44 uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
45 |
6415
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
46 /** |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
47 * This is the Callback method after the construction attempt of an aircraft |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
48 * @param success indicates completion (or not) of the operation |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
49 * @param tile of depot where aircraft is built |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
50 * @param p1 unused |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
51 * @param p2 unused |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
52 */ |
5780
10c1b221d4bc
(svn r8332) -Codechange: moved DrawAircraftImage() and CcBuildAircraft() from build_vehicle_gui.cpp to aircraft_gui.cpp
bjarni <bjarni@openttd.org>
parents:
5475
diff
changeset
|
53 void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); |
6415
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
54 |
6409
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
55 /** Handle Aircraft specific tasks when a an Aircraft enters a hangar |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
56 * @param *v Vehicle that enters the hangar |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
57 */ |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
58 void HandleAircraftEnterHangar(Vehicle *v); |
6409
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
59 |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
60 /** Get the size of the sprite of an aircraft sprite heading west (used for lists) |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
61 * @param engine The engine to get the sprite from |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
62 * @param width The width of the sprite |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
63 * @param height The height of the sprite |
62feeb92d86d
(svn r9545) -Documentation: Some corrections to previous doxygen work
belugas <belugas@openttd.org>
parents:
6259
diff
changeset
|
64 */ |
5972
6ece78140826
(svn r8661) -Fix: [depot windows] Enlarge the blocks in the depot window if a sprite is too big to fit (ships and aircraft only)
bjarni <bjarni@openttd.org>
parents:
5854
diff
changeset
|
65 void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height); |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
66 |
6415
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
67 /** |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
68 * Updates the status of the Aircraft heading or in the station |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
69 * @param st Station been updated |
c2c9492ad5f1
(svn r9551) -Documentation: Some more doxygen work
belugas <belugas@openttd.org>
parents:
6410
diff
changeset
|
70 */ |
6087 | 71 void UpdateAirplanesOnNewStation(const Station *st); |
72 | |
6490
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
73 /** Update cached values of an aircraft. |
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
74 * Currently caches callback 36 max speed. |
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
75 * @param v Vehicle |
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
76 */ |
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
77 void UpdateAircraftCache(Vehicle *v); |
fcc1843c68c6
(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.
peter1138 <peter1138@openttd.org>
parents:
6415
diff
changeset
|
78 |
10571
b6779abf2e96
(svn r14828) -Codechange: move most of save/load-specific code to separate files
smatz <smatz@openttd.org>
parents:
10154
diff
changeset
|
79 void AircraftLeaveHangar(Vehicle *v); |
b6779abf2e96
(svn r14828) -Codechange: move most of save/load-specific code to separate files
smatz <smatz@openttd.org>
parents:
10154
diff
changeset
|
80 void AircraftNextAirportPos_and_Order(Vehicle *v); |
b6779abf2e96
(svn r14828) -Codechange: move most of save/load-specific code to separate files
smatz <smatz@openttd.org>
parents:
10154
diff
changeset
|
81 void SetAircraftPosition(Vehicle *v, int x, int y, int z); |
b6779abf2e96
(svn r14828) -Codechange: move most of save/load-specific code to separate files
smatz <smatz@openttd.org>
parents:
10154
diff
changeset
|
82 byte GetAircraftFlyingAltitude(const Vehicle *v); |
b6779abf2e96
(svn r14828) -Codechange: move most of save/load-specific code to separate files
smatz <smatz@openttd.org>
parents:
10154
diff
changeset
|
83 |
6552
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
84 /** |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
85 * This class 'wraps' Vehicle; you do not actually instantiate this class. |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
86 * You create a Vehicle using AllocateVehicle, so it is added to the pool |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
87 * and you reinitialize that to a Train using: |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
88 * v = new (v) Aircraft(); |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
89 * |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
90 * As side-effect the vehicle type is set correctly. |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
91 */ |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
92 struct Aircraft : public Vehicle { |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
93 /** Initializes the Vehicle to an aircraft */ |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
94 Aircraft() { this->type = VEH_AIRCRAFT; } |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
95 |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
96 /** We want to 'destruct' the right class. */ |
7412
6682e85ffa07
(svn r10798) -Fix [FS#1105]: virtual functions do not work in destructors :(.
rubidium <rubidium@openttd.org>
parents:
7318
diff
changeset
|
97 virtual ~Aircraft() { this->PreDestructor(); } |
6552
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
98 |
6563
be38c076b3a5
(svn r9765) -Codechange: constify some class functions.
rubidium <rubidium@openttd.org>
parents:
6562
diff
changeset
|
99 const char *GetTypeString() const { return "aircraft"; } |
6553
733ef9947fe2
(svn r9755) -Codechange: refactor some more of the begin loading stuff.
rubidium <rubidium@openttd.org>
parents:
6552
diff
changeset
|
100 void MarkDirty(); |
6558
2fc024ee8217
(svn r9760) -Codechange: remove the need for saving some vehicle variables.
rubidium <rubidium@openttd.org>
parents:
6553
diff
changeset
|
101 void UpdateDeltaXY(Direction direction); |
6563
be38c076b3a5
(svn r9765) -Codechange: constify some class functions.
rubidium <rubidium@openttd.org>
parents:
6562
diff
changeset
|
102 ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_AIRCRAFT_INC : EXPENSES_AIRCRAFT_RUN; } |
6773
746c984c2dfe
(svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type.
maedhros <maedhros@openttd.org>
parents:
6563
diff
changeset
|
103 bool IsPrimaryVehicle() const { return IsNormalAircraft(this); } |
9022
db43607c4798
(svn r12824) -Codechange: Standardise routines for drawing vehicle images, using correct types and less duplication.
peter1138 <peter1138@openttd.org>
parents:
8890
diff
changeset
|
104 SpriteID GetImage(Direction direction) const; |
7477
cd1270f71957
(svn r10984) -Codechange: unify the way one can get the current speed in the same forwat so we can display it.
rubidium <rubidium@openttd.org>
parents:
7412
diff
changeset
|
105 int GetDisplaySpeed() const { return this->cur_speed * 10 / 16; } |
7484
f0e36dc81ff4
(svn r10995) -Codechange: unify the way to get the displayed maxium speed of a vehicle. Patch by nycom.
rubidium <rubidium@openttd.org>
parents:
7478
diff
changeset
|
106 int GetDisplayMaxSpeed() const { return this->max_speed * 10 / 16; } |
7488
307a03e3f031
(svn r10999) -Codechange: unify the way the running cost of a vehicle is determined. Patch by nycom.
rubidium <rubidium@openttd.org>
parents:
7484
diff
changeset
|
107 Money GetRunningCost() const { return AircraftVehInfo(this->engine_type)->running_cost * _price.aircraft_running; } |
7490
f538c635385c
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
rubidium <rubidium@openttd.org>
parents:
7488
diff
changeset
|
108 bool IsInDepot() const { return (this->vehstatus & VS_HIDDEN) != 0 && IsHangarTile(this->tile); } |
7135
45123abbc930
(svn r10409) -Codechange: replace (Aircraft|RoadVeh|Ship|Train)_Tick with a Tick method in the Vehicle class.
rubidium <rubidium@openttd.org>
parents:
7134
diff
changeset
|
109 void Tick(); |
8467
284a76aa2868
(svn r12037) -Codechange: replace OnNewDay_(Aircraft|RoadVeh|Ship|Train) with an OnNewDay method in the Vehicle class
glx <glx@openttd.org>
parents:
8211
diff
changeset
|
110 void OnNewDay(); |
8830
981a95f3204d
(svn r12578) -Codechange: merge the aircrafts ProcessOrder too into the 'unified' ProcessOrder.
rubidium <rubidium@openttd.org>
parents:
8786
diff
changeset
|
111 TileIndex GetOrderStationLocation(StationID station); |
8890
b1d45af72e04
(svn r12657) -Codechange: add 'FindClosestDepot' to the vehicle class.
rubidium <rubidium@openttd.org>
parents:
8830
diff
changeset
|
112 bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse); |
6552
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
113 }; |
eccb53db55f0
(svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches.
rubidium <rubidium@openttd.org>
parents:
6490
diff
changeset
|
114 |
10154
9648ad6039a9
(svn r14343) -Fix [FS#2300]: invalid v->u.air.targetairport could cause crashes at several places when the station pool got smaller
smatz <smatz@openttd.org>
parents:
9111
diff
changeset
|
115 Station *GetTargetAirportIfValid(const Vehicle *v); |
9648ad6039a9
(svn r14343) -Fix [FS#2300]: invalid v->u.air.targetairport could cause crashes at several places when the station pool got smaller
smatz <smatz@openttd.org>
parents:
9111
diff
changeset
|
116 |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
117 #endif /* AIRCRAFT_H */ |