2022-02-12 19:49:11 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
2021-08-25 18:24:44 +02:00
|
|
|
|
|
|
|
|
|
namespace EDJournal {
|
|
|
|
|
public class FSDJumpEntry : Entry {
|
|
|
|
|
protected override void Initialise() {
|
2022-01-27 23:19:10 +01:00
|
|
|
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
|
|
|
|
StarSystem = JSON.Value<string>("StarSystem");
|
2022-04-28 09:58:41 +02:00
|
|
|
|
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
|
2022-04-26 15:18:08 +02:00
|
|
|
|
|
2021-08-25 18:24:44 +02:00
|
|
|
|
var faction = JSON.Value<JObject>("SystemFaction");
|
|
|
|
|
if (faction != null) {
|
2022-01-27 23:19:10 +01:00
|
|
|
|
SystemFaction = faction.Value<string>("Name");
|
2021-08-25 18:24:44 +02:00
|
|
|
|
}
|
2022-02-12 19:49:11 +01:00
|
|
|
|
|
|
|
|
|
JArray factions = JSON.Value<JArray>("Factions");
|
|
|
|
|
if (factions != null) {
|
|
|
|
|
foreach (JObject system_faction in factions) {
|
|
|
|
|
Faction f = Faction.FromJSON(system_faction);
|
|
|
|
|
if (f != null) {
|
|
|
|
|
SystemFactions.Add(f);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-25 18:24:44 +02:00
|
|
|
|
}
|
2022-04-28 09:58:41 +02:00
|
|
|
|
public long[] StarPos { get; set; }
|
2022-01-27 23:19:10 +01:00
|
|
|
|
public string StarSystem { get; set; }
|
|
|
|
|
public string SystemFaction { get; set; }
|
|
|
|
|
public ulong SystemAddress { get; set; }
|
2022-02-12 19:49:11 +01:00
|
|
|
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
2021-08-25 18:24:44 +02:00
|
|
|
|
}
|
|
|
|
|
}
|