OpenTTD Source 20241224-master-gf74b0cf984
|
Base for all engine handling. More...
#include "stdafx.h"
#include "core/container_func.hpp"
#include "company_func.h"
#include "command_func.h"
#include "news_func.h"
#include "aircraft.h"
#include "newgrf.h"
#include "newgrf_engine.h"
#include "strings_func.h"
#include "core/random_func.hpp"
#include "window_func.h"
#include "autoreplace_gui.h"
#include "string_func.h"
#include "ai/ai.hpp"
#include "core/pool_func.hpp"
#include "engine_gui.h"
#include "engine_func.h"
#include "engine_base.h"
#include "company_base.h"
#include "vehicle_func.h"
#include "articulated_vehicles.h"
#include "error.h"
#include "timer/timer.h"
#include "timer/timer_game_tick.h"
#include "timer/timer_game_calendar.h"
#include "table/strings.h"
#include "table/engines.h"
#include "safeguards.h"
Go to the source code of this file.
Functions | |
void | SetupEngines () |
Initialise the engine pool with the data from the original vehicles. | |
void | ShowEnginePreviewWindow (EngineID engine) |
static bool | IsWagon (EngineID index) |
Determine whether an engine type is a wagon (and not a loco). | |
static void | ClearLastVariant (EngineID engine_id, VehicleType type) |
Ensure engine is not set as the last used variant for any other engine. | |
void | CalcEngineReliability (Engine *e, bool new_month) |
Update Engine::reliability and (if needed) update the engine GUIs. | |
void | SetYearEngineAgingStops () |
Compute the value for _year_engine_aging_stops. | |
void | StartupOneEngine (Engine *e, const TimerGameCalendar::YearMonthDay &aging_ymd, uint32_t seed) |
Start/initialise one engine. | |
void | StartupEngines () |
Start/initialise all our engines. | |
static void | EnableEngineForCompany (EngineID eid, CompanyID company) |
Allows engine eid to be used by a company company. | |
static void | DisableEngineForCompany (EngineID eid, CompanyID company) |
Forbids engine eid to be used by a company company. | |
static void | AcceptEnginePreview (EngineID eid, CompanyID company, int recursion_depth=0) |
Company company accepts engine eid for preview. | |
static CompanyID | GetPreviewCompany (Engine *e) |
Get the best company for an engine preview. | |
static bool | IsVehicleTypeDisabled (VehicleType type, bool ai) |
Checks if a vehicle type is disabled for all/ai companies. | |
void | ClearEnginesHiddenFlagOfCompany (CompanyID cid) |
Clear the 'hidden' flag for all engines of a new company. | |
CommandCost | CmdSetVehicleVisibility (DoCommandFlag flags, EngineID engine_id, bool hide) |
Set the visibility of an engine. | |
CommandCost | CmdWantEnginePreview (DoCommandFlag flags, EngineID engine_id) |
Accept an engine prototype. | |
CommandCost | CmdEngineCtrl (DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow) |
Allow or forbid a specific company to use an engine. | |
static void | NewVehicleAvailable (Engine *e) |
An engine has become available for general use. | |
void | CalendarEnginesMonthlyLoop () |
Monthly update of the availability, reliability, and preview offers of the engines. | |
static bool | IsUniqueEngineName (const std::string &name) |
Is name still free as name for an engine? | |
CommandCost | CmdRenameEngine (DoCommandFlag flags, EngineID engine_id, const std::string &text) |
Rename an engine. | |
bool | IsEngineBuildable (EngineID engine, VehicleType type, CompanyID company) |
Check if an engine is buildable. | |
bool | IsEngineRefittable (EngineID engine) |
Check if an engine is refittable. | |
void | CheckEngines () |
Check for engines that have an appropriate availability. | |
Variables | |
EnginePool | _engine_pool ("Engine") |
EngineOverrideManager | _engine_mngr |
static TimerGameCalendar::Year | _year_engine_aging_stops |
Year that engine aging stops. | |
const uint8_t | _engine_counts [4] |
Number of engines of each vehicle type in original engine data. | |
const uint8_t | _engine_offsets [4] |
Offset of the first engine of each vehicle type in original engine data. | |
static IntervalTimer< TimerGameCalendar > | _calendar_engines_daily ({TimerGameCalendar::DAY, TimerGameCalendar::Priority::ENGINE}, [](auto) { for(Company *c :Company::Iterate()) { c->avail_railtypes=AddDateIntroducedRailTypes(c->avail_railtypes, TimerGameCalendar::date);c->avail_roadtypes=AddDateIntroducedRoadTypes(c->avail_roadtypes, TimerGameCalendar::date);} if(TimerGameCalendar::year >=_year_engine_aging_stops) return;for(Engine *e :Engine::Iterate()) { EngineID i=e->index;if(e->flags &ENGINE_EXCLUSIVE_PREVIEW) { if(e->preview_company !=INVALID_COMPANY) { if(!--e->preview_wait) { CloseWindowById(WC_ENGINE_PREVIEW, i);e->preview_company=INVALID_COMPANY;} } else if(CountBits(e->preview_asked)< MAX_COMPANIES) { e->preview_company=GetPreviewCompany(e);if(e->preview_company==INVALID_COMPANY) { e->preview_asked=MAX_UVALUE(CompanyMask);continue;} SetBit(e->preview_asked, e->preview_company);e->preview_wait=20;if(!IsVehicleTypeDisabled(e->type, true)) AI::NewEvent(e->preview_company, new ScriptEventEnginePreview(i));if(IsInteractiveCompany(e->preview_company)) ShowEnginePreviewWindow(i);} } } }) |
Daily check to offer an exclusive engine preview to the companies. | |
static IntervalTimer< TimerGameCalendar > | _calendar_engines_monthly ({TimerGameCalendar::MONTH, TimerGameCalendar::Priority::ENGINE}, [](auto) { CalendarEnginesMonthlyLoop();}) |
Base for all engine handling.
Definition in file engine.cpp.
Company company accepts engine eid for preview.
eid | Engine being accepted (is under preview). |
company | Current company previewing the engine. |
recursion_depth | Recursion depth to avoid infinite loop. |
Definition at line 883 of file engine.cpp.
References AcceptEnginePreview(), EnableEngineForCompany(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), HasFlag(), INVALID_COMPANY, InvalidateWindowData(), Engine::IterateType(), JoinPreview, MAX_UVALUE, Engine::preview_asked, Engine::preview_company, Engine::type, and WC_ENGINE_PREVIEW.
Referenced by AcceptEnginePreview(), and CmdWantEnginePreview().
void CalcEngineReliability | ( | Engine * | e, |
bool | new_month | ||
) |
Update Engine::reliability and (if needed) update the engine GUIs.
e | Engine to update. |
Definition at line 647 of file engine.cpp.
References _settings_game, AddRemoveEngineFromAutoreplaceAndBuildWindows(), Engine::age, EngineInfo::base_life, ClearLastVariant(), Engine::company_avail, Engine::duration_phase_1, Engine::duration_phase_2, Engine::duration_phase_3, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), HasFlag(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_ENGINE, VehicleSettings::never_expire_vehicles, Engine::reliability, Engine::reliability_final, Engine::reliability_max, Engine::reliability_start, EngineInfo::retire_early, SyncReliability, Engine::type, EngineInfo::variant_id, and GameSettings::vehicle.
Referenced by CalendarEnginesMonthlyLoop(), FixTTOEngines(), and StartupEngines().
void CalendarEnginesMonthlyLoop | ( | ) |
Monthly update of the availability, reliability, and preview offers of the engines.
Definition at line 1147 of file engine.cpp.
References _year_engine_aging_stops, CalcEngineReliability(), TimerGameCalendar::date, TimerGameConst< struct Calendar >::DAYS_IN_YEAR, ENGINE_AVAILABLE, ENGINE_EXCLUSIVE_PREVIEW, HasFlag(), INVALID_COMPANY, InvalidateWindowClassesData(), IsVehicleTypeDisabled(), IsWagon(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), NewVehicleAvailable(), NoPreview, SetWindowClassesDirty(), WC_BUILD_VEHICLE, WC_REPLACE_VEHICLE, and TimerGameCalendar::year.
Referenced by ClickChangeDateCheat().
void CheckEngines | ( | ) |
Check for engines that have an appropriate availability.
Definition at line 1321 of file engine.cpp.
References ENGINE_AVAILABLE, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), RAILVEH_WAGON, SetDParam(), ShowErrorMessage(), VEH_TRAIN, and WL_WARNING.
void ClearEnginesHiddenFlagOfCompany | ( | CompanyID | cid | ) |
Clear the 'hidden' flag for all engines of a new company.
cid | Company being created. |
Definition at line 1005 of file engine.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), and SB().
Referenced by DoStartupNewCompany().
|
static |
Ensure engine is not set as the last used variant for any other engine.
engine_id | Engine being removed. |
type | Type of engine. |
Definition at line 636 of file engine.cpp.
References INVALID_ENGINE, and Engine::IterateType().
Referenced by CalcEngineReliability(), and DisableEngineForCompany().
CommandCost CmdEngineCtrl | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
CompanyID | company_id, | ||
bool | allow | ||
) |
Allow or forbid a specific company to use an engine.
flags | operation to perform |
engine_id | engine id |
company_id | Company to allow/forbid the use of an engine. |
allow | false to forbid, true to allow. |
Definition at line 1058 of file engine.cpp.
References _current_company, CMD_ERROR, DC_EXEC, DisableEngineForCompany(), EnableEngineForCompany(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::IsValidID(), and OWNER_DEITY.
CommandCost CmdRenameEngine | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
const std::string & | text | ||
) |
Rename an engine.
flags | operation to perform |
engine_id | engine ID to rename |
text | the new name or an empty string when resetting to the default |
Definition at line 1220 of file engine.cpp.
References CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), IsUniqueEngineName(), MarkWholeScreenDirty(), MAX_LENGTH_ENGINE_NAME_CHARS, Engine::name, and Utf8StringLength().
CommandCost CmdSetVehicleVisibility | ( | DoCommandFlag | flags, |
EngineID | engine_id, | ||
bool | hide | ||
) |
Set the visibility of an engine.
flags | Operation to perform. |
engine_id | Engine id.. |
hide | Set for hidden, unset for visible. |
Definition at line 1019 of file engine.cpp.
References _current_company, AddRemoveEngineFromAutoreplaceAndBuildWindows(), AssignBit(), CMD_ERROR, Engine::company_hidden, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, IsEngineBuildable(), MAX_COMPANIES, and Engine::type.
CommandCost CmdWantEnginePreview | ( | DoCommandFlag | flags, |
EngineID | engine_id | ||
) |
Accept an engine prototype.
XXX - it is possible that the top-company changes while you are waiting to accept the offer? Then it becomes invalid
flags | operation to perform |
engine_id | engine-prototype offered |
Definition at line 1040 of file engine.cpp.
References _current_company, AcceptEnginePreview(), CMD_ERROR, DC_EXEC, ENGINE_EXCLUSIVE_PREVIEW, Engine::flags, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), and Engine::preview_company.
Forbids engine eid to be used by a company company.
eid | The engine to disable. |
company | The company to forbid using the engine. |
Definition at line 859 of file engine.cpp.
References _local_company, AddRemoveEngineFromAutoreplaceAndBuildWindows(), Company::avail_railtypes, Company::avail_roadtypes, ClearLastVariant(), ClrBit(), Engine::company_avail, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetCompanyRailTypes(), GetCompanyRoadTypes(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Engine::type, VEH_ROAD, and VEH_TRAIN.
Referenced by CmdEngineCtrl().
Allows engine eid to be used by a company company.
eid | The engine to enable. |
company | The company to allow using the engine. |
Definition at line 831 of file engine.cpp.
References _local_company, AddRemoveEngineFromAutoreplaceAndBuildWindows(), Company::avail_railtypes, Company::avail_roadtypes, Engine::company_avail, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), GetCompanyRailTypes(), GetCompanyRoadTypes(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, InvalidateWindowData(), SetBit(), TRANSPORT_AIR, TRANSPORT_ROAD, TRANSPORT_WATER, Engine::type, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, WC_BUILD_TOOLBAR, and WC_MAIN_TOOLBAR.
Referenced by AcceptEnginePreview(), and CmdEngineCtrl().
Get the best company for an engine preview.
e | Engine to preview. |
Definition at line 915 of file engine.cpp.
References GetUnionOfArticulatedRefitMasks(), HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_COMPANY, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), Engine::preview_asked, Engine::type, and VEH_TRAIN.
bool IsEngineBuildable | ( | EngineID | engine, |
VehicleType | type, | ||
CompanyID | company | ||
) |
Check if an engine is buildable.
engine | index of the engine to check. |
type | the type the engine should be. |
company | index of the company. |
Definition at line 1254 of file engine.cpp.
References Company::avail_railtypes, Company::avail_roadtypes, Engine::company_avail, ENGINE_AVAILABLE, Engine::flags, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), GetRailTypeInfo(), GetRoadTypeInfo(), HasBit(), Engine::IsEnabled(), OWNER_DEITY, RoadTypeInfo::powered_roadtypes, RailVehicleInfo::railtype, RoadVehicleInfo::roadtype, ROADTYPES_NONE, Engine::type, VEH_ROAD, and VEH_TRAIN.
Referenced by CheckAutoreplaceValidity(), CmdBuildVehicle(), CmdSetVehicleVisibility(), and GetNewEngineType().
bool IsEngineRefittable | ( | EngineID | engine | ) |
Check if an engine is refittable.
Note: Likely you want to use IsArticulatedVehicleRefittable().
engine | index of the engine to check. |
Definition at line 1295 of file engine.cpp.
References EngineInfo::callback_mask, Engine::CanCarryCargo(), CBM_VEHICLE_CARGO_SUFFIX, Engine::GetDefaultCargoType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::GetIfValid(), HasBit(), IsValidCargoID(), and SetBit().
Referenced by IsArticulatedVehicleRefittable(), IsVehicleRefitable(), and OrdersWindow::UpdateAutoRefitState().
|
static |
Is name still free as name for an engine?
name | New name of an engine. |
false
if the name is being used already, else true
. Definition at line 1204 of file engine.cpp.
Referenced by CmdRenameEngine().
|
static |
Checks if a vehicle type is disabled for all/ai companies.
type | The vehicle type which shall be checked. |
ai | If true, check if the type is disabled for AI companies, otherwise check if the vehicle type is disabled for human companies. |
Definition at line 949 of file engine.cpp.
References _settings_game, GameSettings::ai, AISettings::ai_disable_veh_aircraft, AISettings::ai_disable_veh_roadveh, AISettings::ai_disable_veh_ship, AISettings::ai_disable_veh_train, VehicleSettings::max_aircraft, VehicleSettings::max_roadveh, VehicleSettings::max_ships, VehicleSettings::max_trains, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, and GameSettings::vehicle.
Referenced by CalendarEnginesMonthlyLoop(), and NewVehicleAvailable().
|
static |
Determine whether an engine type is a wagon (and not a loco).
index | Engine getting queried. |
Definition at line 625 of file engine.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), RAILVEH_WAGON, Engine::type, and VEH_TRAIN.
Referenced by CalendarEnginesMonthlyLoop(), and NewVehicleAvailable().
|
static |
An engine has become available for general use.
Also handle the exclusive engine preview contract.
e | Engine generally available as of now. |
Definition at line 1080 of file engine.cpp.
References AddDateIntroducedRailTypes(), AddDateIntroducedRoadTypes(), AddNewsItem(), AddRemoveEngineFromAutoreplaceAndBuildWindows(), AI::BroadcastNewEvent(), CloseWindowById(), Engine::company_avail, TimerGameCalendar::date, ENGINE_AVAILABLE, ENGINE_EXCLUSIVE_PREVIEW, Engine::flags, SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), GetEngineCategoryName(), GetRailTypeInfo(), GetRoadTypeInfo(), HasBit(), HasFlag(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, RailTypeInfo::introduces_railtypes, RoadTypeInfo::introduces_roadtypes, InvalidateWindowData(), Aircraft::IsNormalAircraft(), IsVehicleTypeDisabled(), IsWagon(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), MAX_UVALUE, NF_VEHICLE, NoNews, NR_ENGINE, NT_NEW_VEHICLES, PackEngineNameDParam(), PreviewNews, RailVehicleInfo::railtype, RAILTYPE_END, RoadVehicleInfo::roadtype, ROADTYPE_END, SetDParam(), TRANSPORT_AIR, TRANSPORT_ROAD, TRANSPORT_WATER, Engine::type, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, WC_BUILD_TOOLBAR, and WC_ENGINE_PREVIEW.
Referenced by CalendarEnginesMonthlyLoop().
void SetupEngines | ( | ) |
Initialise the engine pool with the data from the original vehicles.
Definition at line 601 of file engine.cpp.
References _engine_counts, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::CleanPool(), CloseWindowByClass(), VEH_COMPANY_END, and WC_ENGINE_PREVIEW.
Referenced by ResetNewGRFData().
void SetYearEngineAgingStops | ( | ) |
Compute the value for _year_engine_aging_stops.
Definition at line 693 of file engine.cpp.
References _settings_game, _year_engine_aging_stops, EngineInfo::base_intro, EngineInfo::climates, TimerGameCalendar::ConvertDateToYMD(), TimerGameConst< struct Calendar >::DAYS_IN_LEAP_YEAR, GameSettings::game_creation, HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), GameCreationSettings::landscape, EngineInfo::lifelength, RAILVEH_WAGON, and VEH_TRAIN.
Referenced by AfterLoadGRFs().
void ShowEnginePreviewWindow | ( | EngineID | engine | ) |
Definition at line 155 of file engine_gui.cpp.
void StartupEngines | ( | ) |
Start/initialise all our engines.
Must be called whenever there are changes to the NewGRF config.
Definition at line 799 of file engine.cpp.
References _year_engine_aging_stops, CalcEngineReliability(), TimerGameCalendar::ConvertDateToYMD(), TimerGameCalendar::ConvertYMDToDate(), TimerGameCalendar::date, GetCompanyRailTypes(), GetCompanyRoadTypes(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), SetWindowClassesDirty(), StartupOneEngine(), WC_BUILD_VEHICLE, and WC_REPLACE_VEHICLE.
Referenced by _GenerateWorld(), AfterLoadGame(), DEF_CONSOLE_CMD(), SaveLoadWindow::OnTimeout(), and ReloadNewGRFData().
void StartupOneEngine | ( | Engine * | e, |
const TimerGameCalendar::YearMonthDay & | aging_ymd, | ||
uint32_t | seed | ||
) |
Start/initialise one engine.
e | The engine to initialise. |
aging_date | The date used for age calculations. |
seed | Random seed. |
Definition at line 718 of file engine.cpp.
References _settings_game, Engine::age, EngineInfo::base_intro, EngineInfo::base_life, EngineInfo::climates, Engine::company_avail, Engine::company_hidden, TimerGameCalendar::ConvertDateToYMD(), TimerGameCalendar::ConvertYMDToDate(), TimerGameCalendar::date, Engine::duration_phase_1, Engine::duration_phase_2, Engine::duration_phase_3, ENGINE_AVAILABLE, Engine::flags, GameSettings::game_creation, GB(), GameCreationSettings::generation_seed, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), Engine::GetGRFID(), HasBit(), HasFlag(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Engine::intro_date, INVALID_ENGINE, GameCreationSettings::landscape, EngineInfo::lifelength, MAX_UVALUE, Engine::reliability_final, Engine::reliability_max, Engine::reliability_spd_dec, Engine::reliability_start, RestoreRandomSeeds(), EngineInfo::retire_early, SaveRandomSeeds(), SetRandomSeed(), GameCreationSettings::starting_year, SyncReliability, Engine::type, and EngineInfo::variant_id.
Referenced by FixTTOEngines(), and StartupEngines().
const uint8_t _engine_counts[4] |
Number of engines of each vehicle type in original engine data.
Definition at line 54 of file engine.cpp.
Referenced by GetNewEngine(), ParamSet(), EngineOverrideManager::ResetToDefaultMapping(), and SetupEngines().
EngineOverrideManager _engine_mngr |
Definition at line 45 of file engine.cpp.
const uint8_t _engine_offsets[4] |
Offset of the first engine of each vehicle type in original engine data.
Definition at line 62 of file engine.cpp.
Referenced by ParamSet().
|
static |
Year that engine aging stops.
Engines will not reduce in reliability and no more engines will be introduced
Definition at line 51 of file engine.cpp.
Referenced by CalendarEnginesMonthlyLoop(), SetYearEngineAgingStops(), and StartupEngines().