public bool Deserialize(Json_ShopItem 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.saleType = ShopData.String2SaleType(json.cost.type); this.is_soldout = json.sold > 0; return(true); }
public bool Deserialize(Json_ShopItem 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.is_reset = json.isreset == 1; this.is_soldout = json.sold > 0; if (json.children != null) { this.children = json.children; } return(true); }