diff --git a/Entry.cs b/Entry.cs index 16cff86..af0f151 100644 --- a/Entry.cs +++ b/Entry.cs @@ -20,6 +20,7 @@ namespace EDJournal { { Events.FactionKillBond, typeof(FactionKillBondEntry) }, { Events.FSDJump, typeof(FSDJumpEntry) }, { Events.HullDamage, typeof(HullDamageEntry) }, + { Events.LoadGame, typeof(LoadGameEntry) }, { Events.Location, typeof(LocationEntry) }, { Events.MarketBuy, typeof(MarketBuyEntry) }, { Events.MarketSell, typeof(MarketSellEntry) }, diff --git a/Events.cs b/Events.cs index 39fb7f9..f5d3858 100644 --- a/Events.cs +++ b/Events.cs @@ -9,6 +9,7 @@ public static readonly string FighterDestroyed = "FighterDestroyed"; public static readonly string FSDJump = "FSDJump"; public static readonly string HullDamage = "HullDamage"; + public static readonly string LoadGame = "LoadGame"; public static readonly string Location = "Location"; public static readonly string MarketBuy = "MarketBuy"; public static readonly string MarketSell = "MarketSell"; diff --git a/LoadGameEntry.cs b/LoadGameEntry.cs new file mode 100644 index 0000000..625c642 --- /dev/null +++ b/LoadGameEntry.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EDJournal { + public class LoadGameEntry : Entry { + public string Commander { get; set; } + public string FID { get; set; } + public bool Horizons { get; set; } + public bool Odyssey { get; set; } + public string Ship { get; set; } + public long ShipID { get; set; } + public bool StartLanded { get; set; } + public bool StartDead { get; set; } + public string GameMode { get; set; } + public string Group { get; set; } + public long Credits { get; set; } + public long Loan { get; set; } + public string ShipName { get; set; } + public string ShipIdent { get; set; } + public double FuelLevel { get; set; } + public double FuelCapacity { get; set; } + + protected override void Initialise() { + Commander = JSON.Value("Commander") ?? ""; + FID = JSON.Value("FID") ?? ""; + // Game + Horizons = JSON.Value("Horizons") ?? false; + Odyssey = JSON.Value("Odyssey") ?? false; + // Ships + Ship = JSON.Value("Ship") ?? ""; + ShipID = JSON.Value("ShipID") ?? 0; + ShipName = JSON.Value("ShipName") ?? ""; + ShipIdent = JSON.Value("ShipIdent") ?? ""; + // Fuel + FuelLevel = JSON.Value("FuelLevel") ?? 0.0; + FuelCapacity = JSON.Value("FuelCapacity") ?? 0.0; + // Landed/Dead + StartLanded = JSON.Value("StartLanded") ?? false; + StartDead = JSON.Value("StartDead") ?? false; + // GameMode + GameMode = JSON.Value("GameMode") ?? ""; + // Group + Group = JSON.Value("Group") ?? ""; + // Wealth + Credits = JSON.Value("Credits") ?? 0; + Loan = JSON.Value("Loan") ?? 0; + } + } +} diff --git a/edjournal.csproj b/edjournal.csproj index 38d7acd..907374f 100644 --- a/edjournal.csproj +++ b/edjournal.csproj @@ -59,6 +59,7 @@ +