EliteBGS/BGS/LogGenerator/FailedMissionFormat.cs

30 lines
920 B
C#

using System.Linq;
using System.Text;
using EDJournal;
namespace EliteBGS.BGS.LogGenerator {
public class FailedMissionFormat : LogFormatter {
public string GenerateLog(Objective objective) {
MissionFailed[] missions = objective.LogEntries.OfType<MissionFailed>().ToArray();
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
);
}
builder.Append("\n");
return builder.ToString();
}
}
}