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 {
public class MissionAcceptedEntry : Entry {
private string faction = null;
private string targetfaction = null;
private string name = null;
private string localisedname = null;
private string localisedtargettype = null;
private int killcount = 0;
private int missionid = 0;
private int reward = 0;
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;
public string Faction { get; set; }
public string TargetFaction { get; set; }
public string Name { get; set; }
public string LocalisedName { get; set; }
public string LocalisedTargetType { get; set; }
public int KillCount { get; set; }
public ulong MissionID { get; set; }
public long Reward { get; set; }
protected override void Initialise() {
faction = JSON.Value<string>("Faction") ?? "";
targetfaction = JSON.Value<string>("TargetFaction") ?? "";
name = JSON.Value<string>("Name") ?? "";
localisedname = JSON.Value<string>("LocalisedName") ?? "";
localisedtargettype = JSON.Value<string>("TargetType_Localised") ?? "";
killcount = JSON.Value<int?>("KillCount") ?? 0;
missionid = JSON.Value<int?>("MissionID") ?? 0;
reward = JSON.Value<int?>("Reward") ?? 0;
Faction = JSON.Value<string>("Faction") ?? "";
TargetFaction = JSON.Value<string>("TargetFaction") ?? "";
Name = JSON.Value<string>("Name") ?? "";
LocalisedName = JSON.Value<string>("LocalisedName") ?? "";
LocalisedTargetType = JSON.Value<string>("TargetType_Localised") ?? "";
KillCount = JSON.Value<int?>("KillCount") ?? 0;
MissionID = JSON.Value<ulong?>("MissionID") ?? 0;
Reward = JSON.Value<long?>("Reward") ?? 0;
}
}
}