Beispiel #1
0
        public static string ShopItemType2String(EShopItemType itype)
        {
            switch (itype)
            {
            case EShopItemType.Item:
            case EShopItemType.Set:
                return("item");

            case EShopItemType.Artifact:
                return("artifact");

            case EShopItemType.ConceptCard:
                return("concept_card");

            default:
                DebugUtility.LogError(string.Format("不明な商品タイプです (itype => {0})", (object)itype));
                return(string.Empty);
            }
        }
Beispiel #2
0
 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;
     this.start      = json.start;
     this.end        = json.end;
     this.discount   = json.discount;
     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);
 }