From 25fad241e912248663a1eac2e3ad231cd3420037 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 22 Feb 2022 13:47:39 -0800 Subject: [PATCH] Revert DataArea change This is being reverted because it was so disjoint from the other work that it is meant to work with that I was unaware of the intent of the code. This is not doing something that I feel is correct, so any changes here need to be merged into the other, more relevant PRs so it can be reviewed wholistically. --- SabreTools.DatItems/Formats/Part.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SabreTools.DatItems/Formats/Part.cs b/SabreTools.DatItems/Formats/Part.cs index 9adef25e..3dc07014 100644 --- a/SabreTools.DatItems/Formats/Part.cs +++ b/SabreTools.DatItems/Formats/Part.cs @@ -27,6 +27,13 @@ namespace SabreTools.DatItems.Formats [XmlElement("features")] public List Features { get; set; } + [JsonProperty("dataAreas", DefaultValueHandling = DefaultValueHandling.Ignore)] + [XmlElement("dataAreas")] + public List DataAreas { get; set; } + + [JsonIgnore] + public bool DataAreasSpecified { get { return DataAreas != null && DataAreas.Count > 0; } } + [JsonIgnore] public bool FeaturesSpecified { get { return Features != null && Features.Count > 0; } } @@ -71,6 +78,7 @@ namespace SabreTools.DatItems.Formats Name = this.Name, Interface = this.Interface, Features = this.Features, + DataAreas = this.DataAreas, }; } @@ -102,6 +110,15 @@ namespace SabreTools.DatItems.Formats } } + // If the dataareas match + if (DataAreasSpecified) + { + foreach (DataArea dataArea in DataAreas) + { + match &= newOther.DataAreas.Contains(dataArea); + } + } + return match; }