public static void RemoveSaleGoodsItems(GameClient client) { List <GoodsData> goodsDataList = client.ClientData.SaleGoodsDataList; if (null != goodsDataList) { lock (goodsDataList) { for (int i = 0; i < goodsDataList.Count; i++) { SaleGoodsManager.RemoveSaleGoodsItem(goodsDataList[i].Id); } } } }
public static void AddSaleGoodsItems(GameClient client) { List <GoodsData> goodsDataList = client.ClientData.SaleGoodsDataList; if (null != goodsDataList) { lock (goodsDataList) { for (int i = 0; i < goodsDataList.Count; i++) { if (goodsDataList[i].Binding <= 0) { SaleGoodsItem saleGoodsItem = new SaleGoodsItem { GoodsDbID = goodsDataList[i].Id, SalingGoodsData = goodsDataList[i], Client = client }; SaleGoodsManager.AddSaleGoodsItem(saleGoodsItem); } } } } }