StarPos can have negative values

This commit is contained in:
Florian Stinglmayr 2022-04-28 09:58:41 +02:00
parent 9b31077a11
commit 2bef2a6c81
2 changed files with 4 additions and 7 deletions

View File

@ -6,7 +6,7 @@ namespace EDJournal {
protected override void Initialise() {
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
StarSystem = JSON.Value<string>("StarSystem");
StarPos = JSON.Value<JArray>("StarPos").ToObject<ulong[]>();
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
var faction = JSON.Value<JObject>("SystemFaction");
if (faction != null) {
@ -23,13 +23,10 @@ namespace EDJournal {
}
}
}
public ulong[] StarPos { get; set; }
public long[] StarPos { get; set; }
public string StarSystem { get; set; }
public string SystemFaction { get; set; }
public ulong SystemAddress { get; set; }
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
}
}

View File

@ -13,7 +13,7 @@ namespace EDJournal {
public ulong SystemAddress { get; set; }
public string Body { get; set; }
public bool Docked { get; set; }
public ulong[] StarPos { get; set; }
public long[] StarPos { get; set; }
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
@ -22,7 +22,7 @@ namespace EDJournal {
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
Docked = JSON.Value<bool?>("Docked") ?? false;
StationName = JSON.Value<string>("StationName") ?? "";
StarPos = JSON.Value<JArray>("StarPos").ToObject<ulong[]>();
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
if (systemfaction != null) {