Add: [GS] Allow to set max loan for each company separately (#11224)
This commit is contained in:
@@ -217,12 +217,38 @@ public:
|
||||
static Money GetLoanAmount();
|
||||
|
||||
/**
|
||||
* Gets the maximum amount your company can loan.
|
||||
* Gets the maximum amount your company can loan. In deity mode returns the global max loan.
|
||||
* @return The maximum amount your company can loan.
|
||||
* @post GetLoanInterval() is always a multiplier of the return value.
|
||||
*/
|
||||
static Money GetMaxLoanAmount();
|
||||
|
||||
/**
|
||||
* Sets the max amount of money company can loan.
|
||||
* @param company The company ID.
|
||||
* @param amount Max loan amount. Will be rounded down to a multiple of GetLoanInterval().
|
||||
* @return True, if the max loan was changed.
|
||||
* @pre ScriptCompanyMode::IsDeity().
|
||||
* @pre amount >= 0.
|
||||
* @pre ResolveCompanyID(company) != COMPANY_INVALID.
|
||||
* @note You need to create your own news message to inform about max loan change.
|
||||
* @note Max loan value set with this method is not affected by inflation.
|
||||
* @api -ai
|
||||
*/
|
||||
static bool SetMaxLoanAmountForCompany(CompanyID company, Money amount);
|
||||
|
||||
/**
|
||||
* Makes the max amount of money company can loan follow the global max loan setting.
|
||||
* @param company The company ID.
|
||||
* @return True, if the max loan was reset.
|
||||
* @pre ScriptCompanyMode::IsDeity().
|
||||
* @pre amount >= 0 && amount <= MAX_LOAN_LIMIT.
|
||||
* @pre ResolveCompanyID(company) != COMPANY_INVALID.
|
||||
* @note You need to create your own news message to inform about max loan change.
|
||||
* @api -ai
|
||||
*/
|
||||
static bool ResetMaxLoanAmountForCompany(CompanyID company);
|
||||
|
||||
/**
|
||||
* Gets the interval/loan step.
|
||||
* @return The loan step.
|
||||
|
||||
Reference in New Issue
Block a user