10#ifndef AUTOREPLACE_FUNC_H
11#define AUTOREPLACE_FUNC_H
34 return er !=
nullptr && engine != er->
to;
CommandCost AddEngineReplacement(DoCommandFlags flags, CompanyID company, GroupID group, EngineID engine, EngineID new_engine, bool replace_when_old)
Add an engine replacement to the given renewlist.
void RemoveAllEngineReplacementForCompany(CompanyID company)
Remove all engine replacements for a company.
bool EngineHasReplacement(CompanyID company, GroupID group, EngineID engine, bool search)
Check if a company has a replacement set up for the given engine.
bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
Checks some basic properties whether autoreplace is allowed.
const EngineRenew * GetEngineRenew(const EngineRenewList &erl, EngineID engine)
Search within a single engine renew list for an engine to renew.
bool EngineHasReplacementWhenOld(CompanyID company, GroupID group, EngineID engine, bool search)
Check if a company has a replacement set up for the given engine when it gets old.
CommandCost RemoveEngineReplacement(DoCommandFlags flags, CompanyID company, GroupID group, EngineID engine)
Remove an engine replacement from a given renewlist.
Types related to autoreplacing.
std::vector< EngineRenew > EngineRenewList
A list to group EngineRenew directives together (such as per-company).
Common return value for all commands.
Types related to commands.
EnumBitSet< DoCommandFlag, uint16_t > DoCommandFlags
Bitset of DoCommandFlag elements.
PoolID< uint16_t, struct EngineIDTag, 64000, 0xFFFF > EngineID
Unique identification number of an engine.
Information about engine autorenews and autoreplacements.
EngineID to
Engine to replace to.
bool replace_when_old
Do replacement only when vehicle is old.