Compare commits
2 Commits
32e5898b02
...
0be9791abc
Author | SHA1 | Date | |
---|---|---|---|
0be9791abc | |||
027f8a892d |
@ -747,6 +747,17 @@ public class TransactionParser {
|
|||||||
{ Events.SupercruiseEntry, new SupercruiseEntryParser() },
|
{ 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) {
|
public List<Transaction>? Parse(IEnumerable<Entry> entries) {
|
||||||
TransactionList transactions = new();
|
TransactionList transactions = new();
|
||||||
TransactionParserContext context = new();
|
TransactionParserContext context = new();
|
||||||
|
@ -6,6 +6,7 @@ using System.Windows;
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using EDPlayerJournal.Entries;
|
using EDPlayerJournal.Entries;
|
||||||
using EliteBGS.Util;
|
using EliteBGS.Util;
|
||||||
|
using EDPlayerJournal.BGS;
|
||||||
|
|
||||||
namespace EliteBGS;
|
namespace EliteBGS;
|
||||||
|
|
||||||
@ -85,6 +86,8 @@ public partial class LoadEntriesWindow : Window {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TransactionParser parser = new();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<Entry> entries = new List<Entry>();
|
List<Entry> entries = new List<Entry>();
|
||||||
|
|
||||||
@ -93,8 +96,10 @@ public partial class LoadEntriesWindow : Window {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Entry entry = Entry.Parse(line);
|
Entry entry = Entry.Parse(line);
|
||||||
|
if (parser.IsRelevant(entry)) {
|
||||||
entries.Add(entry);
|
entries.Add(entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (entries.Count <= 0) {
|
if (entries.Count <= 0) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user