#include "autoreplace_type.h"
#include "company_base.h"
Go to the source code of this file.
Functions | |
| void | RemoveAllEngineReplacement (EngineRenewList *erl) |
| Remove all engine replacement settings for the company. | |
| EngineID | EngineReplacement (EngineRenewList erl, EngineID engine, GroupID group) |
| Retrieve the engine replacement in a given renewlist for an original engine type. | |
| CommandCost | AddEngineReplacement (EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, DoCommandFlag flags) |
| Add an engine replacement to the given renewlist. | |
| CommandCost | RemoveEngineReplacement (EngineRenewList *erl, EngineID engine, GroupID group, DoCommandFlag flags) |
| Remove an engine replacement from a given renewlist. | |
| static void | RemoveAllEngineReplacementForCompany (Company *c) |
| Remove all engine replacement settings for the given company. | |
| static EngineID | EngineReplacementForCompany (const Company *c, EngineID engine, GroupID group) |
| Retrieve the engine replacement for the given company and original engine type. | |
| static bool | EngineHasReplacementForCompany (const Company *c, EngineID engine, GroupID group) |
| Check if a company has a replacement set up for the given engine. | |
| static CommandCost | AddEngineReplacementForCompany (Company *c, EngineID old_engine, EngineID new_engine, GroupID group, DoCommandFlag flags) |
| Add an engine replacement for the company. | |
| static CommandCost | RemoveEngineReplacementForCompany (Company *c, EngineID engine, GroupID group, DoCommandFlag flags) |
| Remove an engine replacement for the company. | |
| bool | CheckAutoreplaceValidity (EngineID from, EngineID to, CompanyID company) |
| Checks some basic properties whether autoreplace is allowed. | |
Definition in file autoreplace_func.h.
| CommandCost AddEngineReplacement | ( | EngineRenewList * | erl, | |
| EngineID | old_engine, | |||
| EngineID | new_engine, | |||
| GroupID | group, | |||
| DoCommandFlag | flags | |||
| ) |
Add an engine replacement to the given renewlist.
| erl | The renewlist to add to. | |
| old_engine | The original engine type. | |
| new_engine | The replacement engine type. | |
| flags | The calling command flags. |
Definition at line 50 of file autoreplace.cpp.
References PoolItem< T, Tid, Tpool >::CanAllocateItem(), CMD_ERROR, DC_EXEC, GetEngineReplacement(), EngineRenew::group_id, EngineRenew::next, and EngineRenew::to.
Referenced by AddEngineReplacementForCompany().
| static CommandCost AddEngineReplacementForCompany | ( | Company * | c, | |
| EngineID | old_engine, | |||
| EngineID | new_engine, | |||
| GroupID | group, | |||
| DoCommandFlag | flags | |||
| ) | [inline, static] |
Add an engine replacement for the company.
| c | Company. | |
| old_engine | The original engine type. | |
| new_engine | The replacement engine type. | |
| flags | The calling command flags. |
Definition at line 86 of file autoreplace_func.h.
References AddEngineReplacement().
Referenced by CmdSetAutoReplace().
Checks some basic properties whether autoreplace is allowed.
| from | Origin engine | |
| to | Destination engine | |
| company | Company to check for |
Definition at line 41 of file autoreplace_cmd.cpp.
References AIR_CTOL, RailtypeInfo::compatible_railtypes, EF_ROAD_TRAM, EnginesGotCargoInCommon(), GetRailTypeInfo(), HasBit(), IsEngineBuildable(), and RAILVEH_WAGON.
Referenced by CmdSetAutoReplace(), and ReplaceVehicleWindow::GenerateReplaceVehList().
| static bool EngineHasReplacementForCompany | ( | const Company * | c, | |
| EngineID | engine, | |||
| GroupID | group | |||
| ) | [inline, static] |
Check if a company has a replacement set up for the given engine.
| c | Company. | |
| engine | Engine type to be replaced. |
Definition at line 73 of file autoreplace_func.h.
References EngineReplacementForCompany().
Referenced by ReplaceVehicleWindow::OnPaint().
| EngineID EngineReplacement | ( | EngineRenewList | erl, | |
| EngineID | engine, | |||
| GroupID | group | |||
| ) |
Retrieve the engine replacement in a given renewlist for an original engine type.
| erl | The renewlist to search in. | |
| engine | Engine type to be replaced. |
Definition at line 40 of file autoreplace.cpp.
References DEFAULT_GROUP, GetEngineReplacement(), and EngineRenew::to.
Referenced by EngineReplacementForCompany().
| static EngineID EngineReplacementForCompany | ( | const Company * | c, | |
| EngineID | engine, | |||
| GroupID | group | |||
| ) | [inline, static] |
Retrieve the engine replacement for the given company and original engine type.
| c | company. | |
| engine | Engine type. |
Definition at line 62 of file autoreplace_func.h.
References EngineReplacement().
Referenced by CheckSendAircraftToHangarForReplacement(), EngineHasReplacementForCompany(), ReplaceVehicleWindow::GenerateReplaceVehList(), AIGroup::GetEngineReplacement(), GetNewEngineType(), and ReplaceVehicleWindow::OnPaint().
| void RemoveAllEngineReplacement | ( | EngineRenewList * | erl | ) |
Remove all engine replacement settings for the company.
| erl | The renewlist for a given company. |
Definition at line 27 of file autoreplace.cpp.
References EngineRenew::next.
Referenced by RemoveAllEngineReplacementForCompany().
| static void RemoveAllEngineReplacementForCompany | ( | Company * | c | ) | [inline, static] |
Remove all engine replacement settings for the given company.
| c | the company. |
Definition at line 50 of file autoreplace_func.h.
References RemoveAllEngineReplacement().
| CommandCost RemoveEngineReplacement | ( | EngineRenewList * | erl, | |
| EngineID | engine, | |||
| GroupID | group, | |||
| DoCommandFlag | flags | |||
| ) |
Remove an engine replacement from a given renewlist.
| erl | The renewlist from which to remove the replacement | |
| engine | The original engine type. | |
| flags | The calling command flags. |
Definition at line 75 of file autoreplace.cpp.
References CMD_ERROR, DC_EXEC, EngineRenew::from, EngineRenew::group_id, and EngineRenew::next.
Referenced by RemoveEngineReplacementForCompany().
| static CommandCost RemoveEngineReplacementForCompany | ( | Company * | c, | |
| EngineID | engine, | |||
| GroupID | group, | |||
| DoCommandFlag | flags | |||
| ) | [inline, static] |
Remove an engine replacement for the company.
| c | Company. | |
| engine | The original engine type. | |
| flags | The calling command flags. |
Definition at line 98 of file autoreplace_func.h.
References RemoveEngineReplacement().
Referenced by CmdDeleteGroup(), and CmdSetAutoReplace().
1.5.6