75 uint8_t image_index = 0;
85 Price running_cost_class{};
100 uint8_t image_index = 0;
101 uint8_t cost_factor = 0;
102 uint8_t running_cost = 0;
105 uint16_t capacity = 0;
121 return raw_speed * (256 - (is_ocean ? this->ocean_speed_frac : this->canal_speed_frac)) / 256;
138 uint8_t image_index = 0;
139 uint8_t cost_factor = 0;
140 uint8_t running_cost = 0;
144 uint8_t acceleration = 0;
152 uint8_t image_index = 0;
153 uint8_t cost_factor = 0;
154 uint8_t running_cost = 0;
155 Price running_cost_class{};
158 uint8_t capacity = 0;
212 uint8_t decay_speed = 0;
213 uint8_t load_amount = 0;
216 std::variant<CargoLabel, MixedCargoType> cargo_label{};
218 uint8_t refit_cost = 0;
259 return engine_id.base() | (
static_cast<uint64_t
>(context) << 32) | (
static_cast<uint64_t
>(extra_data) << 40);
Types related to cargoes...
EnumBitSet< CargoType, uint64_t > CargoTypes
Bitset of CargoType elements.
CargoType
Cargo slots to indicate a cargo type within a game.
StrongType::Typedef< int32_t, struct YearTag< struct Calendar >, StrongType::Compare, StrongType::Integer > Year
StrongType::Typedef< int32_t, DateTag< struct Calendar >, StrongType::Compare, StrongType::Integer > Date
Types related to the economy.
Price
Enumeration of all base prices for use with Prices.
AircraftSubTypeBits
AircraftVehicleInfo subtypes, bitmask type.
@ AIR_CTOL
Conventional Take Off and Landing, i.e. planes.
EnumBitSet< EngineMiscFlag, uint8_t > EngineMiscFlags
Bitset of EngineMiscFlag elements.
ExtraEngineFlag
Extra engine flags for NewGRF features.
@ HasCab
Train wagon has a cab and can lead a train when backing up, without any speed reduction.
@ SyncReliability
Engine reliability will be synced with variant parent.
@ NoNews
No 'new vehicle' news will be generated.
@ JoinPreview
Engine will join exclusive preview with variant parent.
@ NoPreview
No exclusive preview will be offered.
EnumBitSet< EngineFlag, uint8_t > EngineFlags
Bitset of EngineFlag elements.
EngineMiscFlag
EngineInfo.misc_flags is a bitmask, with the following values.
@ NoDefaultCargoMultiplier
Use the new capacity algorithm. The default cargotype of the vehicle does not affect capacity multipl...
@ RailFlips
Rail vehicle has old depot-flip handling.
@ RoadIsTram
Road vehicle is a tram/light rail vehicle.
@ RailTilts
Rail vehicle tilts in curves.
@ NoBreakdownSmoke
Do not show black smoke during a breakdown.
@ Uses2CC
Vehicle uses two company colours.
@ SpriteStack
Draw vehicle by stacking multiple sprites.
@ RailIsMU
Rail vehicle is a multiple-unit (DMU/EMU).
@ AutoRefit
Automatic refitting is allowed.
VisualEffect
Meaning of the various bits of the visual effect.
@ VE_TYPE_DEFAULT
Use default from engine class.
@ VE_TYPE_COUNT
Number of bits used for the effect type.
@ VE_OFFSET_CENTRE
Value of offset corresponding to a position above the centre of the vehicle.
@ VE_TYPE_ELECTRIC
Electric sparks.
@ VE_TYPE_START
First bit used for the type of effect.
@ VE_OFFSET_COUNT
Number of bits used for the offset.
@ VE_ADVANCED_EFFECT
Flag for advanced effects.
@ VE_DISABLE_EFFECT
Flag to disable visual effect.
@ VE_TYPE_STEAM
Steam plumes.
@ VE_TYPE_DIESEL
Diesel fumes.
@ VE_DEFAULT
Default value to indicate that visual effect should be based on engine class.
@ VE_OFFSET_START
First bit that contains the offset (0 = front, 8 = centre, 15 = rear).
@ VE_DISABLE_WAGON_POWER
Flag to disable wagon power.
static const uint MAX_LENGTH_ENGINE_NAME_CHARS
The maximum length of an engine name in characters including '\0'.
PoolID< uint16_t, struct EngineIDTag, 64000, 0xFFFF > EngineID
Unique identification number of an engine.
uint64_t PackEngineNameDParam(EngineID engine_id, EngineNameContext context, uint32_t extra_data=0)
Combine an engine ID and a name context to an engine name StringParameter.
EngineFlag
Engine.flags is a bitmask, with the following values.
@ Available
This vehicle is available to everyone.
@ ExclusivePreview
This vehicle is in the exclusive preview stage, either being used or being offered to a company.
EngineClass
Type of rail engine.
@ Steam
Steam rail engine.
@ Diesel
Diesel rail engine.
@ Electric
Electric rail engine.
@ Monorail
Mono rail engine.
EngineNameContext
Contexts an engine name can be shown in.
@ VehicleDetails
Name is shown in the vehicle details GUI.
@ PurchaseList
Name is shown in the purchase list (including autoreplace window 'Available vehicles' panel).
@ Generic
No specific context available.
@ AutoreplaceVehicleInUse
Name is show in the autoreplace window 'Vehicles in use' panel.
@ PreviewNews
Name is shown in exclusive preview or newspaper.
VehicleAccelerationModel
Acceleration model of a vehicle.
@ Normal
Default acceleration model.
RailVehicleType
Available types of rail vehicles.
@ Multihead
indicates a combination of two locomotives
@ Singlehead
indicates a "standalone" locomotive
@ Wagon
simple wagon, not motorized
EnumBitSet< ExtraEngineFlag, uint8_t > ExtraEngineFlags
Bitset of ExtraEngineFlag elements.
Types related to the landscape.
EnumBitSet< LandscapeType, uint8_t > LandscapeTypes
Bitset of LandscapeType elements.
Types related to NewGRF badges.
Callbacks that NewGRFs could implement.
EnumBitSet< VehicleCallbackMask, uint16_t > VehicleCallbackMasks
Bitset of VehicleCallbackMask elements.
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
The different types of rail.
EnumBitSet< RailType, uint64_t > RailTypes
Bitset of RailType elements.
@ RAILTYPE_RAIL
Standard non-electric rails.
Enums and other types related to roads.
RoadType
The different roadtypes we support.
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames).
Information about a aircraft vehicle.
uint16_t max_speed
Maximum speed (1 unit = 8 mph = 12.8 km-ish/h).
uint8_t mail_capacity
Mail capacity (bags).
uint8_t subtype
Type of aircraft.
uint16_t passenger_capacity
Passenger capacity (persons).
uint16_t max_range
Maximum range of this aircraft.
Information about a vehicle.
uint16_t cargo_age_period
Number of ticks before carried cargo is aged.
TimerGameCalendar::Year base_life
Basic duration of engine availability (without random parts). 0xFF means infinite life.
LandscapeTypes climates
Climates supported by the engine.
EngineMiscFlags misc_flags
Miscellaneous flags.
EngineID variant_id
Engine variant ID. If set, will be treated specially in purchase lists.
StringID string_id
Default name of engine.
VehicleCallbackMasks callback_mask
Bitmask of vehicle callbacks that have to be called.
TimerGameCalendar::Date base_intro
Basic date of engine introduction (without random parts).
int8_t retire_early
Number of years early to retire vehicle.
TimerGameCalendar::Year lifelength
Lifetime of a single vehicle.
Templated helper to make a PoolID a single POD value.
Information about a rail vehicle.
uint16_t power
Power of engine (hp); For multiheaded engines the sum of both engine powers.
uint8_t user_def_data
Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles.
uint8_t running_cost
Running cost of engine; For multiheaded engines the sum of both running costs.
uint8_t cost_factor
Purchase cost factor; For multiheaded engines the sum of both engine prices.
uint8_t shorten_factor
length on main map for this type is 8 - shorten_factor
RailTypes railtypes
Railtypes, mangled if elrail is disabled.
uint16_t pow_wag_power
Extra power applied to consist if wagon should be powered.
uint16_t max_speed
Maximum speed (1 unit = 1/1.6 mph = 1 km-ish/h).
int16_t curve_speed_mod
Modifier to maximum speed in curves (fixed-point binary with 8 fractional bits).
RailVehicleType railveh_type
Type of rail vehicle.
uint16_t weight
Weight of vehicle (tons); For multiheaded engines the weight of each single engine.
uint8_t capacity
Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
uint8_t visual_effect
Bitstuffed NewGRF visual effect data.
uint8_t air_drag
Coefficient of air drag.
RailTypes intended_railtypes
Intended railtypes, regardless of elrail being enabled or disabled.
EngineClass engclass
Class of engine for this vehicle.
uint8_t ai_passenger_only
Bit value to tell AI that this engine is for passenger use only.
uint8_t tractive_effort
Tractive effort coefficient.
uint8_t pow_wag_weight
Extra weight applied to consist if wagon should be powered.
Information about a road vehicle.
uint8_t tractive_effort
Coefficient of tractive effort.
uint16_t max_speed
Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h).
uint8_t air_drag
Coefficient of air drag.
uint8_t power
Power in 10hp units.
RoadType roadtype
Road type.
uint8_t weight
Weight in 1/4t units.
uint8_t shorten_factor
length on main map for this type is 8 - shorten_factor
uint8_t visual_effect
Bitstuffed NewGRF visual effect data.
Information about a ship vehicle.
bool old_refittable
Is ship refittable; only used during initialisation. Later use EngineInfo::refit_mask.
uint8_t ocean_speed_frac
Fraction of maximum speed for ocean tiles.
uint ApplyWaterClassSpeedFrac(uint raw_speed, bool is_ocean) const
Apply ocean/canal speed fraction to a velocity.
uint8_t visual_effect
Bitstuffed NewGRF visual effect data.
uint16_t max_speed
Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h).
uint8_t acceleration
Acceleration (1 unit = 1/3.2 mph per tick = 0.5 km-ish/h per tick).
uint8_t canal_speed_frac
Fraction of maximum speed for canal/river tiles.
Definition of the game-calendar-timer.