refactor ShipTargeted for murders

This commit is contained in:
Florian Stinglmayr 2022-02-11 13:06:47 +01:00
parent be1f0b72e3
commit 5b9213cc92

View File

@ -1,38 +1,31 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EDJournal { namespace EDJournal {
public class ShipTargetedEntry : Entry { public class ShipTargetedEntry : Entry {
private string ship = null; public string Ship { get; set; }
private string pilot = null; public long ScanStage { get; set; }
private string rank = null; public string PilotName { get; set; }
private double shield = 0.0; public string PilotNameLocalised { get; set; }
private double hull = 0.0; public string PilotRank { get; set; }
private int bounty = 0; public double ShieldHealth { get; set; }
private string legalstatus = null; public double HullHealth { get; set; }
private string faction = null; public long Bounty { get; set; }
public string LegalStatus { get; set; }
public string Ship => ship; public string Faction { get; set; }
public string Pilot => pilot; public string Power { get; set; }
public string Rank => rank;
public double ShieldHealth => shield;
public double HullHealth => hull;
public int Bounty => bounty;
public string LegalStatus => legalstatus;
public string Faction => faction;
protected override void Initialise() { protected override void Initialise() {
ship = JSON.Value<string>("Ship_Localised") ?? ""; ScanStage = JSON.Value<long?>("ScanStage") ?? 0;
pilot = JSON.Value<string>("PilotName_Localised") ?? ""; Ship = JSON.Value<string>("Ship_Localised") ?? "";
rank = JSON.Value<string>("PilotRank") ?? ""; PilotName = JSON.Value<string>("PilotName") ?? "";
shield = JSON.Value<double?>("ShieldHealth") ?? 0.0; PilotNameLocalised = JSON.Value<string>("PilotName_Localised") ?? "";
hull = JSON.Value<double?>("HullHealth") ?? 0.0; PilotRank = JSON.Value<string>("PilotRank") ?? "";
bounty = JSON.Value<int?>("Bounty") ?? 0; ShieldHealth = JSON.Value<double?>("ShieldHealth") ?? 0.0;
legalstatus = JSON.Value<string>("LegalStatus") ?? "Clean"; HullHealth = JSON.Value<double?>("HullHealth") ?? 0.0;
faction = JSON.Value<string>("Faction") ?? ""; Bounty = JSON.Value<long?>("Bounty") ?? 0;
LegalStatus = JSON.Value<string>("LegalStatus") ?? "Clean";
Faction = JSON.Value<string>("Faction") ?? "";
Power = JSON.Value<string>("Power") ?? "";
} }
} }
} }