add settlements for ground CZs to the combat log
This commit is contained in:
@@ -43,6 +43,12 @@ public class CombatZone : Transaction {
|
||||
/// </summary>
|
||||
public bool? CapitalShip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If we have a combat zone, this might point to the settlement
|
||||
/// in question.
|
||||
/// </summary>
|
||||
public string? Settlement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many optional objectives were completed?
|
||||
/// </summary>
|
||||
|
||||
15
EDPlayerJournal/BGS/Parsers/ApproachSettlementParser.cs
Normal file
15
EDPlayerJournal/BGS/Parsers/ApproachSettlementParser.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using EDPlayerJournal.Entries;
|
||||
|
||||
namespace EDPlayerJournal.BGS.Parsers;
|
||||
|
||||
internal class ApproachSettlementParser : ITransactionParserPart {
|
||||
public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||
ApproachSettlementEntry? approach = entry as ApproachSettlementEntry;
|
||||
if (approach == null || string.IsNullOrEmpty(approach.Name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.Settlement = approach.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,6 +663,7 @@ internal class CommanderParser : ITransactionParserPart {
|
||||
public class TransactionParser {
|
||||
private static Dictionary<string, ITransactionParserPart> ParserParts { get; } = new()
|
||||
{
|
||||
{ Events.ApproachSettlement, new ApproachSettlementParser() },
|
||||
{ Events.CapShipBond, new CapShipBondParser() },
|
||||
{ Events.Commander, new CommanderParser() },
|
||||
{ Events.CommitCrime, new CommitCrimeParser() },
|
||||
|
||||
@@ -57,6 +57,11 @@ internal class TransactionParserContext {
|
||||
public bool HaveSeenAlliedCorrespondent { get; set; } = false;
|
||||
public bool HaveSeenEnemyCorrespondent { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Current Odyssey settlement.
|
||||
/// </summary>
|
||||
public string? Settlement { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the current session is legacy
|
||||
/// </summary>
|
||||
@@ -115,6 +120,7 @@ internal class TransactionParserContext {
|
||||
/// </summary>
|
||||
public void LeftInstance() {
|
||||
CurrentInstanceType = null;
|
||||
Settlement = null;
|
||||
}
|
||||
|
||||
public void DiscernCombatZone(TransactionList transactions, Entry e) {
|
||||
@@ -223,6 +229,7 @@ internal class TransactionParserContext {
|
||||
System = CurrentSystem,
|
||||
Faction = faction,
|
||||
IsLegacy = IsLegacy,
|
||||
Settlement = Settlement,
|
||||
Grade = grade,
|
||||
Type = cztype,
|
||||
// Sad truth is, if HaveSeenXXX is false, we just don't know for certain
|
||||
|
||||
Reference in New Issue
Block a user