2022-11-25 14:48:59 +01:00
|
|
|
|
using EDPlayerJournal;
|
|
|
|
|
using EDPlayerJournal.BGS;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace EliteBGS.LogGenerator;
|
|
|
|
|
|
|
|
|
|
public class ThargoidFormatter : LogFormatter {
|
|
|
|
|
public string GenerateLog(Objective objective) {
|
|
|
|
|
List<ThargoidKill> kills = objective.EnabledOfType<ThargoidKill>().ToList();
|
|
|
|
|
|
|
|
|
|
if (kills.Count == 0 ) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Dictionary<ThargoidVessel, List<ThargoidKill>> sorted = kills
|
|
|
|
|
.GroupBy(x => x.ThargoidType)
|
|
|
|
|
.ToDictionary(x => x.Key, x => x.ToList())
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
foreach (var k in sorted) {
|
|
|
|
|
string name = Thargoid.GetVesselName(k.Key);
|
2022-11-25 15:51:01 +01:00
|
|
|
|
builder.AppendFormat("{0}x {1}(s) killed\n", k.Value.Count, name);
|
2022-11-25 14:48:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return builder.ToString();
|
|
|
|
|
}
|
2023-02-23 21:44:55 +01:00
|
|
|
|
|
|
|
|
|
public string GenerateSummary(Objective objective) {
|
|
|
|
|
List<ThargoidKill> kills = objective.EnabledOfType<ThargoidKill>().ToList();
|
|
|
|
|
|
|
|
|
|
if (kills.Count == 0 ) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int scouts = kills.Where(x => x.ThargoidType == ThargoidVessel.Scout).Count();
|
|
|
|
|
int interceptors = kills.Count - scouts;
|
|
|
|
|
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
builder.Append("AX: ");
|
|
|
|
|
if (interceptors > 0) {
|
|
|
|
|
builder.AppendFormat("{0} INT", interceptors);
|
|
|
|
|
}
|
|
|
|
|
if (scouts > 0) {
|
2023-02-26 22:01:13 +01:00
|
|
|
|
if (interceptors > 0) {
|
|
|
|
|
builder.Append(" + ");
|
2023-02-23 21:44:55 +01:00
|
|
|
|
}
|
|
|
|
|
builder.AppendFormat("{0} SCT", scouts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return builder.ToString();
|
|
|
|
|
}
|
2022-11-25 14:48:59 +01:00
|
|
|
|
}
|