12 #ifndef AUTOREPLACE_FUNC_H 13 #define AUTOREPLACE_FUNC_H 67 bool replace_when_old;
69 return replace_when_old;
Definition of stuff that is very close to a company, like the company struct itself.
static EngineID EngineReplacementForCompany(const Company *c, EngineID engine, GroupID group, bool *replace_when_old=NULL)
Retrieve the engine replacement for the given company and original engine type.
EngineRenewList engine_renew_list
Engine renewals of this company.
static CommandCost AddEngineReplacementForCompany(Company *c, EngineID old_engine, EngineID new_engine, GroupID group, bool replace_when_old, DoCommandFlag flags)
Add an engine replacement for the company.
EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group, bool *replace_when_old=NULL)
Retrieve the engine replacement in a given renewlist for an original engine type. ...
Common return value for all commands.
Types related to commands.
bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
Checks some basic properties whether autoreplace is allowed.
DoCommandFlag
List of flags for a command.
uint16 GroupID
Type for all group identifiers.
void RemoveAllEngineReplacement(EngineRenewList *erl)
Remove all engine replacement settings for the company.
static bool EngineHasReplacementWhenOldForCompany(const Company *c, EngineID engine, GroupID group)
Check if a company has a replacement set up for the given engine when it gets old.
static void RemoveAllEngineReplacementForCompany(Company *c)
Remove all engine replacement settings for the given company.
static const EngineID INVALID_ENGINE
Constant denoting an invalid engine.
CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, DoCommandFlag flags)
Remove an engine replacement from a given renewlist.
uint16 EngineID
Unique identification number of an engine.
Struct to store engine replacements.
static bool EngineHasReplacementForCompany(const Company *c, EngineID engine, GroupID group)
Check if a company has a replacement set up for the given engine.
Owner
Enum for all companies/owners.
CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, bool replace_when_old, DoCommandFlag flags)
Add an engine replacement to the given renewlist.
static CommandCost RemoveEngineReplacementForCompany(Company *c, EngineID engine, GroupID group, DoCommandFlag flags)
Remove an engine replacement for the company.