using System.Linq; using System.Text; using EDPlayerJournal.Entries; using EDPlayerJournal.BGS; namespace EliteBGS.LogGenerator; public class FailedMissionFormat : LogFormatter { public string GenerateLog(Objective objective) { var missions = objective.EnabledOfType(); if (missions.Count <= 0) { return ""; } StringBuilder builder = new StringBuilder(); var grouping = missions .GroupBy(x => x.Mission.IsOnFoot) ; foreach (var group in grouping) { int amount = group.Count(); if (group.Key) { builder.AppendFormat("Failed {0} On Foot Mission(s)\n", amount); } else { builder.AppendFormat("Failed {0} Ship Mission(s)\n", amount); } } return builder.ToString().Trim(); } }