예제 #1
0
        private PurchaseType mPurchaseType; //the way this PurchasableVirtualItem is purchased.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="PurchasableVirtualItem"/> class.
        /// </summary>
        /// <param name="mName">Name</param>
        /// <param name="mDescription">Description.</param>
        /// <param name="mItemId">item identifier.</param>
        /// <param name="purchaseType">Type of the purchase.</param>
        public PurchasableVirtualItem(String mName, String mDescription, String mItemId,
            PurchaseType purchaseType)
            : base(mName, mDescription, mItemId)
        {
            mPurchaseType = purchaseType;
            mPurchaseType.setAssociatedItem(this);
        }
예제 #2
0
 /** Constructor
  *
  * @param equippingModel the way this <code>EquippableVG</code> is equipped - local, category,
  *                       or global
  * @param mName see parent
  * @param mDescription see parent
  * @param mItemId see parent
  * @param purchaseType see parent
  */
 public EquippableVG(EquippingModel equippingModel,
                     String mName, String mDescription,
                     String mItemId,
                     PurchaseType purchaseType) : base(mName, mDescription, mItemId, purchaseType){
     
     mEquippingModel = equippingModel;
 }
예제 #3
0
    /** Constructor
     *
     * @param goodItemId the itemId of the SingleUseVG associated with this pack.
     * @param amount the number of SingleUseVGs in the pack.
     * @param name see parent
     * @param description see parent
     * @param itemId see parent
     * @param purchaseType see parent
     */
    public SingleUsePackVG(String goodItemId, int amount,
                           String name, String description,
                           String itemId, PurchaseType purchaseType) : base(name, description, itemId, purchaseType) {
        

        mGoodItemId = goodItemId;
        mGoodAmount = amount;
    }
예제 #4
0
 /**
  * Constructor
  *
  * @param mName see parent
  * @param mDescription see parent
  * @param mItemId see parent
  * @param mCurrencyAmount the amount of currency in the pack
  * @param mCurrencyItemId the item id of the currency associated with this pack
  * @param purchaseType see parent
  */
 public VirtualCurrencyPack(String mName, String mDescription, String mItemId,
                            int mCurrencyAmount,
                            String mCurrencyItemId,
                            PurchaseType purchaseType) : base(mName, mDescription, mItemId, purchaseType){
     
     this.mCurrencyItemId = mCurrencyItemId;
     this.mCurrencyAmount = mCurrencyAmount;
 }
예제 #5
0
 /** Constructor
  *
  * @param goodItemId the itemId of the <code>VirtualGood</code> associated with this upgrade.
  * @param prevItemId the itemId of the <code>UpgradeVG</code> before, or if this is the first
  *                   <code>UpgradeVG</code> in the scale then the value is null.
  * @param nextItemId the itemId of the <code>UpgradeVG</code> after, or if this is the last
  *                   <code>UpgradeVG</code> in the scale then the value is null.
  * @param mName see parent
  * @param mDescription see parent
  * @param mItemId see parent
  * @param purchaseType see parent
  */
 public UpgradeVG(String goodItemId,
                  String prevItemId, String nextItemId,
                  String mName, String mDescription,
                  String mItemId,
                  PurchaseType purchaseType) : base(mName, mDescription, mItemId, purchaseType) {
     
     mGoodItemId = goodItemId;
     mPrevItemId = prevItemId;
     mNextItemId = nextItemId;
 }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PurchasableVirtualItem"/> class.
        /// </summary>
        /// <param name="jsonObject">The json object.</param>
        public PurchasableVirtualItem(JSONObject jsonObject)
            : base(jsonObject)
        {
            JSONObject purchasableObj = jsonObject[StoreJSONConsts.PURCHASABLE_ITEM];
            String purchaseType = purchasableObj[StoreJSONConsts.PURCHASE_TYPE].str;

            if (purchaseType == StoreJSONConsts.PURCHASE_TYPE_MARKET) {
            JSONObject marketItemObj =
                    purchasableObj[StoreJSONConsts.PURCHASE_MARKET_ITEM];

            mPurchaseType = new PurchaseWithMarket(new MarketItem(marketItemObj));
            } else if (purchaseType == StoreJSONConsts.PURCHASE_TYPE_VI) {
            String itemId = purchasableObj[StoreJSONConsts.PURCHASE_VI_ITEMID].str;
            int amount = (int)purchasableObj[StoreJSONConsts.PURCHASE_VI_AMOUNT].n;

            mPurchaseType = new PurchaseWithVirtualItem(itemId, amount);
            } else {
            SoomlaUtils.LogError(TAG, "IabPurchase type not recognized !");
            }

            if (mPurchaseType != null) {
            mPurchaseType.setAssociatedItem(this);
            }
        }
예제 #7
0
 /**
  * Constructor
  *
  * @param mName see parent
  * @param mDescription see parent
  * @param mItemId see parent
  * @param purchaseType see parent
  */
 public SingleUseVG(String mName, String mDescription, String mItemId, PurchaseType purchaseType)
     : base(mName, mDescription, mItemId, purchaseType)
 {
 }
예제 #8
0
 /**
  * Constructor
  *
  * @param mName see parent
  * @param mDescription see parent
  * @param mItemId see parent
  * @param purchaseType see parent
  */
 public VirtualGood(String mName, String mDescription,
                    String mItemId, PurchaseType purchaseType) : base(mName, mDescription, mItemId, purchaseType) {
 }
예제 #9
0
        private const String TAG = "SOOMLA LifetimeVG"; //used for Log messages

        #endregion Fields

        #region Constructors

        /** Constructor
         *
         * @param mName see parent
         * @param mDescription see parent
         * @param mItemId see parent
         * @param purchaseType see parent
         */
        public LifetimeVG(String mName, String mDescription,
            String mItemId,
            PurchaseType purchaseType)
            : base(mName, mDescription, mItemId, purchaseType)
        {
        }