Feature: GS method to control engine availability for a specific company (#7791)

* Feature: GS method to allow company to use an engine before its introduction date

* Feature: GS method to retire an engine early for a specific company
This commit is contained in:
Pavel Stupnikov
2020-01-15 20:46:26 +03:00
committed by Niels Martin Hansen
parent 4366f8e46a
commit d7a928a08b
7 changed files with 122 additions and 9 deletions

View File

@@ -287,6 +287,29 @@ public:
* @see ScriptOrder::GetOrderDistance
*/
static uint GetMaximumOrderDistance(EngineID engine_id);
/**
* Allows a company to use an engine before its intro date or after retirement.
* @param engine_id The engine to enable.
* @param company_id The company to allow using the engine.
* @pre IsValidEngine(engine_id).
* @pre ScriptCompany.ResolveCompanyID(company_id) != ScriptCompany::COMPANY_INVALID.
* @return True if the action succeeded.
* @api -ai
*/
static bool EnableForCompany(EngineID engine_id, ScriptCompany::CompanyID company_id);
/**
* Forbids a company to use an engine before its natural retirement.
* @param engine_id The engine to disable.
* @param company_id The company to forbid using the engine.
* @pre IsValidEngine(engine_id).
* @pre ScriptCompany.ResolveCompanyID(company_id) != ScriptCompany::COMPANY_INVALID.
* @return True if the action succeeded.
* @api -ai
*/
static bool DisableForCompany(EngineID engine_id, ScriptCompany::CompanyID company_id);
};
#endif /* SCRIPT_ENGINE_HPP */