10#ifndef NEWGRF_INTERNAL_VEHICLE_H
11#define NEWGRF_INTERNAL_VEHICLE_H
14#include "../engine_base.h"
15#include "../vehicle_func.h"
30 RailTypeLabel railtypelabel;
46 }
else if (this->refittability ==
UNSET) {
47 this->refittability =
EMPTY;
63template <VehicleType T>
66 return image_index == 0xFD || IsValidImageIndex<T>(image_index);
Class to read from a NewGRF file.
A sort-of mixin that adds 'at(pos)' and 'operator[](pos)' implementations for 'ConvertibleThroughBase...
Price
Enumeration of all base prices for use with Prices.
NewGRF internal processing state.
ChangeInfoResult
Possible return values for the GrfChangeInfoHandler functions.
ReferenceThroughBaseContainer< std::vector< GRFTempEngineData > > _gted
Temporary engine data used during NewGRF loading.
void ConvertTTDBasePrice(uint32_t base_pointer, const char *error_location, Price *index)
Converts TTD(P) Base Price pointers into the enum used by OTTD See http://wiki.ttdpatch....
ChangeInfoResult CommonVehicleChangeInfo(EngineInfo *ei, int prop, ByteReader &buf)
Define properties common to all vehicles.
static bool IsValidNewGRFImageIndex(uint8_t image_index)
Helper to check whether an image index is valid for a particular NewGRF vehicle.
Engine * GetNewEngine(const GRFFile *file, VehicleType type, uint16_t internal_id, bool static_access=false)
Returns the engine associated to a certain internal_id, resp.
Information about a vehicle.
Dynamic data of a loaded NewGRF.
Temporary engine data used when loading only.
CargoTypes ctt_exclude_mask
Cargo types always excluded from the refit mask.
Refittability
Summary state of refittability properties.
@ UNSET
No properties assigned. Default refit masks shall be activated.
@ EMPTY
GRF defined vehicle as not-refittable. The vehicle shall only carry the default cargo.
@ NONEMPTY
GRF defined the vehicle as refittable. If the refitmask is empty after translation (cargotypes not av...
Refittability refittability
Did the newgrf set any refittability property? If not, default refittability will be applied.
CargoClasses cargo_disallowed
Bitmask of cargo classes that are disallowed as a refit.
CargoTypes ctt_include_mask
Cargo types always included in the refit mask.
uint8_t rv_max_speed
Temporary storage of RV prop 15, maximum speed in mph/0.8.
CargoClasses cargo_allowed
Bitmask of cargo classes that are allowed as a refit.
void UpdateRefittability(bool non_empty)
Update the summary refittability on setting a refittability property.
CargoClasses cargo_allowed_required
Bitmask of cargo classes that are required to be all present to allow a cargo as a refit.
const GRFFile * defaultcargo_grf
GRF defining the cargo translation table to use if the default cargo is the 'first refittable'.
VehicleType
Available vehicle types.