using Newtonsoft.Json.Linq;
namespace EDPlayerJournal.Entries;
public class MissionsEntry : Entry {
///
/// List of currently active mission.
///
public List Active { get; set; } = new List();
///
/// List of failed missions, not yet discarded.
///
public List Failed { get; set; } = new List();
///
/// List of completed missions, not yet turned in.
///
public List Complete { get; set; } = new List();
protected override void Initialise() {
JArray? arr;
arr = JSON.Value("Active");
if (arr != null) {
foreach (JObject item in arr.Children().OfType()) {
Mission m = Mission.FromMissionAccepted(item);
Active.Add(m);
}
}
arr = JSON.Value("Failed");
if (arr != null) {
foreach (JObject item in arr.Children().OfType()) {
Mission m = Mission.FromMissionAccepted(item);
Failed.Add(m);
}
}
arr = JSON.Value("Complete");
if (arr != null) {
foreach (JObject item in arr.Children().OfType()) {
Mission m = Mission.FromMissionAccepted(item);
Complete.Add(m);
}
}
}
}