Management of replacement lists. More...
#include "stdafx.h"#include "command_func.h"#include "group.h"#include "autoreplace_base.h"#include "core/pool_func.hpp"Go to the source code of this file.
Functions | |
| static EngineRenew * | GetEngineReplacement (EngineRenewList erl, EngineID engine, GroupID group) |
| Retrieves the EngineRenew that specifies the replacement of the given engine type from the given renewlist. | |
| 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. | |
Variables | |
| EngineRenewPool | _enginerenew_pool ("EngineRenew") |
| The pool of autoreplace "orders". | |
Management of replacement lists.
Definition in file autoreplace.cpp.
| 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. | |
| group | The group related to this replacement. | |
| flags | The calling command flags. |
Definition at line 82 of file autoreplace.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_enginerenew_pool >::CanAllocateItem(), CMD_ERROR, DC_EXEC, and GetEngineReplacement().
Referenced by AddEngineReplacementForCompany().
| 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. | |
| group | The group related to this replacement. |
Definition at line 63 of file autoreplace.cpp.
References ALL_GROUP, DEFAULT_GROUP, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >::Get(), GetEngineReplacement(), INVALID_ENGINE, and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >::IsValidID().
Referenced by EngineReplacementForCompany().
| void RemoveAllEngineReplacement | ( | EngineRenewList * | erl | ) |
Remove all engine replacement settings for the company.
| erl | The renewlist for a given company. |
Definition at line 42 of file autoreplace.cpp.
Referenced by RemoveAllEngineReplacementForCompany().
| 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. | |
| group | The group related to this replacement. | |
| flags | The calling command flags. |
Definition at line 113 of file autoreplace.cpp.
References CMD_ERROR, and DC_EXEC.
Referenced by RemoveEngineReplacementForCompany().
| EngineRenewPool _enginerenew_pool("EngineRenew") |
The pool of autoreplace "orders".
1.7.1