implement a summary line

For Pony's bot, implement a summary line that just shows the highlights of the log
This commit is contained in:
2023-02-23 21:44:55 +01:00
parent 3c1abe5e8c
commit 5120c7991f
15 changed files with 234 additions and 3 deletions

View File

@@ -76,4 +76,21 @@ public class MissionFormat : LogFormatter {
return output.ToString().Trim();
}
public string GenerateSummary(Objective objective) {
long influence = objective
.EnabledOfType<MissionCompleted>()
.Sum(x => x.Influence.Length)
;
long support = objective
.EnabledOfType<InfluenceSupport>()
.Sum(x => x.Influence.Length)
;
if (influence + support <= 0) {
return "";
}
return string.Format("INF: {0}", influence + support);
}
}