OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
20 std::vector<EngineID> engines;
78 std::vector<WagonOverride> overrides;
79 uint16_t list_position;
98 return this->info.cargo_type;
147 if (this->display_last_variant == this->
index || this->display_last_variant ==
INVALID_ENGINE)
return this;
uint16_t reliability_max
Maximal reliability of the engine.
static const EngineID INVALID_ENGINE
Constant denoting an invalid engine.
bool IsVariantHidden(CompanyID c) const
Check whether the engine variant chain is hidden in the GUI for the given company.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
static bool ResetToCurrentNewGRFConfig()
Tries to reset the engine mapping to match the current NewGRF configuration.
static Titem * Get(size_t index)
Returns Titem with given index.
void ResetToDefaultMapping()
Initializes the EngineOverrideManager with the default engines.
uint GetDisplayDefaultCapacity(uint16_t *mail_capacity=nullptr) const
Determines the default cargo capacity of an engine for display purposes.
uint16_t reliability_spd_dec
Speed of reliability decay between services (per day).
TimerGameCalendar::Date GetLifeLengthInDays() const
Returns the vehicle's (not model's!) life length in days.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
CompanyMask company_avail
Bit for each company whether the engine is available for that company.
uint GetDisplayMaxTractiveEffort() const
Returns the tractive effort of the engine for display purposes.
Owner
Enum for all companies/owners.
Tindex index
Index of this pool item.
@ VEH_TRAIN
Train vehicle type.
uint16_t reliability_final
Final reliability of the engine.
Money GetRunningCost() const
Return how much the running costs of this engine are.
@ VEH_ROAD
Road vehicle type.
CompanyID preview_company
Company which is currently being offered a preview INVALID_COMPANY means no company.
Templated helper to make a type-safe 'typedef' representing a single POD value.
Information about a vehicle.
CargoID GetDefaultCargoType() const
Determines the default cargo type of an engine.
CompanyMask company_hidden
Bit for each company whether the engine is normally hidden in the build gui for that company.
uint32_t GetGRFID() const
Retrieve the GRF ID of the NewGRF the engine is tied to.
uint8_t flags
Flags of the engine.
const GRFFile * GetGRF() const
Retrieve the NewGRF the engine is tied to.
EngineID display_last_variant
NOSAVE client-side-only last variant selected.
uint DetermineCapacity(const Vehicle *v, uint16_t *mail_capacity=nullptr) const
Determines capacity of a given vehicle from scratch.
uint GetDisplayMaxSpeed() const
Returns max speed of the engine for display purposes.
Information about a rail vehicle.
TimerGameCalendar::Date intro_date
Date of introduction of the engine.
Information about a road vehicle.
uint32_t grfid
The GRF ID of the file the entity belongs to.
CompanyMask preview_asked
Bit for each company which has already been offered a preview.
EngineDisplayFlags display_flags
NOSAVE client-side-only display flags for build engine list.
@ Shaded
Set if engine should be masked.
uint GetDisplayWeight() const
Returns the weight of the engine for display purposes.
uint8_t substitute_id
The (original) entity ID to use if this GRF is not available (currently not used)
@ IsFolded
Set if display of variants should be folded (hidden).
EngineDisplayFlags
Flags used client-side in the purchase/autorenew engine list.
uint16_t duration_phase_1
First reliability phase in months, increasing reliability from reliability_start to reliability_max.
uint8_t preview_wait
Daily countdown timer for timeout of offering the engine to the preview_company company.
Money GetCost() const
Return how much a new engine costs.
uint16_t reliability
Current reliability of the engine.
bool IsGroundVehicle() const
Check if the engine is a ground vehicle.
uint16_t reliability_start
Initial reliability of the engine.
std::string name
Custom name of engine.
Base class for all pools.
bool IsHidden(CompanyID c) const
Check whether the engine is hidden in the GUI for the given company.
uint16_t internal_id
The internal ID within the GRF file.
bool CanCarryCargo() const
Determines whether an engine can carry something.
uint GetPower() const
Returns the power of the engine for display and sorting purposes.
Stores the mapping of EngineID to the internal id of newgrfs.
EngineID GetID(VehicleType type, uint16_t grf_local_id, uint32_t grfid)
Looks up an EngineID in the EngineOverrideManager.
Information about a ship vehicle.
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
VehicleType
Available vehicle types.
bool IsEnabled() const
Checks whether the engine is a valid (non-articulated part of an) engine.
uint8_t original_image_index
Original vehicle image index, thus the image index of the overridden vehicle.
GRFFilePropsBase< NUM_CARGO+2 > grf_prop
Properties related the the grf file.
uint16_t EngineID
Unique identification number of an engine.
@ MAX_COMPANIES
Maximum number of companies.
const struct GRFFile * grffile
grf file that introduced this entity
VehicleType type
The engine type.
Information about a aircraft vehicle.
uint16_t duration_phase_2
Second reliability phase in months, keeping reliability_max.
Base class for all PoolItems.
uint16_t duration_phase_3
Third reliability phase in months, decaying to reliability_final.
@ HasVariants
Set if engine has variants.
StringID GetAircraftTypeText() const
Get the name of the aircraft type for display purposes.
static const uint NUM_DEFAULT_ENGINES
Number of default entries.
Dynamic data of a loaded NewGRF.
VehicleType type
Vehicle type, ie VEH_ROAD, VEH_TRAIN, etc.
uint16_t GetRange() const
Get the range of an aircraft type.
const Engine * GetDisplayVariant() const
Get the last display variant for an engine.
int32_t age
Age of the engine in months.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.