Esempio n. 1
0
        public static ESaleType IntToESaleType(int val)
        {
            ESaleType _rVal = ESaleType.OFF;

            if (val == null)
            {
                return(ESaleType.OFF);
            }
            switch (val)
            {
            case -1:
                _rVal = ESaleType.NULL;
                break;

            case 0:
                _rVal = ESaleType.OFF;
                break;

            case 1:
                _rVal = ESaleType.ON;
                break;

            default:
                break;
            }

            return(_rVal);
        }
Esempio n. 2
0
        public int GetBuyNum(ESaleType type)
        {
            switch (type)
            {
            case ESaleType.Gold:
                return(this.buy);

            case ESaleType.Coin:
                return(this.coin);

            case ESaleType.TourCoin:
                return(this.tour_coin);

            case ESaleType.ArenaCoin:
                return(this.arena_coin);

            case ESaleType.PiecePoint:
                return(this.piece_point);

            case ESaleType.MultiCoin:
                return(this.multi_coin);

            case ESaleType.EventCoin:
                return(0);

            case ESaleType.Coin_P:
                return(this.coin);

            default:
                return(0);
            }
        }
Esempio n. 3
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.saleType   = ShopData.String2SaleType(json.cost.type);
     this.is_soldout = json.sold > 0;
     return(true);
 }
Esempio n. 4
0
 public bool Deserialize(JSON_ShopParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.iname          = json.iname;
     this.UpdateCostType = (ESaleType)json.upd_type;
     this.UpdateCosts    = (int[])null;
     if (json.upd_costs != null && json.upd_costs.Length > 0)
     {
         this.UpdateCosts = new int[json.upd_costs.Length];
         for (int index = 0; index < json.upd_costs.Length; ++index)
         {
             this.UpdateCosts[index] = json.upd_costs[index];
         }
     }
     return(true);
 }
Esempio n. 5
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;
     if (json.children != null)
     {
         this.children = json.children;
     }
     return(true);
 }
Esempio n. 6
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);
 }
Esempio n. 7
0
    public static bool TrackSpendShopUpdate(ESaleType sale_type, EShopType shop_type, int value)
    {
        string name = "ShopUpdate." + shop_type.ToString();

        return(MyMetaps.TrackSpend(sale_type.ToString(), name, value));
    }