/// <summary>
    /// When the corresponding button is clicked, convert a logged in gamer's anonymous account to an email one with the given credentials.
    /// </summary>
    public void Button_ConvertAnonymousToEmail()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string email    = "*****@*****.**";
        string password = "******";

        // Check the email value
        if (convertAnonymousToEmail_Email == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "convertAnonymousToEmail_Email"));
        }
        else if (!string.IsNullOrEmpty(convertAnonymousToEmail_Email.text))
        {
            email = convertAnonymousToEmail_Email.text;
        }

        // Check the password value
        if (convertAnonymousToEmail_Password == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "convertAnonymousToEmail_Password"));
        }
        else if (!string.IsNullOrEmpty(convertAnonymousToEmail_Password.text))
        {
            password = convertAnonymousToEmail_Password.text;
        }

        // Call the template method
        AccountFeatures.Handling_ConvertAnonymousToEmail(email, password);
    }
    /// <summary>
    /// When the corresponding button is clicked, send an email to a gamer who has lost its email account's password.
    /// </summary>
    public void Button_SendLostPasswordEmail()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string toEmailAddress   = "*****@*****.**";
        string fromEmailAddress = "*****@*****.**";
        string emailTitle       = "Lost password - Your login short code";
        string emailBody        = string.Format("Please use this code: [[SHORTCODE]]");

        // Check the toEmailAddress value
        if (sendLostPasswordEmail_ToEmailAddress == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "sendLostPasswordEmail_ToEmailAddress"));
        }
        else if (!string.IsNullOrEmpty(sendLostPasswordEmail_ToEmailAddress.text))
        {
            toEmailAddress = sendLostPasswordEmail_ToEmailAddress.text;
        }

        // Check the fromEmailAddress value
        if (sendLostPasswordEmail_FromEmailAddress == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "sendLostPasswordEmail_FromEmailAddress"));
        }
        else if (!string.IsNullOrEmpty(sendLostPasswordEmail_FromEmailAddress.text))
        {
            fromEmailAddress = sendLostPasswordEmail_FromEmailAddress.text;
        }

        // Check the emailTitle value
        if (sendLostPasswordEmail_EmailTitle == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "sendLostPasswordEmail_EmailTitle"));
        }
        else if (!string.IsNullOrEmpty(sendLostPasswordEmail_EmailTitle.text))
        {
            emailTitle = sendLostPasswordEmail_EmailTitle.text;
        }

        // Check the emailBody value
        if (sendLostPasswordEmail_EmailBody == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "sendLostPasswordEmail_EmailBody"));
        }
        else if (!string.IsNullOrEmpty(sendLostPasswordEmail_EmailBody.text))
        {
            emailBody = sendLostPasswordEmail_EmailBody.text;
        }

        // Call the template method
        AccountFeatures.Handling_SendLostPasswordEmail(toEmailAddress, fromEmailAddress, emailTitle, emailBody);
    }
    /// <summary>
    /// When the corresponding button is clicked, change a logged in gamer's email account's password.
    /// </summary>
    public void Button_ChangeEmailPassword()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string newPassword = "******";

        // Check the newEmailAddress value
        if (changeEmailPassword_NewPassword == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Account", "changeEmailPassword_NewPassword"));
        }
        else if (!string.IsNullOrEmpty(changeEmailPassword_NewPassword.text))
        {
            newPassword = changeEmailPassword_NewPassword.text;
        }

        // Call the template method
        AccountFeatures.Handling_ChangeEmailPassword(newPassword);
    }
Exemple #4
0
        /// <summary>
        /// Gets a bonus after withdrawal an <paramref name="amount"/> from the <paramref name="bankAccount"/>.
        /// </summary>
        /// <param name="bankAccount">A bank account.</param>
        /// <param name="amount">An amount.</param>
        /// <returns>A bonus.</returns>
        public int GetBonuxFromWithdrawal(BankAccount bankAccount, decimal amount)
        {
            AccountFeatures features = new AccountFeatures(bankAccount.Type);

            return((int)(0.1m * amount / features.WithdrawalPrice));
        }
Exemple #5
0
        /// <summary>
        /// Gets a bonus after refill <paramref name="bankAccount"/> by the <paramref name="amount"/>.
        /// </summary>
        /// <param name="bankAccount">A bank account.</param>
        /// <param name="amount">An amount.</param>
        /// <returns>A bonus.</returns>
        public int GetBonusFromRefill(BankAccount bankAccount, decimal amount)
        {
            AccountFeatures features = new AccountFeatures(bankAccount.Type);

            return((int)(0.1m * amount / features.RefillPrice));
        }