public static void LoadDataMatching2() { int cafe = 1; List <GoodItem> basic = new List <GoodItem>(); List <GoodItem> premium = new List <GoodItem>(); lock (ShopAllList) { foreach (GoodItem good in ShopAllList) { if (good.item.count == 0) { continue; } if (!(good.tag == 4 && cafe == 0) && (good.tag == 4 && cafe > 0 || good.visibility != 2)) { basic.Add(good); } //if (good.tag == 6 && good.visibility != 2) //{ // premium.Add(good); //} } } TotalMatching2 = basic.Count; int Pages = (int)Math.Ceiling(basic.Count / 741d); int count = 0; for (int i = 0; i < Pages; i++) { byte[] buffer = GetMatchingData(741, i, ref count, basic); ShopData data = new ShopData { Buffer = buffer, ItemsCount = count, Offset = i * 741 }; ShopPccafeBasic.Add(data); } //TotalMatching3 = premium.Count; //Pages = (int)Math.Ceiling(premium.Count / 741d); //for (int i = 0; i < Pages; i++) //{ // byte[] buffer = GetMatchingData(741, i, ref count, premium); // ShopData data = new ShopData // { // Buffer = buffer, // ItemsCount = count, // Offset = i * 741 // }; // ShopPccafePremium.Add(data); //} }
public static void LoadDataMatching1Goods() { int cafe = 0; List <GoodItem> matchs = new List <GoodItem>(); List <GoodItem> goods = new List <GoodItem>(); lock (ShopAllList) { foreach (GoodItem good in ShopAllList) { if (good.item.count == 0) { continue; } if (!(good.tag == 4 && cafe == 0) && (good.tag == 4 && cafe > 0 || good.visibility != 2)) { matchs.Add(good); } if (good.visibility < 2 || good.visibility == 4) { goods.Add(good); } } } TotalMatching1 = matchs.Count; TotalGoods = goods.Count; int Pages = (int)Math.Ceiling(matchs.Count / 741d); int count = 0; for (int i = 0; i < Pages; i++) { byte[] buffer = GetMatchingData(741, i, ref count, matchs); ShopData data = new ShopData { Buffer = buffer, ItemsCount = count, Offset = i * 741 }; ShopDataMatch.Add(data); } Pages = (int)Math.Ceiling(goods.Count / 592d); for (int i = 0; i < Pages; i++) { byte[] buffer = GetGoodsData(592, i, ref count, goods); ShopData data = new ShopData { Buffer = buffer, ItemsCount = count, Offset = i * 592 }; ShopDataGoods.Add(data); } }