From f4dd50c5685f3c3289c8e44d988be58d063059e8 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Wed, 17 Nov 2021 20:54:58 +0100 Subject: [PATCH] complete DockedEntry --- DockedEntry.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/DockedEntry.cs b/DockedEntry.cs index 814f263..a1c0c42 100644 --- a/DockedEntry.cs +++ b/DockedEntry.cs @@ -1,9 +1,18 @@ -using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace EDJournal { public class DockedEntry : Entry { - public string StationName { - get { return JSON.GetValue("StationName").ToString(); } + public string StationName { get; set; } + public string StarSystem { get; set; } + public string StationFaction { get; set; } + + protected override void Initialise() { + StationName = JSON.Value("StationName") ?? ""; + StarSystem = JSON.Value("StarSystem") ?? ""; + JObject faction = JSON.Value("StationFaction"); + if (faction != null) { + StationFaction = faction.Value("Name") ?? ""; + } } } }