parse out commander names from logs
This commit is contained in:
@@ -602,15 +602,6 @@ internal class DropshipDeployParser : ITransactionParserPart {
|
||||
}
|
||||
}
|
||||
|
||||
internal class CommanderParser : ITransactionParserPart {
|
||||
public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||
// A commander entry happens when you log out, and log back in again
|
||||
// for example when switching from Open, to Solo or PG.
|
||||
context.DiscernCombatZone(transactions, entry);
|
||||
context.ResetCombatZone();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransactionParser {
|
||||
private static Dictionary<string, ITransactionParserPart> ParserParts { get; } = new()
|
||||
{
|
||||
@@ -669,6 +660,11 @@ public class TransactionParser {
|
||||
return Parse(entries, defaultOptions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of commanders seen during parsing.
|
||||
/// </summary>
|
||||
public List<string> Commanders { get; set; } = new();
|
||||
|
||||
public List<Transaction>? Parse(IEnumerable<Entry> entries, TransactionParserOptions options) {
|
||||
TransactionList transactions = new();
|
||||
TransactionParserContext context = new();
|
||||
@@ -686,6 +682,9 @@ public class TransactionParser {
|
||||
transactionParserPart.Parse(entry, context, options, transactions);
|
||||
}
|
||||
|
||||
// Copy out list of commanders seen
|
||||
Commanders = context.Commanders;
|
||||
|
||||
return transactions.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user