add thargoid formatter for logs
This commit is contained in:
parent
5f9fff3922
commit
e0e7cb5792
@ -12,6 +12,7 @@ public class DiscordLogGenerator {
|
|||||||
new FailedMissionFormat(),
|
new FailedMissionFormat(),
|
||||||
new MurderFormat(),
|
new MurderFormat(),
|
||||||
new VoucherFormat(),
|
new VoucherFormat(),
|
||||||
|
new ThargoidFormatter(),
|
||||||
new CombatZoneFormat(),
|
new CombatZoneFormat(),
|
||||||
new KillBondsFormat(),
|
new KillBondsFormat(),
|
||||||
new CartographicsFormat(),
|
new CartographicsFormat(),
|
||||||
|
32
EliteBGS/LogGenerator/ThargoidFormatter.cs
Normal file
32
EliteBGS/LogGenerator/ThargoidFormatter.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
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);
|
||||||
|
builder.AppendFormat("{0}x {1} killed\n", k.Value.Count, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.ToString();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user