public void Deserialize(GenericReader reader) { int version = reader.ReadInt(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { ExchangeTypeInfo etinfo = null; string fullname = reader.ReadString(); Type type = ScriptCompiler.FindTypeByFullName(fullname); foreach (ExchangeTypeInfo eti in InfoList) { if (eti.Type == type) { etinfo = eti; break; } } if (etinfo == null) etinfo = new ExchangeTypeInfo(typeof(Gold), "readerror"); etinfo.Deserialize(reader); etinfo.Category = this; } }
public BuySellGump(bool selling, ExchangeTypeInfo info) : base(true) { AddBackground(0, 0, 800, 495, 9250); AddBackground(275, 15, 250, 76, 9250); AddHtml(0, 32, 800, 18, Center("West Britain Exchange"), false, false); AddHtml(0, 53, 800, 18, Center(selling ? "Selling " : "Buying " + info.Name), false, false); AddBackground(30, 100, 175, 80, 9250); AddHtml(30, 114, 175, 20, Center("Bids"), false, false); AddBackground(15, 135, 200, 210, 9250); AddBackground(30, 150, 170, 180, 9250); string[] firstline = new string[] { "Price", "Quantity" }; int[] columns = new int[] { 70, 70 }; List<string> data = new List<string>(firstline); for (int i = 0; i < 5 && i < info.BuyInfoList.Count; i++) { data.Add(info.BuyInfoList[i].Price.ToString()); data.Add(info.BuyInfoList[i].Quantity.ToString()); } AddTable(45, 165, columns, data); AddBackground(600, 100, 175, 80, 9250); AddHtml(600, 112, 175, 20, Center("Offers"), false, false); AddBackground(585, 135, 200, 210, 9250); AddBackground(600, 148, 170, 180, 9250); data = new List<string>(firstline); for (int i = 0; i < 5 && i < info.SellInfoList.Count; i++) { data.Add(info.SellInfoList[i].Price.ToString()); data.Add(info.SellInfoList[i].Quantity.ToString()); } AddTable(615, 165, columns, data); AddBackground(15, 345, 200, 135, 9250); columns = new int[] { 70, 100 }; data = new List<string>(info.GetSalesInfo1); AddTable(30, 360, columns, data); AddBackground(585, 345, 200, 135, 9250); data = new List<string>(info.GetSalesInfo2); AddTable(600, 360, columns, data); AddBackground(215, 345, 370, 135, 9250); AddLabel(400, 320, 0, "Days"); AddLabel(250, 310, 0, "0"); AddLabel(560, 310, 0, "20"); AddLabel(245, 140, 0, "P"); AddLabel(220, 96, 0, info.HighestDayPrice == 0 ? "N/A" : info.HighestDayPrice.ToString()); AddLabel(220, 185, 0, info.LowestDayPrice == double.MaxValue ? "N/A" : info.LowestDayPrice.ToString()); AddLabel(245, 252, 0, "Q"); string str = ""; if (info.HighestDayQuantity == 0) str = "N/A"; else if (info.HighestDayQuantity > 1000000) str = (info.HighestDayQuantity / 1000000).ToString() + "M"; else if (info.HighestDayQuantity > 1000) str = (info.HighestDayQuantity / 1000).ToString() + "K"; else str = info.HighestDayQuantity.ToString(); AddLabel(220, 206, 0, str); AddImageTiled(265, 100, 3, 100, 2624); AddImageTiled(265, 150, 300, 1, 2624); AddImageTiled(265, 200, 300, 3, 2624); double conversion = 95 / (info.HighestDayPrice - info.LowestDayPrice); int locx = 0; foreach (ExchangeDay day in info.ExchangeDayList) { int height = (int)Math.Floor((day.Average - info.LowestDayPrice) * conversion); AddImage(265 + 12 + locx, 195 - height, 2103); locx += 15; } AddImageTiled(265, 210, 3, 100, 2624); AddImageTiled(265, 260, 300, 1, 2624); AddImageTiled(265, 310, 300, 3, 2624); conversion = 100 / (double)info.HighestDayQuantity; locx = 0; foreach (ExchangeDay day in info.ExchangeDayList) { int height = (int)Math.Floor(day.TotalQuantity * conversion); AddImageTiled(265 + locx, 310 - height, 15, height, 2624); locx += 15; } }
public SellInfo(CommodityDeed deed, Mobile mobile, ExchangeTypeInfo info) : base(mobile, info,deed.Commodity.Amount) { deed.Delete(); }
public BuySellInfo(Mobile mobile, ExchangeTypeInfo info, int quantity) { Quantity = quantity; Mobile = mobile; Info = info; Date = DateTime.Now; }
public BuySellInfo(Mobile mobile, ExchangeTypeInfo info) : this(mobile, info, 0) { }
public BuyInfo(Mobile mobile, ExchangeTypeInfo info) : base(mobile, info) { }