Compare commits

...

2 Commits

2 changed files with 17 additions and 1 deletions

View File

@ -747,6 +747,17 @@ public class TransactionParser {
{ Events.SupercruiseEntry, new SupercruiseEntryParser() },
};
public bool IsRelevant(string entry) {
return ParserParts.ContainsKey(entry);
}
public bool IsRelevant(Entry e) {
if (e.Event == null) {
return false;
}
return IsRelevant(e.Event);
}
public List<Transaction>? Parse(IEnumerable<Entry> entries) {
TransactionList transactions = new();
TransactionParserContext context = new();

View File

@ -6,6 +6,7 @@ using System.Windows;
using Microsoft.Win32;
using EDPlayerJournal.Entries;
using EliteBGS.Util;
using EDPlayerJournal.BGS;
namespace EliteBGS;
@ -85,6 +86,8 @@ public partial class LoadEntriesWindow : Window {
return;
}
TransactionParser parser = new();
try {
List<Entry> entries = new List<Entry>();
@ -93,7 +96,9 @@ public partial class LoadEntriesWindow : Window {
continue;
}
Entry entry = Entry.Parse(line);
entries.Add(entry);
if (parser.IsRelevant(entry)) {
entries.Add(entry);
}
}
if (entries.Count <= 0) {