Compare commits
3 Commits
1dd95aff82
...
2bef2a6c81
Author | SHA1 | Date | |
---|---|---|---|
2bef2a6c81 | |||
9b31077a11 | |||
86bd9f76c1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@
|
|||||||
/bin/Release
|
/bin/Release
|
||||||
/bin/Debug
|
/bin/Debug
|
||||||
/packages/Newtonsoft.Json.13.0.1
|
/packages/Newtonsoft.Json.13.0.1
|
||||||
|
/.vs/edjournal/v17/.suo
|
||||||
|
16
CommanderEntry.cs
Normal file
16
CommanderEntry.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EDJournal {
|
||||||
|
public class CommanderEntry : Entry {
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string FID { get; set; }
|
||||||
|
protected override void Initialise() {
|
||||||
|
Name = JSON.Value<string>("Name") ?? "";
|
||||||
|
FID = JSON.Value<string>("FID") ?? "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
Entry.cs
1
Entry.cs
@ -13,6 +13,7 @@ namespace EDJournal {
|
|||||||
public class Entry {
|
public class Entry {
|
||||||
private static readonly Dictionary<string, Type> classes = new Dictionary<string, Type> {
|
private static readonly Dictionary<string, Type> classes = new Dictionary<string, Type> {
|
||||||
{ Events.Bounty, typeof(BountyEntry) },
|
{ Events.Bounty, typeof(BountyEntry) },
|
||||||
|
{ Events.Commander, typeof(CommanderEntry) },
|
||||||
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
||||||
{ Events.Died, typeof(DiedEntry) },
|
{ Events.Died, typeof(DiedEntry) },
|
||||||
{ Events.Docked, typeof(DockedEntry) },
|
{ Events.Docked, typeof(DockedEntry) },
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
namespace EDJournal {
|
namespace EDJournal {
|
||||||
public class Events {
|
public class Events {
|
||||||
public static readonly string Bounty = "Bounty";
|
public static readonly string Bounty = "Bounty";
|
||||||
|
public static readonly string Commander = "Commander";
|
||||||
public static readonly string CommitCrime = "CommitCrime";
|
public static readonly string CommitCrime = "CommitCrime";
|
||||||
public static readonly string Died = "Died";
|
public static readonly string Died = "Died";
|
||||||
public static readonly string Docked = "Docked";
|
public static readonly string Docked = "Docked";
|
||||||
|
@ -6,6 +6,8 @@ namespace EDJournal {
|
|||||||
protected override void Initialise() {
|
protected override void Initialise() {
|
||||||
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||||
StarSystem = JSON.Value<string>("StarSystem");
|
StarSystem = JSON.Value<string>("StarSystem");
|
||||||
|
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
|
||||||
|
|
||||||
var faction = JSON.Value<JObject>("SystemFaction");
|
var faction = JSON.Value<JObject>("SystemFaction");
|
||||||
if (faction != null) {
|
if (faction != null) {
|
||||||
SystemFaction = faction.Value<string>("Name");
|
SystemFaction = faction.Value<string>("Name");
|
||||||
@ -21,12 +23,10 @@ namespace EDJournal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public long[] StarPos { get; set; }
|
||||||
public string StarSystem { get; set; }
|
public string StarSystem { get; set; }
|
||||||
|
|
||||||
public string SystemFaction { get; set; }
|
public string SystemFaction { get; set; }
|
||||||
|
|
||||||
public ulong SystemAddress { get; set; }
|
public ulong SystemAddress { get; set; }
|
||||||
|
|
||||||
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ namespace EDJournal {
|
|||||||
public ulong SystemAddress { get; set; }
|
public ulong SystemAddress { get; set; }
|
||||||
public string Body { get; set; }
|
public string Body { get; set; }
|
||||||
public bool Docked { get; set; }
|
public bool Docked { get; set; }
|
||||||
|
public long[] StarPos { get; set; }
|
||||||
|
|
||||||
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ namespace EDJournal {
|
|||||||
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||||
Docked = JSON.Value<bool?>("Docked") ?? false;
|
Docked = JSON.Value<bool?>("Docked") ?? false;
|
||||||
StationName = JSON.Value<string>("StationName") ?? "";
|
StationName = JSON.Value<string>("StationName") ?? "";
|
||||||
|
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
|
||||||
|
|
||||||
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
|
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
|
||||||
if (systemfaction != null) {
|
if (systemfaction != null) {
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BountyEntry.cs" />
|
<Compile Include="BountyEntry.cs" />
|
||||||
|
<Compile Include="CommanderEntry.cs" />
|
||||||
<Compile Include="CommitCrimeEntry.cs" />
|
<Compile Include="CommitCrimeEntry.cs" />
|
||||||
<Compile Include="Credits.cs" />
|
<Compile Include="Credits.cs" />
|
||||||
<Compile Include="CrimeTypes.cs" />
|
<Compile Include="CrimeTypes.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user