OpenTTD Source 20260311-master-g511d3794ce
TrainCache Struct Reference

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

#include <train.h>

Public Member Functions

auto operator<=> (const TrainCache &other) const =default
 Compare variables with another instance of this class.

Data Fields

const struct SpriteGroupcached_override = nullptr
 Cached wagon override spritegroup.
bool cached_tilt = false
 train can tilt; feature provides a bonus in curves
uint8_t user_def_data = 0
 Cached property 0x25. Can be set by Callback 0x36.
int16_t cached_curve_speed_mod = 0
 curve speed modifier of the entire train
uint16_t cached_max_curve_speed = 0
 max consist speed limited by curves

Detailed Description

Variables that are cached to improve performance and such.

Definition at line 75 of file train.h.

Member Function Documentation

◆ operator<=>()

auto TrainCache::operator<=> ( const TrainCache & other) const
default

Compare variables with another instance of this class.

Parameters
otherThe other instance of TrainCache.
Returns
The std::strong_ordering of the comparison.

Field Documentation

◆ cached_curve_speed_mod

int16_t TrainCache::cached_curve_speed_mod = 0

curve speed modifier of the entire train

Definition at line 83 of file train.h.

◆ cached_max_curve_speed

uint16_t TrainCache::cached_max_curve_speed = 0

max consist speed limited by curves

Definition at line 84 of file train.h.

Referenced by TrainController().

◆ cached_override

const struct SpriteGroup* TrainCache::cached_override = nullptr

Cached wagon override spritegroup.

Definition at line 77 of file train.h.

Referenced by UsesWagonOverride(), and VehicleResolverObject::VehicleResolverObject().

◆ cached_tilt

bool TrainCache::cached_tilt = false

train can tilt; feature provides a bonus in curves

Definition at line 80 of file train.h.

◆ user_def_data

uint8_t TrainCache::user_def_data = 0

Cached property 0x25. Can be set by Callback 0x36.

Definition at line 81 of file train.h.


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