OpenTTD Source 20241224-master-gf74b0cf984
ShipVehicleInfo Struct Reference

Information about a ship vehicle. More...

#include <engine_type.h>

Public Member Functions

uint ApplyWaterClassSpeedFrac (uint raw_speed, bool is_ocean) const
 Apply ocean/canal speed fraction to a velocity.
 

Data Fields

uint8_t image_index
 
uint8_t cost_factor
 
uint8_t running_cost
 
uint8_t acceleration
 Acceleration (1 unit = 1/3.2 mph per tick = 0.5 km-ish/h per tick)
 
uint16_t max_speed
 Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h)
 
uint16_t capacity
 
SoundID sfx
 
bool old_refittable
 Is ship refittable; only used during initialisation. Later use EngineInfo::refit_mask.
 
uint8_t visual_effect
 Bitstuffed NewGRF visual effect data.
 
uint8_t ocean_speed_frac
 Fraction of maximum speed for ocean tiles.
 
uint8_t canal_speed_frac
 Fraction of maximum speed for canal/river tiles.
 

Detailed Description

Information about a ship vehicle.

Definition at line 67 of file engine_type.h.

Member Function Documentation

◆ ApplyWaterClassSpeedFrac()

uint ShipVehicleInfo::ApplyWaterClassSpeedFrac ( uint  raw_speed,
bool  is_ocean 
) const
inline

Apply ocean/canal speed fraction to a velocity.

Definition at line 81 of file engine_type.h.

References canal_speed_frac, and ocean_speed_frac.

Referenced by Ship::UpdateCache().

Field Documentation

◆ acceleration

uint8_t ShipVehicleInfo::acceleration

Acceleration (1 unit = 1/3.2 mph per tick = 0.5 km-ish/h per tick)

Definition at line 71 of file engine_type.h.

Referenced by AfterLoadGame(), CmdBuildShip(), and ShipVehicleChangeInfo().

◆ canal_speed_frac

uint8_t ShipVehicleInfo::canal_speed_frac

Fraction of maximum speed for canal/river tiles.

Definition at line 78 of file engine_type.h.

Referenced by ApplyWaterClassSpeedFrac(), CYapfCostShipT< Types >::PfCalcCost(), and ShipVehicleChangeInfo().

◆ capacity

uint16_t ShipVehicleInfo::capacity

Definition at line 73 of file engine_type.h.

◆ cost_factor

uint8_t ShipVehicleInfo::cost_factor

Definition at line 69 of file engine_type.h.

◆ image_index

uint8_t ShipVehicleInfo::image_index

Definition at line 68 of file engine_type.h.

◆ max_speed

uint16_t ShipVehicleInfo::max_speed

Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h)

Definition at line 72 of file engine_type.h.

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

◆ ocean_speed_frac

uint8_t ShipVehicleInfo::ocean_speed_frac

Fraction of maximum speed for ocean tiles.

Definition at line 77 of file engine_type.h.

Referenced by ApplyWaterClassSpeedFrac(), CYapfCostShipT< Types >::PfCalcCost(), and ShipVehicleChangeInfo().

◆ old_refittable

bool ShipVehicleInfo::old_refittable

Is ship refittable; only used during initialisation. Later use EngineInfo::refit_mask.

Definition at line 75 of file engine_type.h.

Referenced by CalculateRefitMasks(), and ShipVehicleChangeInfo().

◆ running_cost

uint8_t ShipVehicleInfo::running_cost

Definition at line 70 of file engine_type.h.

◆ sfx

SoundID ShipVehicleInfo::sfx

Definition at line 74 of file engine_type.h.

◆ visual_effect

uint8_t ShipVehicleInfo::visual_effect

Bitstuffed NewGRF visual effect data.

Definition at line 76 of file engine_type.h.

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


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