|
OpenTTD Source 15.0-beta1
|
Cached, frequently calculated values. More...
#include <ground_vehicle.hpp>
Public Member Functions | |
| auto | operator<=> (const GroundVehicleCache &) const =default |
Data Fields | |
| uint32_t | cached_weight |
| Total weight of the consist (valid only for the first engine). | |
| uint32_t | cached_slope_resistance |
| Resistance caused by weight when this vehicle part is at a slope. | |
| uint32_t | cached_max_te |
| Maximum tractive effort of consist (valid only for the first engine). | |
| uint16_t | cached_axle_resistance |
| Resistance caused by the axles of the vehicle (valid only for the first engine). | |
| uint16_t | cached_max_track_speed |
| Maximum consist speed (in internal units) limited by track type (valid only for the first engine). | |
| uint32_t | cached_power |
| Total power of the consist (valid only for the first engine). | |
| uint32_t | cached_air_drag |
| Air drag coefficient of the vehicle (valid only for the first engine). | |
| uint16_t | cached_total_length |
| Length of the whole vehicle (valid only for the first engine). | |
| EngineID | first_engine |
| Cached EngineID of the front vehicle. INVALID_ENGINE for the front vehicle itself. | |
| uint8_t | cached_veh_length |
| Length of this vehicle in units of 1/VEHICLE_LENGTH of normal length. It is cached because this can be set by a callback. | |
| uint16_t | last_speed |
| The last speed we did display, so we only have to redraw when this changes. | |
Cached, frequently calculated values.
All of these values except cached_slope_resistance are set only for the first part of a vehicle.
Definition at line 30 of file ground_vehicle.hpp.
| uint32_t GroundVehicleCache::cached_air_drag |
Air drag coefficient of the vehicle (valid only for the first engine).
Definition at line 40 of file ground_vehicle.hpp.
| uint16_t GroundVehicleCache::cached_axle_resistance |
Resistance caused by the axles of the vehicle (valid only for the first engine).
Definition at line 35 of file ground_vehicle.hpp.
| uint32_t GroundVehicleCache::cached_max_te |
Maximum tractive effort of consist (valid only for the first engine).
Definition at line 34 of file ground_vehicle.hpp.
Referenced by VehicleDetailsWindow::DrawWidget().
| uint16_t GroundVehicleCache::cached_max_track_speed |
Maximum consist speed (in internal units) limited by track type (valid only for the first engine).
Definition at line 38 of file ground_vehicle.hpp.
Referenced by RoadVehicle::GetCurrentMaxSpeed(), and Train::GetCurrentMaxSpeed().
| uint32_t GroundVehicleCache::cached_power |
Total power of the consist (valid only for the first engine).
Definition at line 39 of file ground_vehicle.hpp.
Referenced by CheckTrainStayInDepot(), VehicleDetailsWindow::DrawWidget(), Vehicle::GetDisplayMinPowerToWeight(), and Train::UpdateAcceleration().
| uint32_t GroundVehicleCache::cached_slope_resistance |
Resistance caused by weight when this vehicle part is at a slope.
Definition at line 33 of file ground_vehicle.hpp.
| uint16_t GroundVehicleCache::cached_total_length |
Length of the whole vehicle (valid only for the first engine).
Definition at line 43 of file ground_vehicle.hpp.
Referenced by Train::ConsistChanged(), DepotWindow::DrawVehicleInDepot(), RoadStop::Entry::Enter(), GetTrainStopLocation(), RoadStop::Entry::Leave(), RoadVehUpdateCache(), UpdateLoadUnloadTicks(), and VehicleLengthSorter().
| uint8_t GroundVehicleCache::cached_veh_length |
Length of this vehicle in units of 1/VEHICLE_LENGTH of normal length. It is cached because this can be set by a callback.
Definition at line 45 of file ground_vehicle.hpp.
Referenced by AddArticulatedParts(), Train::CalcNextVehicleOffset(), CheckTrainAttachment(), CmdBuildRoadVehicle(), FindTrainCollideEnum(), RoadVehicle::GetDisplayImageWidth(), Train::GetDisplayImageWidth(), GetTrainStopLocation(), TrainApproachingLineEnd(), RoadVehicle::UpdateDeltaXY(), and Train::UpdateDeltaXY().
| uint32_t GroundVehicleCache::cached_weight |
Total weight of the consist (valid only for the first engine).
Definition at line 32 of file ground_vehicle.hpp.
Referenced by VehicleDetailsWindow::DrawWidget(), and Train::UpdateAcceleration().
| EngineID GroundVehicleCache::first_engine |
Cached EngineID of the front vehicle. INVALID_ENGINE for the front vehicle itself.
Definition at line 44 of file ground_vehicle.hpp.
Referenced by AddArticulatedParts(), CheckTrainAttachment(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRoadVehicle(), Train::GetMaxWeight(), Train::GetPoweredPartPower(), GetVehiclePalette(), Train::GetWeight(), LiveryHelper(), and VehicleResolverObject::VehicleResolverObject().
| uint16_t GroundVehicleCache::last_speed |
The last speed we did display, so we only have to redraw when this changes.
Definition at line 48 of file ground_vehicle.hpp.
Referenced by AfterLoadVehiclesPhase2(), RoadVehicle::GetDisplaySpeed(), Train::GetDisplaySpeed(), and GroundVehicle< T, Type >::SetLastSpeed().