From 9f013bed384a9fbc0a5369a226f7e79423634385 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Tue, 17 Sep 2024 18:49:18 +0200 Subject: [PATCH] fix cartographics value, use Total instead of TotalEarnings --- EDPlayerJournal/BGS/Cartographics.cs | 4 ++-- .../Entries/MultiSellExplorationDataEntry.cs | 21 ++++++++++++++++--- .../Entries/SellExplorationDataEntry.cs | 9 ++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/EDPlayerJournal/BGS/Cartographics.cs b/EDPlayerJournal/BGS/Cartographics.cs index 1698817..16a09d6 100644 --- a/EDPlayerJournal/BGS/Cartographics.cs +++ b/EDPlayerJournal/BGS/Cartographics.cs @@ -35,10 +35,10 @@ public class Cartographics : Transaction { /* add multi sell and normal ones together */ long total = Entries.OfType() - .Sum(x => x.TotalEarnings) + .Sum(x => x.Total) + Entries.OfType() - .Sum(x => x.TotalEarnings) + .Sum(x => x.Total) ; return total; } diff --git a/EDPlayerJournal/Entries/MultiSellExplorationDataEntry.cs b/EDPlayerJournal/Entries/MultiSellExplorationDataEntry.cs index 82d33c6..df4e79e 100644 --- a/EDPlayerJournal/Entries/MultiSellExplorationDataEntry.cs +++ b/EDPlayerJournal/Entries/MultiSellExplorationDataEntry.cs @@ -1,8 +1,23 @@ -namespace EDPlayerJournal.Entries; +namespace EDPlayerJournal.Entries; + public class MultiSellExplorationDataEntry : Entry { protected override void Initialise() { - TotalEarnings = (JSON.Value("TotalEarnings") ?? 0); + TotalEarnings = JSON.Value("TotalEarnings") ?? 0; + BaseValue = JSON.Value("BaseValue") ?? 0; + Bonus = JSON.Value("Bonus") ?? 0; } - public int TotalEarnings { get; set; } = 0; + public long Total { + get { return BaseValue + Bonus; } + } + + public long BaseValue { get; set; } = 0; + + public long Bonus { get; set; } = 0; + + /// + /// Total Earnings are the actual earnings without bonus. So this + /// value is BaseValue minus any percent a crew pilot takes. + /// + public long TotalEarnings { get; set; } = 0; } diff --git a/EDPlayerJournal/Entries/SellExplorationDataEntry.cs b/EDPlayerJournal/Entries/SellExplorationDataEntry.cs index e35e935..2bf0747 100644 --- a/EDPlayerJournal/Entries/SellExplorationDataEntry.cs +++ b/EDPlayerJournal/Entries/SellExplorationDataEntry.cs @@ -6,8 +6,17 @@ namespace EDPlayerJournal.Entries; public class SellExplorationDataEntry : Entry { public long BaseValue { get; set; } public long Bonus { get; set; } + + /// + /// Total Earnings are the actual earnings without bonus. So this + /// value is BaseValue minus any percent a crew pilot takes. + /// public long TotalEarnings { get; set; } + public long Total { + get { return BaseValue + Bonus; } + } + public List Systems { get; set; } = new List(); public List Discovered { get; set; } = new List();