Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.SingleUsePackVG"/> class.
 /// </summary>
 /// <param name='goodItemId'>
 /// The itemId of the VirtualGood associated with this upgrade.
 /// </param>
 /// <param name='nextItemId'>
 /// The itemId of the UpgradeVG after or if this is the first UpgradeVG in the scale then the value is null.
 /// </param>
 /// <param name='prevItemId'>
 /// The itemId of the UpgradeVG before or if this is the first UpgradeVG in the scale then the value is null.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public UpgradeVG(string goodItemId, string nextItemId, string prevItemId, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.GoodItemId = goodItemId;
     this.PrevItemId = prevItemId;
     this.NextItemId = nextItemId;
 }
Exemplo n.º 2
0
		/// <summary>
		/// see parent
		/// </returns>
		protected PurchasableVirtualItem(JSONObject jsonItem) :
			base(jsonItem)
		{
			JSONObject purchasableObj = (JSONObject)jsonItem[JSONConsts.PURCHASABLE_ITEM];
			string purchaseType = purchasableObj[JSONConsts.PURCHASE_TYPE].str;

	        if (purchaseType == JSONConsts.PURCHASE_TYPE_MARKET) {
	            JSONObject marketItemObj = (JSONObject)purchasableObj[JSONConsts.PURCHASE_MARKET_ITEM];
	
	            PurchaseType = new PurchaseWithMarket(new MarketItem(marketItemObj));
	        } else if (purchaseType == JSONConsts.PURCHASE_TYPE_VI) {
	            string itemId = purchasableObj[JSONConsts.PURCHASE_VI_ITEMID].str;
	            int amount = System.Convert.ToInt32(((JSONObject)purchasableObj[JSONConsts.PURCHASE_VI_AMOUNT]).n);
	
				PurchaseType = new PurchaseWithVirtualItem(itemId, amount);
	        } else {
	            StoreUtils.LogError(TAG, "Couldn't determine what type of class is the given purchaseType.");
	        }
		}
Exemplo n.º 3
0
		protected PurchasableVirtualItem(AndroidJavaObject jniVirtualItem) :
			base(jniVirtualItem)
		{
			StoreUtils.LogDebug(TAG, "Trying to create PurchasableVirtualItem with itemId: " + jniVirtualItem.Call<string>("getItemId"));
			using(AndroidJavaObject jniPurchaseType = jniVirtualItem.Call<AndroidJavaObject>("getPurchaseType")) {
				System.IntPtr cls = AndroidJNI.FindClass("com/soomla/store/purchaseTypes/PurchaseWithMarket");
				if (AndroidJNI.IsInstanceOf(jniPurchaseType.GetRawObject(), cls)) {
					using(AndroidJavaObject jniMarketItem = jniPurchaseType.Call<AndroidJavaObject>("getGoogleMarketItem")) {
						PurchaseType = new PurchaseWithMarket(jniMarketItem.Call<string>("getProductId"), jniMarketItem.Call<double>("getPrice"));
					}
				} else {
					cls = AndroidJNI.FindClass("com/soomla/store/purchaseTypes/PurchaseWithVirtualItem");
					if (AndroidJNI.IsInstanceOf(jniPurchaseType.GetRawObject(), cls)) {
						string itemId = jniPurchaseType.Call<string>("getTargetItemId");
			            int amount = jniPurchaseType.Call<int>("getAmount");
						
						PurchaseType = new PurchaseWithVirtualItem(itemId, amount);
					} else {
						StoreUtils.LogError(TAG, "Couldn't determine what type of class is the given purchaseType.");
					}
				} 
			}
		}
Exemplo n.º 4
0
        /// <summary>
        /// see parent
        /// </returns>
        protected PurchasableVirtualItem(JSONObject jsonItem) :
            base(jsonItem)
        {
            JSONObject purchasableObj = (JSONObject)jsonItem[JSONConsts.PURCHASABLE_ITEM];
            string     purchaseType   = purchasableObj[JSONConsts.PURCHASE_TYPE].str;

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

                PurchaseType = new PurchaseWithMarket(new MarketItem(marketItemObj));
            }
            else if (purchaseType == JSONConsts.PURCHASE_TYPE_VI)
            {
                string itemId = purchasableObj[JSONConsts.PURCHASE_VI_ITEMID].str;
                int    amount = System.Convert.ToInt32(((JSONObject)purchasableObj[JSONConsts.PURCHASE_VI_AMOUNT]).n);

                PurchaseType = new PurchaseWithVirtualItem(itemId, amount);
            }
            else
            {
                StoreUtils.LogError(TAG, "Couldn't determine what type of class is the given purchaseType.");
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.LifetimeVG"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public LifetimeVG(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.SingleUsePackVG"/> class.
 /// </summary>
 /// <param name='goodItemId'>
 /// The itemId of the SingleUseVG associated with this pack.
 /// </param>
 /// <param name='amount'>
 /// The number of SingleUseVGs in the pack.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public SingleUsePackVG(string goodItemId, int amount, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.GoodItemId = goodItemId;
     this.GoodAmount = amount;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.NonConsumableItem"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public NonConsumableItem(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }
Exemplo n.º 8
0
		/// <summary>
		/// Initializes a new instance of the <see cref="com.soomla.unity.VirtualCurrencyPack"/> class.
		/// </summary>
		/// <param name='name'>
		/// see parent
		/// </param>
		/// <param name='description'>
		/// see parent
		/// </param>
		/// <param name='itemId'>
		/// see parent
		/// </param>
		/// <param name='currencyAmount'>
		/// The amount of currency in the pack.
		/// </param>
		/// <param name='currencyItemId'>
		/// The itemId of the currency associated with this pack.
		/// </param>
		/// <param name='purchaseType'>
		/// see parent
		/// </param>
		public VirtualCurrencyPack(string name, string description, string itemId, int currencyAmount, string currencyItemId, PurchaseType purchaseType)
			: base(name, description, itemId, purchaseType)
		{
			this.CurrencyAmount = currencyAmount;
			this.CurrencyItemId = currencyItemId;
		}
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.VirtualGood"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public VirtualGood(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.NonConsumableItem"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public NonConsumableItem(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }
Exemplo n.º 11
0
		/// <summary>
		/// Initializes a new instance of the <see cref="com.soomla.unity.LifetimeVG"/> class.
		/// </summary>
		/// <param name='name'>
		/// see parent
		/// </param>
		/// <param name='description'>
		/// see parent
		/// </param>
		/// <param name='itemId'>
		/// see parent
		/// </param>
		/// <param name='purchaseType'>
		/// see parent
		/// </param>
		public LifetimeVG(string name, string description, string itemId, PurchaseType purchaseType)
			: base(name, description, itemId, purchaseType)
		{
		}
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.EquippableVG"/> class.
 /// </summary>
 /// <param name='equippingModel'>
 /// The way this EquippableVG is equipped.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public EquippableVG(EquippingModel equippingModel, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.Equipping = equippingModel;
 }
