fix completed at for combat zones

This commit is contained in:
Florian Stinglmayr 2022-11-25 23:06:08 +01:00
parent 0be9791abc
commit 1da4549e2c
3 changed files with 5 additions and 10 deletions

View File

@ -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)) {

View File

@ -1,4 +1,5 @@
using EDPlayerJournal.Entries;
using System.ComponentModel.DataAnnotations.Schema;
namespace EDPlayerJournal.BGS;

View File

@ -49,7 +49,7 @@ internal class TransactionParserContext {
/// </summary>
public Dictionary<string, long> 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();
}
}