identify cap ship by its music
This commit is contained in:
parent
9994a45d06
commit
16b579688d
17
EDPlayerJournal/BGS/Parsers/MusicParser.cs
Normal file
17
EDPlayerJournal/BGS/Parsers/MusicParser.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using EDPlayerJournal.Entries;
|
||||
|
||||
namespace EDPlayerJournal.BGS.Parsers;
|
||||
|
||||
internal class MusicParser : ITransactionParserPart {
|
||||
public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||
MusicEntry? entryMusic = (MusicEntry)entry;
|
||||
|
||||
if (entryMusic == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.Compare(entryMusic.MusicTrack, "Combat_CapitalShip") == 0) {
|
||||
context.HaveSeenCapShip = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -684,6 +684,7 @@ public class TransactionParser {
|
||||
{ Events.MissionFailed, new MissionFailedParser() },
|
||||
{ Events.Missions, new MissionsParser() },
|
||||
{ Events.MultiSellExplorationData, new MultiSellExplorationDataParser() },
|
||||
{ Events.Music, new MusicParser() },
|
||||
{ Events.ReceiveText, new ReceiveTextParser() },
|
||||
{ Events.RedeemVoucher, new RedeemVoucherParser() },
|
||||
{ Events.SearchAndRescue, new SearchAndRescueParser() },
|
||||
|
@ -38,6 +38,7 @@ public class Entry {
|
||||
{ Events.MissionRedirected, typeof(MissionRedirectedEntry) },
|
||||
{ Events.Missions, typeof(MissionsEntry) },
|
||||
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
|
||||
{ Events.Music, typeof(MusicEntry) },
|
||||
{ Events.ReceiveText, typeof(ReceiveTextEntry) },
|
||||
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
|
||||
{ Events.SearchAndRescue, typeof(SearchAndRescueEntry) },
|
||||
|
@ -28,6 +28,7 @@ public class Events {
|
||||
public static readonly string MissionRedirected = "MissionRedirected";
|
||||
public static readonly string Missions = "Missions";
|
||||
public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
|
||||
public static readonly string Music = "Music";
|
||||
public static readonly string ReceiveText = "ReceiveText";
|
||||
public static readonly string RedeemVoucher = "RedeemVoucher";
|
||||
public static readonly string SearchAndRescue = "SearchAndRescue";
|
||||
|
9
EDPlayerJournal/Entries/MusicEntry.cs
Normal file
9
EDPlayerJournal/Entries/MusicEntry.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace EDPlayerJournal.Entries;
|
||||
|
||||
public class MusicEntry : Entry {
|
||||
public string? MusicTrack { get; set; } = null;
|
||||
|
||||
protected override void Initialise() {
|
||||
MusicTrack = JSON.Value<string?>("MusicTrack");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user