add new message for single cartographic selling

This commit is contained in:
Florian Stinglmayr 2022-01-22 13:17:44 +01:00
parent d82d672df6
commit 4e14f781d8
4 changed files with 35 additions and 0 deletions

View File

@ -29,6 +29,7 @@ namespace EDJournal {
{ Events.MissionRedirected, typeof(MissionRedirectedEntry) }, { Events.MissionRedirected, typeof(MissionRedirectedEntry) },
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) }, { Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) }, { Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
{ Events.SellExplorationData, typeof(SellExplorationDataEntry) },
{ Events.SellMicroResources, typeof(SellMicroResourcesEntry) }, { Events.SellMicroResources, typeof(SellMicroResourcesEntry) },
{ Events.ShieldState, typeof(ShieldStateEntry) }, { Events.ShieldState, typeof(ShieldStateEntry) },
{ Events.ShipTargeted, typeof(ShipTargetedEntry) }, { Events.ShipTargeted, typeof(ShipTargetedEntry) },

View File

@ -18,6 +18,7 @@
public static readonly string MissionRedirected = "MissionRedirected"; public static readonly string MissionRedirected = "MissionRedirected";
public static readonly string MultiSellExplorationData = "MultiSellExplorationData"; public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
public static readonly string RedeemVoucher = "RedeemVoucher"; public static readonly string RedeemVoucher = "RedeemVoucher";
public static readonly string SellExplorationData = "SellExplorationData";
public static readonly string SellMicroResources = "SellMicroResources"; public static readonly string SellMicroResources = "SellMicroResources";
public static readonly string ShieldState = "ShieldState"; public static readonly string ShieldState = "ShieldState";
public static readonly string ShipTargeted = "ShipTargeted"; public static readonly string ShipTargeted = "ShipTargeted";

View File

@ -0,0 +1,32 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using System.Linq;
namespace EDJournal {
public class SellExplorationDataEntry : Entry {
private List<string> systems = new List<string>();
private List<string> discovered = new List<string>();
public long BaseValue { get; set; }
public long Bonus { get; set; }
public long TotalEarnings { get; set; }
public List<string> Systems => systems;
public List<string> Discovered => discovered;
protected override void Initialise() {
BaseValue = JSON.Value<long?>("BaseValue") ?? 0;
Bonus = JSON.Value<long?>("Bonus") ?? 0;
TotalEarnings = JSON.Value<long?>("TotalEarnings") ?? 0;
var sys = JSON.Value<JArray>("Systems");
if (sys != null) {
systems = sys.Select(x => x.ToString()).ToList<string>();
}
var dis = JSON.Value<JArray>("Discovered");
if (dis != null) {
discovered = dis.Select(x => x.ToString()).ToList<string>();
}
}
}
}

View File

@ -68,6 +68,7 @@
<Compile Include="PlayerJournal.cs" /> <Compile Include="PlayerJournal.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedeemVoucherEntry.cs" /> <Compile Include="RedeemVoucherEntry.cs" />
<Compile Include="SellExplorationDataEntry.cs" />
<Compile Include="SellMicroResourcesEntry.cs" /> <Compile Include="SellMicroResourcesEntry.cs" />
<Compile Include="ShieldStateEntry.cs" /> <Compile Include="ShieldStateEntry.cs" />
<Compile Include="ShipTargetedEntry.cs" /> <Compile Include="ShipTargetedEntry.cs" />