public IssuesForm(Plot plot) { InitializeComponent(); List <PlotPoint> points = plot.AllPlotPoints; List <string> lines = new List <string>(); lines.AddRange(HTML.GetHead("Plot Design Issues", "", Session.Preferences.TextSize)); lines.Add("<BODY>"); List <DifficultyIssue> difficulty_issues = new List <DifficultyIssue>(); foreach (PlotPoint pp in points) { DifficultyIssue di = new DifficultyIssue(pp); if (di.Reason != "") { difficulty_issues.Add(di); } } lines.Add("<H4>Difficulty Issues</H4>"); if (difficulty_issues.Count != 0) { foreach (DifficultyIssue issue in difficulty_issues) { lines.Add("<P>"); lines.Add("<B>" + issue.Point + "</B>: " + issue.Reason); lines.Add("</P>"); } } else { lines.Add("<P class=instruction>"); lines.Add("(none)"); lines.Add("</P>"); } lines.Add("<HR>"); List <CreatureIssue> creature_issues = new List <CreatureIssue>(); foreach (PlotPoint pp in points) { if (pp.Element is Encounter) { CreatureIssue ci = new CreatureIssue(pp); if (ci.Reason != "") { creature_issues.Add(ci); } } } lines.Add("<H4>Creature Choice Issues</H4>"); if (difficulty_issues.Count != 0) { foreach (CreatureIssue issue in creature_issues) { lines.Add("<P>"); lines.Add("<B>" + issue.Point + "</B>: " + issue.Reason); lines.Add("</P>"); } } else { lines.Add("<P class=instruction>"); lines.Add("(none)"); lines.Add("</P>"); } lines.Add("<HR>"); List <SkillIssue> skill_issues = new List <SkillIssue>(); foreach (PlotPoint pp in points) { if (pp.Element is SkillChallenge) { SkillIssue si = new SkillIssue(pp); if (si.Reason != "") { skill_issues.Add(si); } } } lines.Add("<H4>Undefined Skill Challenges</H4>"); if (skill_issues.Count != 0) { foreach (SkillIssue issue in skill_issues) { lines.Add("<P>"); lines.Add("<B>" + issue.Point + "</B>: " + issue.Reason); lines.Add("</P>"); } } else { lines.Add("<P class=instruction>"); lines.Add("(none)"); lines.Add("</P>"); } lines.Add("<HR>"); List <ParcelIssue> parcel_issues = new List <ParcelIssue>(); foreach (PlotPoint pp in points) { foreach (Parcel parcel in pp.Parcels) { if (parcel.Name == "") { ParcelIssue pi = new ParcelIssue(parcel, pp); parcel_issues.Add(pi); } } } lines.Add("<H4>Undefined Treasure Parcels</H4>"); if (parcel_issues.Count != 0) { foreach (ParcelIssue issue in parcel_issues) { lines.Add("<P>"); lines.Add("<B>" + issue.Point + "</B>: " + issue.Reason); lines.Add("</P>"); } } else { lines.Add("<P class=instruction>"); lines.Add("(none)"); lines.Add("</P>"); } lines.Add("<HR>"); List <TreasureIssue> treasure_issues = new List <TreasureIssue>(); PlotPoint parent = Session.Project.FindParent(plot); string plot_name = (parent != null) ? parent.Name : Session.Project.Name; add_treasure_issues(plot_name, plot, treasure_issues); lines.Add("<H4>Treasure Allocation Issues</H4>"); if (treasure_issues.Count != 0) { foreach (TreasureIssue issue in treasure_issues) { lines.Add("<P>"); lines.Add("<B>" + issue.PlotName + "</B>: " + issue.Reason); lines.Add("</P>"); } } else { lines.Add("<P class=instruction>"); lines.Add("(none)"); lines.Add("</P>"); } lines.Add("</BODY>"); lines.Add("</HTML>"); Browser.DocumentText = HTML.Concatenate(lines); }
public IssuesForm(Plot plot) { this.InitializeComponent(); List <PlotPoint> allPlotPoints = plot.AllPlotPoints; List <string> strs = new List <string>(); strs.AddRange(HTML.GetHead("Plot Design Issues", "", DisplaySize.Small)); strs.Add("<BODY>"); List <DifficultyIssue> difficultyIssues = new List <DifficultyIssue>(); foreach (PlotPoint allPlotPoint in allPlotPoints) { DifficultyIssue difficultyIssue = new DifficultyIssue(allPlotPoint); if (difficultyIssue.Reason == "") { continue; } difficultyIssues.Add(difficultyIssue); } strs.Add("<H4>Difficulty Issues</H4>"); if (difficultyIssues.Count == 0) { strs.Add("<P class=instruction>"); strs.Add("(none)"); strs.Add("</P>"); } else { foreach (DifficultyIssue difficultyIssue1 in difficultyIssues) { strs.Add("<P>"); object[] point = new object[] { "<B>", difficultyIssue1.Point, "</B>: ", difficultyIssue1.Reason }; strs.Add(string.Concat(point)); strs.Add("</P>"); } } strs.Add("<HR>"); List <CreatureIssue> creatureIssues = new List <CreatureIssue>(); foreach (PlotPoint plotPoint in allPlotPoints) { if (!(plotPoint.Element is Encounter)) { continue; } CreatureIssue creatureIssue = new CreatureIssue(plotPoint); if (creatureIssue.Reason == "") { continue; } creatureIssues.Add(creatureIssue); } strs.Add("<H4>Creature Choice Issues</H4>"); if (difficultyIssues.Count == 0) { strs.Add("<P class=instruction>"); strs.Add("(none)"); strs.Add("</P>"); } else { foreach (CreatureIssue creatureIssue1 in creatureIssues) { strs.Add("<P>"); object[] objArray = new object[] { "<B>", creatureIssue1.Point, "</B>: ", creatureIssue1.Reason }; strs.Add(string.Concat(objArray)); strs.Add("</P>"); } } strs.Add("<HR>"); List <SkillIssue> skillIssues = new List <SkillIssue>(); foreach (PlotPoint allPlotPoint1 in allPlotPoints) { if (!(allPlotPoint1.Element is SkillChallenge)) { continue; } SkillIssue skillIssue = new SkillIssue(allPlotPoint1); if (skillIssue.Reason == "") { continue; } skillIssues.Add(skillIssue); } strs.Add("<H4>Undefined Skill Challenges</H4>"); if (skillIssues.Count == 0) { strs.Add("<P class=instruction>"); strs.Add("(none)"); strs.Add("</P>"); } else { foreach (SkillIssue skillIssue1 in skillIssues) { strs.Add("<P>"); object[] point1 = new object[] { "<B>", skillIssue1.Point, "</B>: ", skillIssue1.Reason }; strs.Add(string.Concat(point1)); strs.Add("</P>"); } } strs.Add("<HR>"); List <ParcelIssue> parcelIssues = new List <ParcelIssue>(); foreach (PlotPoint plotPoint1 in allPlotPoints) { foreach (Parcel parcel in plotPoint1.Parcels) { if (parcel.Name != "") { continue; } parcelIssues.Add(new ParcelIssue(parcel, plotPoint1)); } } strs.Add("<H4>Undefined Treasure Parcels</H4>"); if (parcelIssues.Count == 0) { strs.Add("<P class=instruction>"); strs.Add("(none)"); strs.Add("</P>"); } else { foreach (ParcelIssue parcelIssue in parcelIssues) { strs.Add("<P>"); object[] objArray1 = new object[] { "<B>", parcelIssue.Point, "</B>: ", parcelIssue.Reason }; strs.Add(string.Concat(objArray1)); strs.Add("</P>"); } } strs.Add("<HR>"); List <TreasureIssue> treasureIssues = new List <TreasureIssue>(); PlotPoint plotPoint2 = Session.Project.FindParent(plot); this.add_treasure_issues((plotPoint2 != null ? plotPoint2.Name : Session.Project.Name), plot, treasureIssues); strs.Add("<H4>Treasure Allocation Issues</H4>"); if (treasureIssues.Count == 0) { strs.Add("<P class=instruction>"); strs.Add("(none)"); strs.Add("</P>"); } else { foreach (TreasureIssue treasureIssue in treasureIssues) { strs.Add("<P>"); strs.Add(string.Concat("<B>", treasureIssue.PlotName, "</B>: ", treasureIssue.Reason)); strs.Add("</P>"); } } strs.Add("</BODY>"); strs.Add("</HTML>"); this.Browser.DocumentText = HTML.Concatenate(strs); }