コード例 #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);
            }
        }
コード例 #2
0
 public static void Reset()
 {
     set4p = 0;
     ShopAllList.Clear();
     ShopBuyableList.Clear();
     ShopUniqueList.Clear();
     ShopDataMt1.Clear();
     ShopDataMt2.Clear();
     ShopDataGoods.Clear();
     ShopDataItems.Clear();
     TotalGoods     = 0;
     TotalItems     = 0;
     TotalMatching1 = 0;
     TotalMatching2 = 0;
 }