EDBGS/EDPlayerJournal/Entries/DockedEntry.cs

41 lines
1.1 KiB
C#
Raw Normal View History

2022-11-01 18:01:28 +01:00
using Newtonsoft.Json.Linq;
namespace EDPlayerJournal.Entries;
public class DockedEntry : Entry {
2022-12-03 20:34:16 +01:00
/// <summary>
/// Name of the station
/// </summary>
2022-11-01 18:01:28 +01:00
public string? StationName { get; set; }
2022-12-03 20:34:16 +01:00
/// <summary>
/// Star system of the station
/// </summary>
2022-11-01 18:01:28 +01:00
public string? StarSystem { get; set; }
2022-12-03 20:34:16 +01:00
/// <summary>
/// System address
/// </summary>
2022-11-01 18:01:28 +01:00
public ulong? SystemAddress { get; set; }
2022-12-03 20:34:16 +01:00
/// <summary>
/// Faction owning the station.
/// </summary>
2022-11-01 18:01:28 +01:00
public string? StationFaction { get; set; }
2022-12-03 20:34:16 +01:00
/// <summary>
/// State of the station, new in Update 14
/// </summary>
public string? StationState { get; set; }
2022-11-01 18:01:28 +01:00
protected override void Initialise() {
StationName = JSON.Value<string>("StationName");
StarSystem = JSON.Value<string>("StarSystem");
SystemAddress = JSON.Value<ulong?>("SystemAddress");
2022-12-03 20:34:16 +01:00
StationState = JSON.Value<string>("StationState");
2022-11-01 18:01:28 +01:00
JObject? faction = JSON.Value<JObject>("StationFaction");
if (faction != null) {
StationFaction = faction.Value<string>("Name") ?? "";
}
}
}