示例#1
0
        /// <summary>
        /// Takes a curtain amount of <c>VirtualCurrency</c> according to the given amount and the definition of this pack.
        /// </summary>
        /// <param name="amount">the amount of the specific item to be taken.</param>
        /// <param name="notify">notify of change in user's balance of current virtual item.</param>
        public override int Take(int amount, bool notify)
        {
            VirtualCurrency currency = null;

            try {
                currency = (VirtualCurrency)StoreInfo.GetItemByItemId(CurrencyItemId);
            } catch (VirtualItemNotFoundException) {
                SoomlaUtils.LogError(TAG, "VirtualCurrency with itemId: " + CurrencyItemId +
                                     " doesn't exist! Can't take this pack.");
                return(0);
            }
            return(VirtualCurrencyStorage.Remove(currency, CurrencyAmount * amount, notify));
        }
示例#2
0
 /// <summary>
 /// Takes a curtain amount of this currency.
 /// </summary>
 /// <param name="amount">the amount of the specific item to be taken.</param>
 /// <param name="notify">notify of change in user's balance of current virtual item.</param>
 public override int Take(int amount, bool notify)
 {
     return(VirtualCurrencyStorage.Remove(this, amount, notify));
 }