Remove nearly all explict fields

This commit is contained in:
Matt Nadareski
2024-03-09 21:34:26 -05:00
parent c755abf4c0
commit 24d4e352a4
79 changed files with 1723 additions and 3554 deletions

View File

@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core;
@@ -15,22 +13,15 @@ namespace SabreTools.DatItems.Formats
{
#region Fields
[JsonProperty("interface"), XmlElement("interface")]
public string? Interface
{
get => _internal.ReadString(Models.Metadata.Part.InterfaceKey);
set => _internal[Models.Metadata.Part.InterfaceKey] = value;
}
[JsonProperty("features", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("features")]
public List<PartFeature>? Features
{
get => _internal.Read<PartFeature[]>(Models.Metadata.Part.FeatureKey)?.ToList();
set => _internal[Models.Metadata.Part.FeatureKey] = value?.ToArray();
}
[JsonIgnore]
public bool FeaturesSpecified { get { return Features != null && Features.Count > 0; } }
public bool FeaturesSpecified
{
get
{
var features = GetFieldValue<PartFeature[]?>(Models.Metadata.Part.FeatureKey);
return features != null && features.Length > 0;
}
}
#endregion