2022-11-24 19:38:19 +01:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using EDPlayerJournal;
|
|
|
|
|
using EDPlayerJournal.BGS;
|
|
|
|
|
|
|
|
|
|
namespace EliteBGS.LogGenerator;
|
|
|
|
|
|
|
|
|
|
public class CartographicsFormat : LogFormatter {
|
|
|
|
|
public string GenerateLog(Objective objective) {
|
|
|
|
|
var total = objective.EnabledOfType<Cartographics>();
|
|
|
|
|
var pages = total.Count();
|
|
|
|
|
long sum = total.Sum(x => x.TotalSum);
|
|
|
|
|
|
|
|
|
|
if (pages <= 0 || sum <= 0) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return string.Format("Sold {0} page(s) worth of universal cartographics\n" +
|
|
|
|
|
"(Total value: {1})\n\n",
|
|
|
|
|
pages, Credits.FormatCredits(sum)
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-02-23 21:44:55 +01:00
|
|
|
|
|
|
|
|
|
public string GenerateSummary(Objective objective) {
|
|
|
|
|
Cartographics[] sold = objective.EnabledOfType<Cartographics>().ToArray();
|
|
|
|
|
long totalProfit = sold.Sum(x => x.TotalSum);
|
|
|
|
|
|
|
|
|
|
if (totalProfit >= 100000) {
|
|
|
|
|
return string.Format("Explo: {0}", Credits.FormatMillions(totalProfit));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
2022-11-24 19:38:19 +01:00
|
|
|
|
}
|