add better entry for MarketSell

This commit is contained in:
Florian Stinglmayr 2021-09-28 15:08:42 +02:00
parent e84d3ed808
commit 0b26303463

View File

@ -1,11 +1,46 @@
namespace EDJournal {
public class MarketSellEntry : Entry {
private int totalsale = 0;
/// <summary>
/// Total value
/// </summary>
public int TotalSale { get; set; }
/// <summary>
/// How many.
/// </summary>
public int Count { get; set; }
/// <summary>
/// Average price paid
/// </summary>
public int AvgPricePaid { get; set; }
/// <summary>
/// Cargo type
/// </summary>
public string Type { get; set; }
/// <summary>
/// Price per unit
/// </summary>
public int SellPrice { get; set; }
/// <summary>
/// Whether the goods were illegal in the target system.
/// </summary>
public bool IllegalGoods { get; set; }
/// <summary>
/// Whether the goods were stolen
/// </summary>
public bool StolenGoods { get; set; }
/// <summary>
/// Whether the goods were sold to the black market
/// </summary>
public bool BlackMarket { get; set; }
protected override void Initialise() {
totalsale = JSON.Value<int>("TotalSale");
Type = JSON.Value<string>("Type") ?? "";
TotalSale = JSON.Value<int?>("TotalSale") ?? 0;
Count = JSON.Value<int?>("Count") ?? 0;
AvgPricePaid = JSON.Value<int?>("AvgPricePaid") ?? 0;
IllegalGoods = JSON.Value<bool?>("IllegalGoods") ?? false;
StolenGoods = JSON.Value<bool?>("StolenGoods") ?? false;
BlackMarket = JSON.Value<bool?>("BlackMarket") ?? false;
}
public int TotalSale => totalsale;
}
}