add support for Powerplay message

This commit is contained in:
Florian Stinglmayr 2024-11-14 12:14:36 +01:00
parent 1da6f41ec8
commit cdbca10f2d
3 changed files with 34 additions and 0 deletions

View File

@ -39,6 +39,7 @@ public class Entry {
{ Events.Missions, typeof(MissionsEntry) },
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
{ Events.Music, typeof(MusicEntry) },
{ Events.Powerplay, typeof(PowerplayEntry) },
{ Events.ReceiveText, typeof(ReceiveTextEntry) },
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
{ Events.SearchAndRescue, typeof(SearchAndRescueEntry) },

View File

@ -29,6 +29,7 @@ public class Events {
public static readonly string Missions = "Missions";
public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
public static readonly string Music = "Music";
public static readonly string Powerplay = "Powerplay";
public static readonly string ReceiveText = "ReceiveText";
public static readonly string RedeemVoucher = "RedeemVoucher";
public static readonly string SearchAndRescue = "SearchAndRescue";

View File

@ -0,0 +1,32 @@
using System.Reflection;
namespace EDPlayerJournal.Entries {
public class PowerplayEntry : Entry {
/// <summary>
/// Name of the power
/// </summary>
public string Power { get; set; } = string.Empty;
/// <summary>
/// Player rank
/// </summary>
public int Rank { get; set; } = 0;
/// <summary>
/// Current merits of the player
/// </summary>
public long Merits { get; set; } = 0;
/// <summary>
/// Time pledged (in seconds?)
/// </summary>
public long TimePledged { get; set; } = 0;
protected override void Initialise() {
Power = JSON.Value<string>("Power") ?? string.Empty;
Rank = JSON.Value<int?>("Rank") ?? 0;
Merits = JSON.Value<long?>("Merits") ?? 0;
TimePledged = JSON.Value<long?>("TimePledged") ?? 0;
}
}
}