add dataareas to part (#52)

* add dataareas to part

to add additional dataareas in rom element

* adding dataareas

while updating vs code, references where lost, but i hope i'll get everything to the correct place...
This commit is contained in:
Lothrien
2022-02-22 22:09:11 +01:00
committed by GitHub
parent 243e3507d6
commit 470fc924a0

View File

@@ -27,6 +27,13 @@ namespace SabreTools.DatItems.Formats
[XmlElement("features")]
public List<PartFeature> Features { get; set; }
[JsonProperty("dataAreas", DefaultValueHandling = DefaultValueHandling.Ignore)]
[XmlElement("dataAreas")]
public List<DataArea> 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;
}