Esempio n. 1
0
        public bool LOBBY2CLIENT_LIMIT_GOODS_RESP(Observers.Interfaces.INotification note)
        {
            LimitGoodsResp limitGoodsResp = note.Body as LimitGoodsResp;

            List <ShopActionItemInfo> shopActionItemInfoList = ShopProxy.instance.ShopActionItemInfoDic.GetValues();
            int shopActionItemInfoCount = shopActionItemInfoList.Count;

            for (int i = 0; i < shopActionItemInfoCount; i++)
            {
                shopActionItemInfoList[i].UpdateInfo(false, 0);
            }
            List <ShopGoldItemInfo> shopGoldItemInfoList = ShopProxy.instance.ShopGoldItemInfoDic.GetValues();
            int shopGoldItemInfoCount = shopGoldItemInfoList.Count;

            for (int i = 0; i < shopGoldItemInfoCount; i++)
            {
                shopGoldItemInfoList[i].UpdateInfo(false, 0);
            }


            List <LimitGoodsProto> limitGoodsProtoList = limitGoodsResp.goods;
            int limitGoodsProtoCount = limitGoodsProtoList.Count;

            for (int i = 0; i < limitGoodsProtoCount; i++)
            {
                int limitItemID = limitGoodsProtoList[i].goodsNo;
                ShopActionItemInfo shopActionItemInfo = null;
                ShopGoldItemInfo   shopGoldItemInfo   = null;
                ShopProxy.instance.ShopActionItemInfoDic.TryGetValue(limitItemID, out shopActionItemInfo);
                ShopProxy.instance.ShopGoldItemInfoDic.TryGetValue(limitItemID, out shopGoldItemInfo);

                if (shopActionItemInfo != null)
                {
                    shopActionItemInfo.UpdateInfo(true, limitGoodsProtoList[i].remianPurchaseTimes);
                }
                else if (shopGoldItemInfo != null)
                {
                    shopGoldItemInfo.UpdateInfo(true, limitGoodsProtoList[i].remianPurchaseTimes);
                }
            }
            ShopProxy.instance.OnShopActionItemInfoListUpdate();
            ShopProxy.instance.OnShopGoldItemInfoListUpdate();
            return(true);
        }
Esempio n. 2
0
        public bool LOBBY2CLIENT_LIMIT_GOODS_UPDATE_RESP(Observers.Interfaces.INotification note)
        {
            LimitGoodsUpdateResp   limitGoodsUpdateResp   = note.Body as LimitGoodsUpdateResp;
            List <LimitGoodsProto> addLimitGoodsProtoList = limitGoodsUpdateResp.addGoods;
            int addLimitGoodsProtoCount = addLimitGoodsProtoList.Count;

            for (int i = 0; i < addLimitGoodsProtoCount; i++)
            {
                int shopItemID = addLimitGoodsProtoList[i].goodsNo;
                ShopActionItemInfo shopActionItemInfo = null;
                ShopGoldItemInfo   shopGoldItemInfo   = null;
                ShopProxy.instance.ShopActionItemInfoDic.TryGetValue(shopItemID, out shopActionItemInfo);
                ShopProxy.instance.ShopGoldItemInfoDic.TryGetValue(shopItemID, out shopGoldItemInfo);

                if (shopActionItemInfo != null)
                {
                    shopActionItemInfo.UpdateInfo(true, addLimitGoodsProtoList[i].remianPurchaseTimes);
                }
                else if (shopGoldItemInfo != null)
                {
                    shopGoldItemInfo.UpdateInfo(true, addLimitGoodsProtoList[i].remianPurchaseTimes);
                }
            }

            int deleteShopItemID = limitGoodsUpdateResp.delGoods;
            ShopActionItemInfo deleteShopActionItemInfo = null;
            ShopGoldItemInfo   deleteShopGoldItemInfo   = null;

            ShopProxy.instance.ShopActionItemInfoDic.TryGetValue(deleteShopItemID, out deleteShopActionItemInfo);
            ShopProxy.instance.ShopGoldItemInfoDic.TryGetValue(deleteShopItemID, out deleteShopGoldItemInfo);

            if (deleteShopActionItemInfo != null)
            {
                deleteShopActionItemInfo.UpdateInfo(false, 0);
            }
            else if (deleteShopGoldItemInfo != null)
            {
                deleteShopGoldItemInfo.UpdateInfo(false, 0);
            }

            LimitGoodsProto updateLimitGoodsProto = limitGoodsUpdateResp.updateGoods;

            if (updateLimitGoodsProto != null)
            {
                ShopActionItemInfo updateShopActionItemInfo = null;
                ShopGoldItemInfo   updateShopGoldItemInfo   = null;
                ShopProxy.instance.ShopActionItemInfoDic.TryGetValue(updateLimitGoodsProto.goodsNo, out updateShopActionItemInfo);
                ShopProxy.instance.ShopGoldItemInfoDic.TryGetValue(updateLimitGoodsProto.goodsNo, out updateShopGoldItemInfo);
                if (updateShopActionItemInfo != null)
                {
                    updateShopActionItemInfo.UpdateInfo(updateShopActionItemInfo.IsOpen, updateLimitGoodsProto.remianPurchaseTimes);
                }
                else if (updateShopGoldItemInfo != null)
                {
                    updateShopGoldItemInfo.UpdateInfo(updateShopGoldItemInfo.IsOpen, updateLimitGoodsProto.remianPurchaseTimes);
                }
            }

            ShopProxy.instance.OnShopActionItemInfoListUpdate();
            ShopProxy.instance.OnShopGoldItemInfoListUpdate();
            return(true);
        }