refactor MissionAccepted

This commit is contained in:
Florian Stinglmayr 2022-02-14 17:44:41 +01:00
parent 2813a19186
commit 6784eba6c6

View File

@ -1,33 +1,24 @@
 
namespace EDJournal { namespace EDJournal {
public class MissionAcceptedEntry : Entry { public class MissionAcceptedEntry : Entry {
private string faction = null; public string Faction { get; set; }
private string targetfaction = null; public string TargetFaction { get; set; }
private string name = null; public string Name { get; set; }
private string localisedname = null; public string LocalisedName { get; set; }
private string localisedtargettype = null; public string LocalisedTargetType { get; set; }
private int killcount = 0; public int KillCount { get; set; }
private int missionid = 0; public ulong MissionID { get; set; }
private int reward = 0; public long Reward { get; set; }
public string Faction => faction;
public string TargetFaction => targetfaction;
public string Name => name;
public string LocalisedName => localisedname;
public string LocalisedTargetType => localisedtargettype;
public int KillCount => killcount;
public int MissionID => missionid;
public int Reward => reward;
protected override void Initialise() { protected override void Initialise() {
faction = JSON.Value<string>("Faction") ?? ""; Faction = JSON.Value<string>("Faction") ?? "";
targetfaction = JSON.Value<string>("TargetFaction") ?? ""; TargetFaction = JSON.Value<string>("TargetFaction") ?? "";
name = JSON.Value<string>("Name") ?? ""; Name = JSON.Value<string>("Name") ?? "";
localisedname = JSON.Value<string>("LocalisedName") ?? ""; LocalisedName = JSON.Value<string>("LocalisedName") ?? "";
localisedtargettype = JSON.Value<string>("TargetType_Localised") ?? ""; LocalisedTargetType = JSON.Value<string>("TargetType_Localised") ?? "";
killcount = JSON.Value<int?>("KillCount") ?? 0; KillCount = JSON.Value<int?>("KillCount") ?? 0;
missionid = JSON.Value<int?>("MissionID") ?? 0; MissionID = JSON.Value<ulong?>("MissionID") ?? 0;
reward = JSON.Value<int?>("Reward") ?? 0; Reward = JSON.Value<long?>("Reward") ?? 0;
} }
} }
} }