public bool Deserialize(JSON_EventShopItemListSet json) { if (json == null || json.item == null || (string.IsNullOrEmpty(json.item.iname) || json.cost == null) || string.IsNullOrEmpty(json.cost.type)) { return(false); } this.id = json.id; this.iname = json.item.iname; this.num = json.item.num; this.max_num = json.item.maxnum; this.bougthnum = json.item.boughtnum; this.saleValue = json.cost.value; this.saleType = ShopData.String2SaleType(json.cost.type); this.cost_iname = json.cost.iname == null ? GlobalVars.EventShopItem.shop_cost_iname : json.cost.iname; if (this.saleType == ESaleType.EventCoin && this.cost_iname == null) { return(false); } this.is_reset = json.isreset == 1; this.start = json.start; this.end = json.end; this.is_soldout = json.sold > 0; if (json.children != null) { this.children = json.children; } if (json.children != null) { this.shopItemType = EShopItemType.Set; } else { this.shopItemType = ShopData.String2ShopItemType(json.item.itype); if (this.shopItemType == EShopItemType.Unknown) { this.shopItemType = ShopData.Iname2ShopItemType(json.item.iname); } } if (this.IsConceptCard) { MonoSingleton <GameManager> .Instance.Player.SetConceptCardNum(this.iname, json.item.has_count); } return(true); }
public EShopItemType GetShopItemTypeWithIType() { return(ShopData.String2ShopItemType(this.itype)); }