using System.Collections.Generic; using Newtonsoft.Json.Linq; using System.Linq; 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(); protected override void Initialise() { BaseValue = JSON.Value("BaseValue") ?? 0; Bonus = JSON.Value("Bonus") ?? 0; TotalEarnings = JSON.Value("TotalEarnings") ?? 0; var sys = JSON.Value("Systems"); if (sys != null) { Systems = sys.Select(x => x.ToString()).ToList(); } var dis = JSON.Value("Discovered"); if (dis != null) { Discovered = dis.Select(x => x.ToString()).ToList(); } } }