add capshipbond entry

This commit is contained in:
Florian Stinglmayr 2022-11-28 19:43:51 +01:00
parent dd1d7ff091
commit 12ba6d4d96
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,24 @@
namespace EDPlayerJournal.Entries;
public class CapShipBondEntry : Entry {
/// <summary>
/// Reward gained
/// </summary>
public ulong Reward { get; set; } = 0;
/// <summary>
/// Victim faction, i.e. to whom the cap ship belongs
/// </summary>
public string? VictimFaction { get; set; }
/// <summary>
/// Awarding faction.
/// </summary>
public string? AwardingFaction { get; set; }
protected override void Initialise() {
Reward = JSON.Value<ulong?>("Reward") ?? 0;
VictimFaction = JSON.Value<string?>("VictimFaction");
AwardingFaction = JSON.Value<string?>("AwardingFaction");
}
}

View File

@ -13,6 +13,7 @@ namespace EDPlayerJournal.Entries;
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.CapShipBond, typeof(CapShipBondEntry) },
{ Events.Commander, typeof(CommanderEntry) }, { Events.Commander, typeof(CommanderEntry) },
{ Events.CommitCrime, typeof(CommitCrimeEntry) }, { Events.CommitCrime, typeof(CommitCrimeEntry) },
{ Events.Died, typeof(DiedEntry) }, { Events.Died, typeof(DiedEntry) },

View File

@ -2,6 +2,7 @@
public class Events { public class Events {
public static readonly string Bounty = "Bounty"; public static readonly string Bounty = "Bounty";
public static readonly string CapShipBond = "CapShipBond";
public static readonly string Commander = "Commander"; 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";