public EventPrizeConfirmGump(Mobile mobile, PrizeDefinition prizeDefinition) : base(110, 100) { m_prizeDefinition = prizeDefinition; mobile.CloseGump(typeof(EventPrizeConfirmGump)); mobile.CloseGump(typeof(EventPrizeGump)); Closable = true; AddPage(0); AddBackground(0, 0, 420, 280, 5054); AddImageTiled(10, 10, 400, 20, 2624); AddAlphaRegion(10, 10, 400, 20); AddHtml(10, 10, 400, 20, "<BASEFONT COLOR=#FFFF00><CENTER>Event Prize Confirmation</CENTER></BASEFONT>", false, false); AddImageTiled(10, 40, 400, 200, 2624); AddAlphaRegion(10, 40, 400, 200); AddHtml(10, 40, 400, 200, String.Format(ms_confirmationString,m_prizeDefinition.Name, m_prizeDefinition.PriceString), false, true); AddImageTiled(10, 250, 400, 20, 2624); AddAlphaRegion(10, 250, 400, 20); AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0); AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL }
public void TestPaytableStructure() { Paytable paytable = new Paytable(); Strip strip = new Strip(); strip.Name = "Strip1"; strip.BaseStrip = new BaseStrip(); var stop1 = new Stop { Id = "AA", Weight = 1, }; strip.BaseStrip.Stops.Add(stop1); var stop2 = new Stop { Id = "AB", Weight = 1, }; strip.BaseStrip.Stops.Add(stop2); var stop3 = new Stop { Id = "AC", Weight = 1, }; strip.BaseStrip.Stops.Add(stop3); strip.ShootStrip = new PickStrip(); strip.ShootStrip.Stops.Add(new Stop { Id = "AA", Weight = 1, }); paytable.Strips.Add(strip); var prize = new PrizeDefinition(); prize.Symbol = "AA"; prize.RequiredCount = 3; prize.WinAmount = 10; prize.WinLevel = 1; prize.AwardStrategy = "TimesOnBetOnBall"; paytable.Prizes.Add(prize); var serializer = new XmlSerializer(typeof(Paytable)); var settings = new XmlWriterSettings(); settings.NewLineChars = System.Environment.NewLine; settings.Indent = true; var outputStr = new StringBuilder(); using (var writer = XmlWriter.Create(outputStr, settings)) { serializer.Serialize(writer, paytable); } var expectedStr = System.IO.File.ReadAllText("ExpectedTestPaytable.xml"); Assert.Equal <string>(expectedStr, outputStr.ToString()); }