OpenTTD Source: VehicleCache Struct Reference

OpenTTD Source 15.0-beta1

Public Member Functions | Data Fields
VehicleCache Struct Reference

Cached often queried values common to all vehicles. More...

`#include <vehicle_base.h>`

## Public Member Functions
auto | operator<=> (const VehicleCache &) const =default

## Data Fields
uint16_t | cached_max_speed
| Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
uint16_t | cached_cargo_age_period
| Number of ticks before carried cargo is aged.
uint8_t | cached_vis_effect
| Visual effect to show (see VisualEffect)

## Detailed Description

Cached often queried values common to all vehicles.

Definition at line 125 of file vehicle_base.h.

## Field Documentation

## ◆ cached_cargo_age_period

uint16_t VehicleCache::cached_cargo_age_period

Number of ticks before carried cargo is aged.

Definition at line 127 of file vehicle_base.h.

Referenced by UpdateAircraftCache(), and Ship::UpdateCache().

## ◆ cached_max_speed

uint16_t VehicleCache::cached_max_speed

Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).

Definition at line 126 of file vehicle_base.h.

Referenced by Train::ConsistChanged(), GetAircraftFlightLevelBounds(), Ship::GetCurrentMaxSpeed(), Aircraft::GetDisplayMaxSpeed(), RoadVehicle::GetDisplayMaxSpeed(), Ship::GetDisplayMaxSpeed(), Train::GetDisplayMaxSpeed(), LoadUnloadVehicle(), RoadVehUpdateCache(), ShipAccelerate(), UpdateAircraftCache(), UpdateAircraftSpeed(), Ship::UpdateCache(), and VehicleMaxSpeedSorter().

## ◆ cached_vis_effect

uint8_t VehicleCache::cached_vis_effect

Visual effect to show (see VisualEffect)

Definition at line 129 of file vehicle_base.h.

Referenced by Vehicle::ShowVisualEffect(), and Vehicle::UpdateVisualEffect().

The documentation for this struct was generated from the following file:

- src/vehicle_base.h