public static void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            int count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                ExchangeCategory cat = null;
                int id = reader.ReadInt();
                foreach (ExchangeCategory ec in CategoryList)
                    if (ec.ID == id)
                    {
                        cat = ec;
                        break;
                    }

                if (cat == null)
                    cat = new ExchangeCategory(0, "readerror", 0);

                cat.Deserialize(reader);
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                Mobile m = reader.ReadMobile();

                List<TransactionInfo> lti = new List<TransactionInfo>();
                int countlti = reader.ReadInt();
                for (int j = 0; j < countlti; j++)
                    lti.Add(new TransactionInfo(reader));

                if (m != null && !m.Deleted)
                    TransactionHistory.Add(m, lti);
            }
        }
        public EntryGump(ExchangeCategory cat)
            : base(true)
        {
            m_Category = cat;

            int infos = cat.InfoList.Count;
            int infolength = 18 * infos;
            int totlength = infolength + 240;
            AddBackground(0, 0, 600, totlength, 2600);
            AddBackground(150, 30, 300, 90, 2600);
            AddHtml(0, 50, 600, 18, Center("West Britain Exchange"), false, false);
            AddHtml(0, 70, 600, 18, Center(cat.Name), false, false);
            //AddBackground(195, 48, 160, 50, 3000);

            int[] columns = new int[] { 35, 35, 170, 90, 90, 90 };
            string[] firstline = new string[] { "Bid", "Sell", "Commodity", "Bids", "Offers", "Average Price" };

            List<string> data = new List<string>(firstline);

            //150
            int count = 0;
            foreach (ExchangeTypeInfo il in cat.InfoList)
            {
                AddButton(45, 168 + 18 * count, 4005, 4006, 100 + count, GumpButtonType.Reply, 0);
                AddButton(80, 168 + 18 * count, 4005, 4006, 200 + count, GumpButtonType.Reply, 0);
                data.Add("");
                data.Add("");
                data.Add(il.Name);
                data.Add(il.BuyInfoList.Count.ToString());
                data.Add(il.SellInfoList.Count.ToString());
                data.Add(il.AveragePrice.ToString());
                count++;
            }

            AddTable(45, 150, columns, data);

            AddButton(55, totlength - 45, 4011, 4012, 1, GumpButtonType.Reply, 0);
            AddLabel(94, totlength - 45, 0, "Information");
            AddButton(520, totlength - 45, 4011, 4012, 2, GumpButtonType.Reply, 0);
            AddLabel(360, totlength - 45, 0, "View My Offers/Biddings");
        }
 public InternalTarget(ExchangeCategory cat)
     : base(12, false, TargetFlags.None)
 {
     m_Category = cat;
 }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            int id = reader.ReadInt();
            foreach (ExchangeCategory ec in ExchangeSystem.CategoryList)
            {
                if (ec.ID == id)
                {
                    ECategory = ec;
                    m_Category = (Config.NPCCategories)id;
                    break;
                }
            }

            if (ECategory == null)
                Delete();
        }