diff --git a/Entry.cs b/Entry.cs index d03ab14..1c8cd3f 100644 --- a/Entry.cs +++ b/Entry.cs @@ -25,6 +25,7 @@ namespace EDJournal { { Events.ShipTargeted, typeof(ShipTargetedEntry) }, { Events.UnderAttack, typeof(UnderAttackEntry) }, { Events.ShieldState, typeof(ShieldStateEntry) }, + { Events.HullDamage, typeof(HullDamageEntry) }, }; private string eventtype = null; diff --git a/Events.cs b/Events.cs index 20517b5..ae64482 100644 --- a/Events.cs +++ b/Events.cs @@ -16,5 +16,7 @@ public static readonly string ShieldState = "ShieldState"; public static readonly string MissionRedirected = "MissionRedirected"; public static readonly string UnderAttack = "UnderAttack"; + public static readonly string HullDamage = "HullDamage"; + public static readonly string FighterDestroyed = "FighterDestroyed"; } } diff --git a/HullDamageEntry.cs b/HullDamageEntry.cs new file mode 100644 index 0000000..2364130 --- /dev/null +++ b/HullDamageEntry.cs @@ -0,0 +1,17 @@ +namespace EDJournal { + public class HullDamageEntry : Entry { + private double health = 0; + private bool playerpilot = false; + private bool fighter = false; + + public double Health => health; + public bool PlayerPilot => playerpilot; + public bool Fighter => fighter; + + protected override void Initialise() { + health = JSON.Value("Health") ?? 100.0; + playerpilot = JSON.Value("PlayerPilot") ?? true; + fighter = JSON.Value("Fighter") ?? false; + } + } +} diff --git a/edjournal.csproj b/edjournal.csproj index 2ff5053..88bc842 100644 --- a/edjournal.csproj +++ b/edjournal.csproj @@ -51,6 +51,7 @@ +