mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace SabreTools.Metadata.DatItems.Formats
|
|
{
|
|
/// <summary>
|
|
/// SoftwareList part information
|
|
/// </summary>
|
|
/// <remarks>One Part can contain multiple PartFeature, DataArea, DiskArea, and DipSwitch items</remarks>
|
|
[JsonObject("part"), XmlRoot("part")]
|
|
public sealed class Part : DatItem<Data.Models.Metadata.Part>
|
|
{
|
|
#region Fields
|
|
|
|
/// <inheritdoc>/>
|
|
protected override ItemType ItemType => ItemType.Part;
|
|
|
|
[JsonIgnore]
|
|
public bool FeaturesSpecified
|
|
{
|
|
get
|
|
{
|
|
var features = GetFieldValue<PartFeature[]?>(Data.Models.Metadata.Part.FeatureKey);
|
|
return features is not null && features.Length > 0;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public Part() : base() { }
|
|
|
|
public Part(Data.Models.Metadata.Part item) : base(item) { }
|
|
|
|
public Part(Data.Models.Metadata.Part item, Machine machine, Source source) : this(item)
|
|
{
|
|
SetFieldValue<Source?>(SourceKey, source);
|
|
CopyMachineInformation(machine);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|