Example #1
0
        public VirtualGood(AndroidJavaObject jniVirtualGood)
            : base(jniVirtualGood)
        {
            // Virtual Category
            using(AndroidJavaObject jniVirtualCategory = jniVirtualGood.Call<AndroidJavaObject>("getCategory")) {
                this.Category = new VirtualCategory(jniVirtualCategory);
            }

            // Price Model
            using(AndroidJavaObject jniPriceModel = jniVirtualGood.Call<AndroidJavaObject>("getPriceModel")) {
                this.PriceModel = AbstractPriceModel.CreatePriceModel(jniPriceModel);
            }
        }
Example #2
0
 public VirtualGood(JSONObject jsonVg)
     : base(jsonVg)
 {
     this.PriceModel = AbstractPriceModel.CreatePriceModel((JSONObject)jsonVg[JSONConsts.GOOD_PRICE_MODEL]);
     int categoryId = System.Convert.ToInt32(((JSONObject)jsonVg[JSONConsts.GOOD_CATEGORY_ID]).n);
     try {
         if (categoryId > -1) {
             this.Category = StoreInfo.GetVirtualCategoryById(categoryId);
         }
     } catch (VirtualItemNotFoundException e) {
         Debug.Log("Couldn't find category with id: " + categoryId);
     }
 }
Example #3
0
 public VirtualGood(string name, string description, AbstractPriceModel priceModel, string itemId, VirtualCategory category)
     : base(name, description, itemId)
 {
     this.PriceModel = priceModel;
     this.Category = category;
 }