diff options
author | Pavel Stupnikov <dp@dpointer.org> | 2020-01-15 20:46:26 +0300 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2020-01-15 18:46:26 +0100 |
commit | d7a928a08b0d614bc06f4a6e8a275582a100599f (patch) | |
tree | efd1163e334ea02f8ba5811df5ff4ca175c37374 /src/script/api/script_engine.hpp | |
parent | 4366f8e46a601aa1edaa5f5c3a7e41d453637b4c (diff) | |
download | openttd-d7a928a08b0d614bc06f4a6e8a275582a100599f.tar.xz |
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
Diffstat (limited to 'src/script/api/script_engine.hpp')
-rw-r--r-- | src/script/api/script_engine.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/script/api/script_engine.hpp b/src/script/api/script_engine.hpp index 4a570fb9c..f6bdbedbf 100644 --- a/src/script/api/script_engine.hpp +++ b/src/script/api/script_engine.hpp @@ -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 */ |