#include <aircraft.h>
Inheritance diagram for Aircraft:

Public Member Functions | |
| Aircraft () | |
| Initializes the Vehicle to an aircraft. | |
| virtual | ~Aircraft () |
| We want to 'destruct' the right class. | |
| const char * | GetTypeString () const |
| Get a string 'representation' of the vehicle type. | |
| void | MarkDirty () |
| Marks the vehicles to be redrawn and updates cached variables. | |
| void | UpdateDeltaXY (Direction direction) |
| Updates the x and y offsets and the size of the sprite used for this vehicle. | |
| ExpensesType | GetExpenseType (bool income) const |
| Sets the expense type associated to this vehicle type. | |
| bool | IsPrimaryVehicle () const |
| Whether this is the primary vehicle in the chain. | |
| SpriteID | GetImage (Direction direction) const |
| Gets the sprite to show for the given direction. | |
| int | GetDisplaySpeed () const |
| Gets the speed in mph that can be sent into SetDParam for string processing. | |
| int | GetDisplayMaxSpeed () const |
| Gets the maximum speed in mph that can be sent into SetDParam for string processing. | |
| Money | GetRunningCost () const |
| Gets the running cost of a vehicle. | |
| bool | IsInDepot () const |
| Check whether the vehicle is in the depot. | |
| void | Tick () |
| Calls the tick handler of the vehicle. | |
| void | OnNewDay () |
| Calls the new day handler of the vehicle. | |
| TileIndex | GetOrderStationLocation (StationID station) |
| Determine the location for the station where the vehicle goes to next. | |
| bool | FindClosestDepot (TileIndex *location, DestinationID *destination, bool *reverse) |
| Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse. | |
You create a Vehicle using AllocateVehicle, so it is added to the pool and you reinitialize that to a Train using: v = new (v) Aircraft();
As side-effect the vehicle type is set correctly.
Definition at line 110 of file aircraft.h.
| bool Aircraft::FindClosestDepot | ( | TileIndex * | location, | |
| DestinationID * | destination, | |||
| bool * | reverse | |||
| ) | [virtual] |
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should reverse.
| location | where do we go to? | |
| destination | what hangar do we go to? | |
| reverse | should the vehicle be reversed? |
Reimplemented from Vehicle.
Definition at line 499 of file aircraft_cmd.cpp.
References Station::Airport(), Station::airport_tile, FindNearestHangar(), PoolItem< T, Tid, Tpool >::index, INVALID_STATION, Station::IsValid(), AirportFTAClass::nof_depots, and Station::xy.
| int Aircraft::GetDisplayMaxSpeed | ( | ) | const [inline, virtual] |
Gets the maximum speed in mph that can be sent into SetDParam for string processing.
Reimplemented from Vehicle.
Definition at line 124 of file aircraft.h.
References Vehicle::max_speed.
| int Aircraft::GetDisplaySpeed | ( | ) | const [inline, virtual] |
Gets the speed in mph that can be sent into SetDParam for string processing.
Reimplemented from Vehicle.
Definition at line 123 of file aircraft.h.
References Vehicle::cur_speed.
| ExpensesType Aircraft::GetExpenseType | ( | bool | income | ) | const [inline, virtual] |
Sets the expense type associated to this vehicle type.
| income | whether this is income or (running) expenses of the vehicle |
Reimplemented from Vehicle.
Definition at line 120 of file aircraft.h.
Gets the sprite to show for the given direction.
| direction | the direction the vehicle is facing |
Reimplemented from Vehicle.
Definition at line 163 of file aircraft_cmd.cpp.
References _aircraft_sprite, GetCustomVehicleSprite, is_custom_sprite, and Vehicle::spritenum.
Referenced by MarkDirty().
Determine the location for the station where the vehicle goes to next.
Things done for example are allocating slots in a road stop or exact location of the platform is determined for ships.
| station | the station to make the next location of the vehicle. |
Reimplemented from Vehicle.
Definition at line 1314 of file aircraft_cmd.cpp.
References AircraftNextAirportPos_and_Order().
| Money Aircraft::GetRunningCost | ( | ) | const [inline, virtual] |
Gets the running cost of a vehicle.
Reimplemented from Vehicle.
Definition at line 125 of file aircraft.h.
References _price, Prices::aircraft_running, AircraftVehInfo(), and AircraftVehicleInfo::running_cost.
| const char* Aircraft::GetTypeString | ( | ) | const [inline, virtual] |
Get a string 'representation' of the vehicle type.
Reimplemented from Vehicle.
Definition at line 117 of file aircraft.h.
| bool Aircraft::IsInDepot | ( | ) | const [inline, virtual] |
Check whether the vehicle is in the depot.
Reimplemented from Vehicle.
Definition at line 126 of file aircraft.h.
References IsHangarTile().
| void Aircraft::MarkDirty | ( | ) | [virtual] |
Marks the vehicles to be redrawn and updates cached variables.
This method marks the area of the vehicle on the screen as dirty. It can be use to repaint the vehicle.
Reimplemented from Vehicle.
Definition at line 1325 of file aircraft_cmd.cpp.
References AIR_HELICOPTER, Vehicle::cur_image, GetImage(), GetRotorImage(), MarkSingleVehicleDirty(), and Vehicle::Next().
| void Aircraft::UpdateDeltaXY | ( | Direction | direction | ) | [virtual] |
Updates the x and y offsets and the size of the sprite used for this vehicle.
| direction | the direction the vehicle is facing |
Reimplemented from Vehicle.
Definition at line 44 of file aircraft_cmd.cpp.
References AIR_AIRCRAFT, AIR_HELICOPTER, AIR_ROTOR, AIR_SHADOW, GB(), NOT_REACHED, x, Vehicle::x_extent, Vehicle::x_offs, Vehicle::y_extent, Vehicle::y_offs, and Vehicle::z_extent.
1.4.7