Beispiel #1
0
 public bool Deserialize(JSON_ProductParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.mProductId          = json.product_id;
     this.mPlatform           = json.platform;
     this.mName               = json.name;
     this.mDescription        = json.description;
     this.mAdditionalPaidCoin = json.additional_paid_coin;
     this.mAdditionalFreeCoin = json.additional_free_coin;
     if (json.sale != null)
     {
         this.mSale                    = new ProductParam.ProductSaleInfo();
         this.mSale.Name               = !string.IsNullOrEmpty(json.sale.name) ? json.sale.name : string.Empty;
         this.mSale.Description        = !string.IsNullOrEmpty(json.sale.description) ? json.sale.description : string.Empty;
         this.mSale.AdditionalFreeCoin = json.sale.additional_free_coin > 0 ? json.sale.additional_free_coin : 0;
     }
     return(true);
 }
Beispiel #2
0
 public bool Deserialize(JSON_ProductParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.mProductId          = json.product_id;
     this.mPlatform           = json.platform;
     this.mName               = LocalizedText.Get(json.name);
     this.mDescription        = LocalizedText.Get(json.description);
     this.mAdditionalPaidCoin = json.additional_paid_coin;
     this.mAdditionalFreeCoin = json.additional_free_coin;
     if (json.sale != null)
     {
         this.mSale                    = new ProductParam.ProductSaleInfo();
         this.mSale.Name               = !string.IsNullOrEmpty(json.sale.name) ? LocalizedText.Get(json.sale.name) : string.Empty;
         this.mSale.Description        = !string.IsNullOrEmpty(json.sale.description) ? LocalizedText.Get(json.sale.description) : string.Empty;
         this.mSale.AdditionalFreeCoin = json.sale.additional_free_coin > 0 ? json.sale.additional_free_coin : 0;
     }
     this.mEnabled       = json.enabled;
     this.mRemainingDays = json.remaining_days;
     return(true);
 }