OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
63 int GetAircraftFlightLevel(T *v,
bool takeoff =
false);
109 bool Tick()
override;
112 uint
Crash(
bool flooded =
false)
override;
113 TileIndex GetOrderStationLocation(StationID station)
override;
144 void HandleMissingAircraftOrders(
Aircraft *v);
StationID targetairport
Airport to go to next.
Aircraft()
We don't want GCC to zero our struct! It already is zeroed and has an index!
void AircraftNextAirportPos_and_Order(Aircraft *v)
set the right pos when heading to other airports after takeoff
void PreDestructor()
Destroy all stuff that (still) needs the virtual functions to work properly.
AircraftSubType
An aircraft can be one of those types.
virtual ~Aircraft()
We want to 'destruct' the right class.
void UpdateAirplanesOnNewStation(const Station *st)
Updates the status of the Aircraft heading or in the station.
@ PLANE_HOLD_MAX_FLYING_ALTITUDE
holding flying altitude above tile of planes.
int GetDisplaySpeed() const override
Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
uint16_t cached_max_range
Cached maximum range.
int GetCurrentMaxSpeed() const override
Calculates the maximum speed of the vehicle under its current conditions.
@ VAF_IN_MAX_HEIGHT_CORRECTION
The vehicle is currently lowering its altitude because it hit the upper bound.
void AircraftLeaveHangar(Aircraft *v, Direction exit_dir)
Aircraft is about to leave the hangar.
ClosestDepot FindClosestDepot() override
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should...
EngineImageType
Visualisation contexts of vehicles and engines.
@ AIR_AIRCRAFT
an airplane
Station * GetTargetAirportIfValid(const Aircraft *v)
Returns aircraft's target station if v->target_airport is a valid station with airport.
@ AIR_SHADOW
shadow of the aircraft
Variables that are cached to improve performance and such.
void HandleAircraftEnterHangar(Aircraft *v)
Handle Aircraft specific tasks when an Aircraft enters a hangar.
Money GetRunningCost() const override
Gets the running cost of a vehicle.
Aircraft, helicopters, rotors and their shadows belong to this class.
uint16_t cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
uint16_t crashed_counter
Timer for handling crash animations.
@ VS_HIDDEN
Vehicle is not visible.
@ AIRCRAFT_MAX_FLYING_ALTITUDE
Maximum flying altitude above tile.
@ VAF_HELI_DIRECT_DESCENT
The helicopter is descending directly at its destination (helipad or in front of hangar)
uint8_t flags
Aircraft flags.
TileIndex tile
Current tile index.
@ EXPENSES_AIRCRAFT_RUN
Running costs aircraft.
uint8_t pos
Next desired position of the aircraft.
Sprite sequence for a vehicle part.
int GetDisplayMaxSpeed() const override
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Class defining several overloaded accessors so we don't have to cast vehicle types that often.
uint16_t cur_speed
current speed
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...
void SetAircraftPosition(Aircraft *v, int x, int y, int z)
Set aircraft position.
AirVehicleFlags
Flags for air vehicles; shared with disaster vehicles.
@ VAF_IN_MIN_HEIGHT_CORRECTION
The vehicle is currently raising its altitude because it hit the lower bound.
uint8_t previous_pos
Previous desired position of the aircraft.
bool IsInDepot() const override
Check whether the vehicle is in the depot.
void OnNewCalendarDay() override
Calendar day handler.
uint8_t number_consecutive_turns
Protection to prevent the aircraft of making a lot of turns in order to reach a specific point.
Direction direction
facing
void UpdateAircraftCache(Aircraft *v, bool update_range=false)
Update cached values of an aircraft.
uint8_t subtype
subtype (Filled with values from AircraftSubType/DisasterSubType/EffectVehicleType/GroundVehicleSubty...
@ VAF_DEST_TOO_FAR
Next destination is too far away.
VehicleCache vcache
Cache of often used vehicle values.
@ EXPENSES_AIRCRAFT_REVENUE
Revenue from aircraft.
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).
@ HELICOPTER_HOLD_MAX_FLYING_ALTITUDE
holding flying altitude above tile of helicopters.
uint32_t cached_max_range_sqr
Cached squared maximum range.
uint8_t state
State of the airport.
uint16_t GetRange() const
Get the range of this aircraft.
@ AIR_HELICOPTER
an helicopter
bool IsNormalAircraft() const
Check if the aircraft type is a normal flying device; eg not a rotor or a shadow.
void OnNewEconomyDay() override
Economy day handler.
ExpensesType
Types of expenses.
uint8_t turn_counter
Ticks between each turn to prevent > 45 degree turns.
Direction
Defines the 8 directions on the map.
Structure to return information about the closest depot location, and whether it could be found.
bool IsPrimaryVehicle() const override
Whether this is the primary vehicle in the chain.
AircraftFlyingAltitude
Base values for flight levels above ground level for 'normal' flight and holding patterns.
uint Crash(bool flooded=false) override
Crash the (whole) vehicle chain.
uint16_t EngineID
Unique identification number of an engine.
Aircraft * First() const
Get the first vehicle in the chain.
bool Tick() override
Calls the tick handler of the vehicle.
void UpdateDeltaXY() override
Updates the x and y offsets and the size of the sprite used for this vehicle.
void MarkDirty() override
Marks the vehicles to be redrawn and updates cached variables.
@ AIRCRAFT_MIN_FLYING_ALTITUDE
Minimum flying altitude above tile.
@ AIR_ROTOR
rotor of an helicopter
bool IsHangarTile(Tile t)
Is tile t an hangar tile?
static const int ROTOR_Z_OFFSET
Z Offset between helicopter- and rotorsprite.