From 1da4549e2cd2d547dd122fd970f9f548ec73ee69 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Fri, 25 Nov 2022 23:06:08 +0100 Subject: [PATCH] fix completed at for combat zones --- EDPlayerJournal/BGS/CombatZone.cs | 7 ------- EDPlayerJournal/BGS/Transaction.cs | 1 + EDPlayerJournal/BGS/TransactionParser.cs | 7 ++++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/EDPlayerJournal/BGS/CombatZone.cs b/EDPlayerJournal/BGS/CombatZone.cs index 6973c80..d04abb8 100644 --- a/EDPlayerJournal/BGS/CombatZone.cs +++ b/EDPlayerJournal/BGS/CombatZone.cs @@ -6,13 +6,6 @@ public class CombatZone : Transaction { public string Type { get; set; } = ""; public string Grade { get; set; } = ""; public int Amount { get; set; } = 0; - public DateTime Completed { get; set; } = DateTime.UtcNow; - - public override string CompletedAt { - get { - return Completed.ToString("dd.MM.yyyy HH:mm UTC"); - } - } public override int CompareTo(Transaction? obj) { if (obj == null || obj.GetType() != typeof(CombatZone)) { diff --git a/EDPlayerJournal/BGS/Transaction.cs b/EDPlayerJournal/BGS/Transaction.cs index 9c3a68d..af247a0 100644 --- a/EDPlayerJournal/BGS/Transaction.cs +++ b/EDPlayerJournal/BGS/Transaction.cs @@ -1,4 +1,5 @@ using EDPlayerJournal.Entries; +using System.ComponentModel.DataAnnotations.Schema; namespace EDPlayerJournal.BGS; diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index bd4a46f..67bc20e 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -49,7 +49,7 @@ internal class TransactionParserContext { /// public Dictionary BuyCost = new(); - public void DiscernCombatZone(TransactionList transactions) { + public void DiscernCombatZone(TransactionList transactions, Entry e) { string grade = "Low"; string cztype; ulong? highest = HighestCombatBond; @@ -86,6 +86,7 @@ internal class TransactionParserContext { Type = cztype, Amount = 1, }; + zone.Entries.Add(e); transactions.Add(zone); } @@ -709,14 +710,14 @@ internal class EmbarkDisembarkParser : TransactionParserPart { internal class SupercruiseEntryParser : TransactionParserPart { public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) { - context.DiscernCombatZone(transactions); + context.DiscernCombatZone(transactions, entry); context.ResetCombatZone(); } } internal class ShutdownParser : TransactionParserPart { public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) { - context.DiscernCombatZone(transactions); + context.DiscernCombatZone(transactions, entry); context.ResetCombatZone(); } }