From f683bc372ee7eb72698756717c161f81a848265c Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Mon, 28 Nov 2022 19:47:41 +0100 Subject: [PATCH] handle capshipbond entries --- EDPlayerJournal/BGS/TransactionParser.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index 32c4bba..63ce7ad 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -1,7 +1,4 @@ using EDPlayerJournal.Entries; -using System.Collections.Generic; -using System.Reflection.Metadata.Ecma335; -using System.Transactions; namespace EDPlayerJournal.BGS; @@ -788,9 +785,20 @@ internal class ShutdownParser : TransactionParserPart { } } +internal class CapShipBondParser : TransactionParserPart { + public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) { + if (entry.GetType() != typeof(CapShipBondEntry)) { + return; + } + + context.HaveSeenCapShip = true; + } +} + public class TransactionParser { private static Dictionary ParserParts { get; } = new() { + { Events.CapShipBond, new CapShipBondParser() }, { Events.CommitCrime, new CommitCrimeParser() }, { Events.Disembark, new EmbarkDisembarkParser() }, { Events.Docked, new DockedParser() },