using System.Linq; using System.Text; using EDPlayerJournal; using EDPlayerJournal.BGS; namespace EliteBGS.LogGenerator; public class VoucherFormat : LogFormatter { public string GenerateLog(Objective objective) { StringBuilder builder = new StringBuilder(); var missions = objective.UITransactions .Where(x => x.IsEnabled) .Select(x => x.Transaction) .OfType() ; if (missions == null || missions.Count() <= 0) { return ""; } foreach (var m in missions) { builder.AppendFormat("Handed in {0} vouchers for {1}\n", m.Type, m.Faction); builder.AppendFormat("(Total value: {0})\n", Credits.FormatCredits(m.TotalSum)); builder.AppendFormat("\n"); } return builder.ToString().Trim(); } }