Exemple #1
0
        private static TransactionResult BorrowLoan(int amount, int regionIndex)
        {
            TransactionResult result = TransactionResult.NONE;

            if (amount < 100)
            {
                result = TransactionResult.LOAN_REQUEST_TOO_LOW;
            }
            else if (amount > FormulaHelper.CalculateMaxBankLoan())
            {
                result = TransactionResult.LOAN_REQUEST_TOO_HIGH;
            }
            else
            {
                BankAccounts[regionIndex].loanTotal   += FormulaHelper.CalculateBankLoanRepayment(amount, regionIndex);
                BankAccounts[regionIndex].accountGold += amount;
                bankAccounts[regionIndex].loanDueDate  = DaggerfallUnity.Instance.WorldTime.DaggerfallDateTime.ToClassicDaggerfallTime() + loanRepayMinutes;
            }
            return(result);
        }