2024-03-09 21:34:26 -05:00
|
|
|
|
using System.Xml.Serialization;
|
2020-09-04 14:10:35 -07:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
2021-02-02 10:23:43 -08:00
|
|
|
|
namespace SabreTools.DatItems.Formats
|
2020-09-04 14:10:35 -07:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// SoftwareList part information
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>One Part can contain multiple PartFeature, DataArea, DiskArea, and DipSwitch items</remarks>
|
2020-09-08 10:12:41 -07:00
|
|
|
|
[JsonObject("part"), XmlRoot("part")]
|
2024-03-10 20:39:54 -04:00
|
|
|
|
public sealed class Part : DatItem<Models.Metadata.Part>
|
2020-09-04 14:10:35 -07:00
|
|
|
|
{
|
|
|
|
|
|
#region Fields
|
|
|
|
|
|
|
2024-03-10 20:39:54 -04:00
|
|
|
|
/// <inheritdoc>/>
|
|
|
|
|
|
protected override ItemType ItemType => ItemType.Part;
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc>/>
|
|
|
|
|
|
protected override string? NameKey => Models.Metadata.Part.NameKey;
|
|
|
|
|
|
|
2024-03-09 21:34:26 -05:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public bool FeaturesSpecified
|
2023-08-14 13:17:51 -04:00
|
|
|
|
{
|
2024-03-09 21:34:26 -05:00
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
var features = GetFieldValue<PartFeature[]?>(Models.Metadata.Part.FeatureKey);
|
|
|
|
|
|
return features != null && features.Length > 0;
|
|
|
|
|
|
}
|
2023-08-14 13:17:51 -04:00
|
|
|
|
}
|
2020-09-04 14:10:35 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Constructors
|
|
|
|
|
|
|
2024-03-10 20:39:54 -04:00
|
|
|
|
public Part() : base() { }
|
2025-01-11 23:34:26 -05:00
|
|
|
|
|
2024-03-10 20:39:54 -04:00
|
|
|
|
public Part(Models.Metadata.Part item) : base(item) { }
|
2020-09-04 14:10:35 -07:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|