63 int GetAircraftFlightLevel(T *v,
bool takeoff =
false);
99 int GetSpeedOldUnits()
const {
return this->vcache.cached_max_speed * 10 / 128; }
101 Money GetRunningCost()
const;
105 assert(this->IsPrimaryVehicle());
111 uint Crash(
bool flooded =
false);
112 TileIndex GetOrderStationLocation(StationID station);
113 bool FindClosestDepot(
TileIndex *location, DestinationID *destination,
bool *reverse);
142 #define FOR_ALL_AIRCRAFT(var) FOR_ALL_VEHICLES_OF_TYPE(Aircraft, var) byte number_consecutive_turns
Protection to prevent the aircraft of making a lot of turns in order to reach a specific point...
StationID targetairport
Airport to go to next.
Maps accessors for stations.
void AircraftLeaveHangar(Aircraft *v, Direction exit_dir)
Aircraft is about to leave the hangar.
Minimum flying altitude above tile.
void HandleAircraftEnterHangar(Aircraft *v)
Handle Aircraft specific tasks when an Aircraft enters a hangar.
byte pos
Next desired position of the aircraft.
static const int ROTOR_Z_OFFSET
Z Offset between helicopter- and rotorsprite.
Aircraft, helicopters, rotors and their shadows belong to this class.
int GetCurrentMaxSpeed() const
Calculates the maximum speed of the vehicle under its current conditions.
The vehicle is currently raising its altitude because it hit the lower bound.
void AircraftNextAirportPos_and_Order(Aircraft *v)
set the right pos when heading to other airports after takeoff
void GetAircraftFlightLevelBounds(const Vehicle *v, int *min, int *max)
Get the 'flight level' bounds, in pixels from 'z_pos' 0 for a particular vehicle for normal flight si...
holding flying altitude above tile of planes.
static T max(const T a, const T b)
Returns the maximum of two values.
EngineImageType
Visualisation contexts of vehicles and engines.
bool IsNormalAircraft() const
Check if the aircraft type is a normal flying device; eg not a rotor or a shadow. ...
Direction
Defines the 8 directions on the map.
holding flying altitude above tile of helicopters.
Class defining several overloaded accessors so we don't have to cast vehicle types that often...
ExpensesType GetExpenseType(bool income) const
Sets the expense type associated to this vehicle type.
void UpdateAircraftCache(Aircraft *v, bool update_range=false)
Update cached values of an aircraft.
Station * GetTargetAirportIfValid(const Aircraft *v)
Returns aircraft's target station if v->target_airport is a valid station with airport.
void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type)
Get the size of the sprite of an aircraft sprite heading west (used for lists).
uint16 GetRange() const
Get the range of this aircraft.
The vehicle is currently lowering its altitude because it hit the upper bound.
ExpensesType
Types of expenses.
Sprite sequence for a vehicle part.
static T min(const T a, const T b)
Returns the minimum of two values.
byte previous_pos
Previous desired position of the aircraft.
byte state
State of the airport.
byte turn_counter
Ticks between each turn to prevent > 45 degree turns.
int GetDisplayMaxSpeed() const
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
bool IsPrimaryVehicle() const
Whether this is the primary vehicle in the chain.
Variables that are cached to improve performance and such.
AirVehicleFlags
Flags for air vehicles; shared with disaster vehicles.
static void OnNewDay()
Runs various procedures that have to be done daily.
Maximum flying altitude above tile.
AircraftFlyingAltitude
Base values for flight levels above ground level for 'normal' flight and holding patterns.
void SetAircraftPosition(Aircraft *v, int x, int y, int z)
Set aircraft position.
uint16 cached_max_range
Cached maximum range.
Base class for all vehicles.
uint16 EngineID
Unique identification number of an engine.
uint32 TileIndex
The index/ID of a Tile.
Next destination is too far away.
uint32 cached_max_range_sqr
Cached squared maximum range.
bool IsInDepot() const
Check whether the vehicle is in the depot.
static bool IsHangarTile(TileIndex t)
Is tile t an hangar tile?
AircraftSubType
An aircraft can be one of those types.
void UpdateAirplanesOnNewStation(const Station *st)
Updates the status of the Aircraft heading or in the station.
byte flags
Aircraft flags.
uint16 crashed_counter
Timer for handling crash animations.
virtual ~Aircraft()
We want to 'destruct' the right class.
Aircraft()
We don't want GCC to zero our struct! It already is zeroed and has an index!
int GetDisplaySpeed() const
Gets the speed in km-ish/h that can be sent into SetDParam for string processing. ...