Esempio n. 1
0
        private static void LoadDataMatching1Goods(int cafe)
        {
            List <GoodItem> matchs = new List <GoodItem>(),
                            goods  = new List <GoodItem>();

            lock (ShopAllList)
            {
                for (int i = 0; i < ShopAllList.Count; i++)
                {
                    GoodItem good = ShopAllList[i];
                    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)
                };
                ShopDataMt1.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);
            }
        }