EDBGS/EliteBGS/LogGenerator/VoucherFormat.cs

28 lines
748 B
C#
Raw Normal View History

2022-11-24 19:38:19 +01:00
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<Vouchers>()
;
if (missions == null || missions.Count() <= 0) {
return "";
}
foreach (var m in missions) {
builder.AppendFormat("Handed in {0} vouchers: {1}\n", m.Type, Credits.FormatCredits(m.TotalSum));
2022-11-24 19:38:19 +01:00
}
return builder.ToString().Trim();
}
}