# TrainCache Struct Reference

Variables that are cached to improve performance and such. More...

`#include <train.h>`

Inheritance diagram for TrainCache:

## Data Fields
struct SpriteGroup * | cached_override
uint16 | last_speed
uint16 | cached_total_length
| Length of the whole train, valid only for first engine.
uint8 | cached_veh_length
| length of this vehicle in units of 1/8 of normal length, cached because this can be set by a callback
bool | cached_tilt
| train can tilt; feature provides a bonus in curves
uint16 | cached_max_speed
| max speed of the consist. (minimum of the max speed of all vehicles in the consist)
uint16 | cached_max_rail_speed
| max consist speed limited by rail type
int | cached_max_curve_speed
| max consist speed limited by curves
byte | cached_vis_effect
| Position/type of visual effect.
byte | user_def_data
EngineID | first_engine
| cached EngineID of the front vehicle. INVALID_ENGINE for the front vehicle itself.

## Detailed Description

Variables that are cached to improve performance and such.

Definition at line 76 of file train.h.

## Field Documentation

byte TrainCache::cached_vis_effect

Position/type of visual effect.

bit 0 - 3 = position of effect relative to vehicle. (0 = front, 8 = centre, 15 = rear) bit 4 - 5 = type of effect. (0 = default for engine class, 1 = steam, 2 = diesel, 3 = electric) bit 6 = disable visual effect. bit 7 = disable powered wagons.

Definition at line 99 of file train.h.

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

- src/train.h