Example #1
0
    private void UpdateOrAddShop(GetShopInfos shopInfo)
    {
        bool flag = false;

        for (int i = 0; i < this.mShopInformations.get_Count(); i++)
        {
            if (this.mShopInformations.get_Item(i).shopInfo.shopId == shopInfo.shopId)
            {
                flag = true;
                this.mShopInformations.get_Item(i).shopInfo = shopInfo;
                this.mShopInformations.get_Item(i).ResetTimeCountDown(shopInfo.remainingRefreshTime);
                break;
            }
        }
        if (!flag)
        {
            MarketInformation marketInformation = new MarketInformation();
            marketInformation.shopInfo = shopInfo;
            marketInformation.ResetTimeCountDown(shopInfo.remainingRefreshTime);
            this.mShopInformations.Add(marketInformation);
        }
        if (ShoppingUIViewModel.Instance != null && ShoppingUIViewModel.Instance.get_gameObject().get_activeSelf())
        {
            ShoppingUIViewModel.Instance.RefreshShop(shopInfo);
        }
    }
Example #2
0
 public void RefreshShop(GetShopInfos shop)
 {
     if (BaseMarketManager.mMarketClass != MarketClass.MarketManager)
     {
         return;
     }
     if (shop == null)
     {
         return;
     }
     if (shop.shopId == MarketManager.Instance.CurrentShopID)
     {
         this.ShiftType = ListShifts.GetShift(5, this.CurrentPageIndex, true);
         this.RefreshInfo(shop.remainingRefreshTime, shop.remainRefresh);
         if (shop.shopId == 3)
         {
             this.RefreshItemList1(shop.commodities);
         }
         else if (shop.shopId == 2)
         {
             this.RefreshItemList2(shop.commodities);
         }
         else
         {
             Debug.LogError("请根据商店类型设置商品列表类型!");
         }
     }
 }
Example #3
0
    public bool IsFleaShopOpen()
    {
        GetShopInfos shop = this.GetShop(3);

        if (shop != null)
        {
            int openLv = shop.openLv;
            if (EntityWorld.Instance.EntSelf.Lv >= openLv)
            {
                return(true);
            }
        }
        return(this.IsShopFlagExist(3));
    }
Example #4
0
    public CommodityInfo GetCommodityInfo(int commodityId)
    {
        GetShopInfos shop = this.GetShop(this.CurrentShopID);

        if (shop != null)
        {
            List <CommodityInfo> commodities = shop.commodities;
            for (int i = 0; i < commodities.get_Count(); i++)
            {
                if (commodities.get_Item(i).commodityId == commodityId)
                {
                    return(commodities.get_Item(i));
                }
            }
        }
        return(null);
    }