add profit to search and rescue

This commit is contained in:
Florian Stinglmayr 2023-04-19 10:13:02 +02:00
parent 8cf8d7f529
commit 5fe652f98c
2 changed files with 8 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public class DiscordLogGenerator {
} }
if (sb.Length > 0) { if (sb.Length > 0) {
sb.Append(", "); sb.Append("; ");
} }
sb.Append(summary); sb.Append(summary);

View File

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