Exemplo n.º 13
0
		/// <summary>
		/// Initializes a new instance of the <see cref="com.soomla.unity.SingleUseVG"/> class.
		/// </summary>
		/// <param name='name'>
		/// see parent
		/// </param>
		/// <param name='description'>
		/// see parent
		/// </param>
		/// <param name='itemId'>
		/// see parent
		/// </param>
		/// <param name='purchaseType'>
		/// see parent
		/// </param>
		public SingleUseVG(string name, string description, string itemId, PurchaseType purchaseType)
			: base(name, description, itemId, purchaseType)
		{
		}
Exemplo n.º 14
0
		/// <summary>
		/// Initializes a new instance of the <see cref="com.soomla.unity.PurchasableVirtualItem"/> class.
		/// </summary>
		/// <param name='name'>
		/// see parent
		/// </param>
		/// <param name='description'>
		/// see parent
		/// </param>
		/// <param name='itemId'>
		/// see parent
		/// </param>
		/// <param name='purchaseType'>
		/// The way this item is purchased.
		/// </param>
		protected PurchasableVirtualItem (string name, string description, string itemId, PurchaseType purchaseType) :
			base(name, description, itemId)
		{
			this.PurchaseType = purchaseType;
		}
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.PurchasableVirtualItem"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// The way this item is purchased.
 /// </param>
 protected PurchasableVirtualItem(string name, string description, string itemId, PurchaseType purchaseType) :
     base(name, description, itemId)
 {
     this.PurchaseType = purchaseType;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.VirtualCurrencyPack"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='currencyAmount'>
 /// The amount of currency in the pack.
 /// </param>
 /// <param name='currencyItemId'>
 /// The itemId of the currency associated with this pack.
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public VirtualCurrencyPack(string name, string description, string itemId, int currencyAmount, string currencyItemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.CurrencyAmount = currencyAmount;
     this.CurrencyItemId = currencyItemId;
 }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.SingleUseVG"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public SingleUseVG(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.SingleUsePackVG"/> class.
 /// </summary>
 /// <param name='goodItemId'>
 /// The itemId of the VirtualGood associated with this upgrade.
 /// </param>
 /// <param name='nextItemId'>
 /// The itemId of the UpgradeVG after or if this is the first UpgradeVG in the scale then the value is null.
 /// </param>
 /// <param name='prevItemId'>
 /// The itemId of the UpgradeVG before or if this is the first UpgradeVG in the scale then the value is null.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public UpgradeVG(string goodItemId, string nextItemId, string prevItemId, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.GoodItemId = goodItemId;
     this.PrevItemId = prevItemId;
     this.NextItemId = nextItemId;
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.SingleUsePackVG"/> class.
 /// </summary>
 /// <param name='goodItemId'>
 /// The itemId of the SingleUseVG associated with this pack.
 /// </param>
 /// <param name='amount'>
 /// The number of SingleUseVGs in the pack.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public SingleUsePackVG(string goodItemId, int amount, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.GoodItemId = goodItemId;
     this.GoodAmount = amount;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.EquippableVG"/> class.
 /// </summary>
 /// <param name='equippingModel'>
 /// The way this EquippableVG is equipped.
 /// </param>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public EquippableVG(EquippingModel equippingModel, string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
     this.Equipping = equippingModel;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="com.soomla.unity.VirtualGood"/> class.
 /// </summary>
 /// <param name='name'>
 /// see parent
 /// </param>
 /// <param name='description'>
 /// see parent
 /// </param>
 /// <param name='itemId'>
 /// see parent
 /// </param>
 /// <param name='purchaseType'>
 /// see parent
 /// </param>
 public VirtualGood(string name, string description, string itemId, PurchaseType purchaseType)
     : base(name, description, itemId, purchaseType)
 {
 }