OpenTTD Source 20250312-master-gcdcc6b491d
|
Command definitions related to autoreplace. More...
#include "command_type.h"
#include "vehicle_type.h"
#include "engine_type.h"
#include "group_type.h"
Go to the source code of this file.
Functions | |
CommandCost | CmdAutoreplaceVehicle (DoCommandFlags flags, VehicleID veh_id) |
Autoreplaces a vehicle Trains are replaced as a whole chain, free wagons in depot are replaced on their own. | |
CommandCost | CmdSetAutoReplace (DoCommandFlags flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old) |
Change engine renewal parameters. | |
Command definitions related to autoreplace.
Definition in file autoreplace_cmd.h.
CommandCost CmdAutoreplaceVehicle | ( | DoCommandFlags | flags, |
VehicleID | veh_id | ||
) |
Autoreplaces a vehicle Trains are replaced as a whole chain, free wagons in depot are replaced on their own.
flags | type of operation |
veh_id | Index of vehicle |
Definition at line 736 of file autoreplace_cmd.cpp.
References _current_company, CommandCost::AddCost(), CheckOwnership(), CMD_ERROR, Crashed, DoCmdStartStopVehicle(), Execute, EXPENSES_NEW_VEHICLES, CommandCost::Failed(), SpecializedVehicle< T, Type >::First(), Group::flags, SpecializedVehicle< T, Type >::From(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_group_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_vehicle_pool >::GetIfValid(), GetNewEngineType(), Vehicle::group_id, Vehicle::IsArticulatedPart(), Vehicle::IsChainInDepot(), Vehicle::IsFrontEngine(), Vehicle::IsPrimaryVehicle(), GroundVehicle< T, Type >::IsRearDualheaded(), Vehicle::IsStoppedInDepot(), Vehicle::owner, CompanySettings::renew_keep_length, ReplaceChain(), ReplaceFreeUnit(), ReplaceWagonRemoval, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), RestoreRandomSeeds(), SaveRandomSeeds(), CompanyProperties::settings, Stopped, CommandCost::Succeeded(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), BaseVehicle::type, VEH_TRAIN, and Vehicle::vehstatus.
CommandCost CmdSetAutoReplace | ( | DoCommandFlags | flags, |
GroupID | id_g, | ||
EngineID | old_engine_type, | ||
EngineID | new_engine_type, | ||
bool | when_old | ||
) |
Change engine renewal parameters.
flags | operation to perform |
id_g | engine group |
old_engine_type | old engine type |
new_engine_type | new engine type |
when_old | replace when engine gets old? |
Definition at line 824 of file autoreplace_cmd.cpp.
References _current_company, AddEngineReplacementForCompany(), CheckAutoreplaceValidity(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_group_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::GetIfValid(), GetWindowClassForVehicleType(), InvalidateAutoreplaceWindow(), IsAllGroupID(), IsLocalCompany(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_engine_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_group_pool >::IsValidID(), RemoveEngineReplacementForCompany(), SetWindowDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), GroupStatistics::UpdateAutoreplace(), VL_GROUP_LIST, and WC_REPLACE_VEHICLE.