add Commander event

This commit is contained in:
Florian Stinglmayr 2022-04-28 09:57:50 +02:00
parent 86bd9f76c1
commit 9b31077a11
5 changed files with 20 additions and 0 deletions

1
.gitignore vendored
View File

@ -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
View 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") ?? "";
}
}
}

View File

@ -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) },

View File

@ -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";

View File

@ -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" />