add location message
This commit is contained in:
parent
73f7aca172
commit
8d6411b25b
1
Entry.cs
1
Entry.cs
@ -19,6 +19,7 @@ namespace EDJournal {
|
||||
{ Events.FactionKillBond, typeof(FactionKillBondEntry) },
|
||||
{ Events.FSDJump, typeof(FSDJumpEntry) },
|
||||
{ Events.HullDamage, typeof(HullDamageEntry) },
|
||||
{ Events.Location, typeof(LocationEntry) },
|
||||
{ Events.MarketSell, typeof(MarketSellEntry) },
|
||||
{ Events.MissionAbandoned, typeof(MissionAbandonedEntry) },
|
||||
{ Events.MissionAccepted, typeof(MissionAcceptedEntry) },
|
||||
|
@ -8,6 +8,7 @@
|
||||
public static readonly string FighterDestroyed = "FighterDestroyed";
|
||||
public static readonly string FSDJump = "FSDJump";
|
||||
public static readonly string HullDamage = "HullDamage";
|
||||
public static readonly string Location = "Location";
|
||||
public static readonly string MarketSell = "MarketSell";
|
||||
public static readonly string MissionAbandoned = "MissionAbandoned";
|
||||
public static readonly string MissionAccepted = "MissionAccepted";
|
||||
|
29
LocationEntry.cs
Normal file
29
LocationEntry.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EDJournal {
|
||||
public class LocationEntry : Entry {
|
||||
public string StarSystem { get; set; }
|
||||
public string SystemFaction { get; set; }
|
||||
public string StationName { get; set; }
|
||||
public ulong SystemAddress { get; set; }
|
||||
public string Body { get; set; }
|
||||
public bool Docked { get; set; }
|
||||
|
||||
protected override void Initialise() {
|
||||
StarSystem = JSON.Value<string>("StarSystem") ?? "";
|
||||
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||
Docked = JSON.Value<bool?>("Docked") ?? false;
|
||||
StationName = JSON.Value<string>("StationName") ?? "";
|
||||
|
||||
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
|
||||
if (systemfaction != null) {
|
||||
SystemFaction = systemfaction.Value<string>("Name") ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@
|
||||
<Compile Include="JournalException.cs" />
|
||||
<Compile Include="JournalFile.cs" />
|
||||
<Compile Include="JournalStream.cs" />
|
||||
<Compile Include="LocationEntry.cs" />
|
||||
<Compile Include="MarketSellEntry.cs" />
|
||||
<Compile Include="MissionAbandonedEntry.cs" />
|
||||
<Compile Include="MissionAcceptedEntry.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user