EliteBGS/BGS/LogGenerator/MicroResourcesFormat.cs

22 lines
636 B
C#
Raw Normal View History

using System.Linq;
using EDJournal;
namespace EliteBGS.BGS.LogGenerator {
public class MicroResourcesFormat : LogFormatter {
public string GenerateLog(Objective objective) {
var total = objective.LogEntries
.OfType<SellMicroResources>()
.Where(x => x.IsEnabled)
;
long sum = total.Sum(x => x.TotalSum);
if (total == null || total.Count() <= 0 || sum <= 0) {
return "";
}
return string.Format("Sold {0} worth of Micro Resources\n",
Credits.FormatCredits(sum));
}
}
}