2022-02-11 13:01:42 +01:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using EDJournal;
|
|
|
|
|
|
|
|
|
|
namespace EliteBGS.BGS.LogGenerator {
|
|
|
|
|
public class FailedMissionFormat : LogFormatter {
|
|
|
|
|
public string GenerateLog(Objective objective) {
|
2022-04-06 16:33:04 +02:00
|
|
|
|
MissionFailed[] missions = objective
|
|
|
|
|
.LogEntries
|
|
|
|
|
.OfType<MissionFailed>()
|
|
|
|
|
.Where(x => x.IsEnabled)
|
|
|
|
|
.ToArray()
|
|
|
|
|
;
|
2022-02-11 13:01:42 +01:00
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
if (missions.Length <= 0) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (MissionFailed failed in missions) {
|
|
|
|
|
MissionFailedEntry f = failed.Failed;
|
|
|
|
|
builder.AppendFormat("Failed {0} mission(s) \"{1}\" targeting {2}\n",
|
|
|
|
|
failed.Amount,
|
|
|
|
|
f.HumanReadableName == null ? f.Name : f.HumanReadableName,
|
|
|
|
|
failed.Faction
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-18 13:41:17 +01:00
|
|
|
|
return builder.ToString().Trim();
|
2022-02-11 13:01:42 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|