fix formatting of combat zones

This commit is contained in:
Florian Stinglmayr 2022-12-07 22:43:24 +01:00
parent 2608aeab6f
commit 1f673970ee
2 changed files with 13 additions and 6 deletions

View File

@ -91,7 +91,7 @@ public class CombatZone : Transaction {
}
public override string ToString() {
if (Grade != null) {
if (!string.IsNullOrEmpty(Grade)) {
return string.Format("Won {0} {1} Combat Zone", Grade, Type);
} else {
return string.Format("Won {0} Combat Zone", Type);

View File

@ -22,11 +22,18 @@ class CombatZoneFormat : LogFormatter {
int optionals = log.Value
.Sum(x => x.OptionalObjectivesCompleted)
;
builder.AppendFormat("Won {0}x {1} {2} Combat Zone(s)",
log.Value.Count,
log.Key.Grade,
log.Key.Type
);
if (!string.IsNullOrEmpty(log.Key.Grade)) {
builder.AppendFormat("Won {0}x {1} {2} Combat Zone(s)",
log.Value.Count,
log.Key.Grade,
log.Key.Type
);
} else {
builder.AppendFormat("Won {0}x {1} Combat Zone(s)",
log.Value.Count,
log.Key.Type
);
}
if (optionals > 0) {
builder.AppendFormat(" (with {0} optional objectives)", optionals);