Ejemplo n.º 1
0
    /// <summary>
    /// When the corresponding button is clicked, get and display the current logged in gamer's history of the given currency.
    /// </summary>
    public void Button_DisplayCurrencyHistory()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string currencyName        = "TestCurrency";
        int    transactionsPerPage = 20;

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

        // Check the currenciesPerPage value
        if (displayCurrencyHistory_TransactionsPerPage == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Transaction", "displayCurrencyHistory_TransactionsPerPage"));
        }
        else if (!string.IsNullOrEmpty(displayCurrencyHistory_TransactionsPerPage.text))
        {
            transactionsPerPage = int.Parse(displayCurrencyHistory_TransactionsPerPage.text);
        }

        // Call the template method
        TransactionFeatures.Handling_DisplayCurrencyHistory(currencyName, transactionsPerPage);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// When the corresponding button is clicked, post a new transaction of the given currency for the current logged in gamer.
    /// </summary>
    public void Button_PostTransaction()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string currencyName           = "TestCurrency";
        float  currencyAmount         = 50f;
        string transactionDescription = "This is a test transaction";

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

        // Check the currencyAmount value
        if (postTransaction_CurrencyAmount == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Transaction", "postTransaction_CurrencyAmount"));
        }
        else if (!string.IsNullOrEmpty(postTransaction_CurrencyAmount.text))
        {
            currencyAmount = float.Parse(postTransaction_CurrencyAmount.text);
        }

        // Check the transactionDescription value
        if (postTransaction_TransactionDescription == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Transaction", "postTransaction_TransactionDescription"));
        }
        else
        {
            transactionDescription = postTransaction_TransactionDescription.text;
        }

        // Call the template method
        TransactionFeatures.Handling_PostTransaction(currencyName, currencyAmount, transactionDescription);
    }
Ejemplo n.º 3
0
 /// <summary>
 /// When the corresponding button is clicked, get and display the current logged in gamer currencies balance.
 /// </summary>
 public void Button_DisplayBalance()
 {
     // Call the template method
     TransactionFeatures.Handling_DisplayBalance();
 }