EDBGS/EliteBGS/LogGenerator/SearchAndRescueFormat.cs

23 lines
647 B
C#

using EDPlayerJournal;
using EDPlayerJournal.BGS;
using System.Linq;
namespace EliteBGS.LogGenerator;
public class SearchAndRescueFormat : GenericFormat<SearchAndRescue> {
public override string GenerateSummary(Objective objective) {
long tons = objective
.EnabledOfType<SearchAndRescue>()
.Sum(x => x.Count)
;
long profit = objective
.EnabledOfType<SearchAndRescue>()
.Sum(x => x.Reward)
;
if (tons <= 0) {
return "";
}
return string.Format("S&R: {0}t, {1} profit", tons, Credits.FormatMillions(profit));
}
}