Beispiel #1
0
 /// <summary>
 /// Adds a new currency stash.
 /// </summary>
 /// <param name="currency">The currency to add.</param>
 public void AddCurrency(QI_Currency currency)
 {
     if (!Currencies.ContainsKey(currency.Name))
     {
         Currencies.Add(currency.Name, new QI_CurrencyStash {
             Currency = currency, Amount = 0
         });
     }
 }
Beispiel #2
0
        /// <summary>
        /// Adds currency to a stash, adding a new stash if it doesn't exist.
        /// </summary>
        /// <param name="currency">The currency to add.</param>
        /// <param name="amount">The amount to add.</param>
        public void AddCurrency(QI_Currency currency, float amount)
        {
            if (!Currencies.ContainsKey(currency.Name))
            {
                Currencies.Add(currency.Name, new QI_CurrencyStash {
                    Currency = currency, Amount = 0
                });
            }

            QI_CurrencyStash stash = Currencies[currency.Name];

            stash.Amount += amount;
            Currencies[currency.Name] = stash;
        }