コード例 #1
0
ファイル: ShopItem.cs プロジェクト: zunaalabaya/TAC-BOT
 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);
 }
コード例 #2
0
ファイル: ShopItem.cs プロジェクト: zunaalabaya/TAC-BOT
 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);
 }