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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user