Compare commits
2 Commits
132d090fd5
...
0b47b7331e
Author | SHA1 | Date | |
---|---|---|---|
0b47b7331e | |||
2fae724bd2 |
@ -36,10 +36,6 @@ public class MissionFailed : Transaction {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Amount {
|
|
||||||
get { return Entries.Count + 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
@ -47,8 +43,7 @@ public class MissionFailed : Transaction {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.AppendFormat("{0}x Mission failed: \"{1}\"",
|
builder.AppendFormat(" Mission failed: \"{0}\"",
|
||||||
Amount,
|
|
||||||
Mission?.FriendlyName
|
Mission?.FriendlyName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -8,28 +8,24 @@ namespace EliteBGS.LogGenerator;
|
|||||||
public class FailedMissionFormat : LogFormatter {
|
public class FailedMissionFormat : LogFormatter {
|
||||||
public string GenerateLog(Objective objective) {
|
public string GenerateLog(Objective objective) {
|
||||||
var missions = objective.EnabledOfType<MissionFailed>();
|
var missions = objective.EnabledOfType<MissionFailed>();
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
|
|
||||||
if (missions.Count <= 0) {
|
if (missions.Count <= 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var failed in missions) {
|
StringBuilder builder = new StringBuilder();
|
||||||
MissionFailedEntry f = failed.Failed;
|
|
||||||
string name;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(f.Mission.FriendlyName)) {
|
var grouping = missions
|
||||||
name = f.Mission.FriendlyName;
|
.GroupBy(x => x.Mission.IsOnFoot)
|
||||||
} else if (!string.IsNullOrEmpty(f.Mission.LocalisedName)) {
|
;
|
||||||
name = f.Mission.LocalisedName;
|
|
||||||
} else {
|
|
||||||
name = f.Mission.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(failed.Faction)) {
|
foreach (var group in grouping) {
|
||||||
builder.AppendFormat("Failed mission \"{0}\" targeting {1}\n", name, failed.Faction);
|
int amount = group.Count();
|
||||||
|
|
||||||
|
if (group.Key) {
|
||||||
|
builder.AppendFormat("Failed {0} On Foot Mission(s)\n", amount);
|
||||||
} else {
|
} else {
|
||||||
builder.AppendFormat("Failed mission \"{0}\"\n", name);
|
builder.AppendFormat("Failed {0} Ship Mission(s)\n", amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user