edjournal/ShipTargetedEntry.cs

39 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EDJournal {
public class ShipTargetedEntry : Entry {
private string ship = null;
private string pilot = null;
private string rank = null;
private double shield = 0.0;
private double hull = 0.0;
private int bounty = 0;
private string legalstatus = null;
private string faction = null;
public string Ship => ship;
public string Pilot => pilot;
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() {
ship = JSON.Value<string>("Ship_Localised") ?? "";
pilot = JSON.Value<string>("PilotName_Localised") ?? "";
rank = JSON.Value<string>("PilotRank") ?? "";
shield = JSON.Value<double?>("ShieldHealth") ?? 0.0;
hull = JSON.Value<double?>("HullHealth") ?? 0.0;
bounty = JSON.Value<int?>("Bounty") ?? 0;
legalstatus = JSON.Value<string>("LegalStatus") ?? "Clean";
faction = JSON.Value<string>("Faction") ?? "";
}
}
}