using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Data.Extensions;
namespace SabreTools.Metadata.DatItems.Formats
{
///
/// Represents which SoftwareList(s) is associated with a set
///
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
public sealed class SoftwareList : DatItem
{
#region Fields
/// />
protected override ItemType ItemType => ItemType.SoftwareList;
#endregion
#region Constructors
public SoftwareList() : base() { }
public SoftwareList(Data.Models.Metadata.SoftwareList item) : base(item)
{
// Process flag values
string? status = ReadString(Data.Models.Metadata.SoftwareList.StatusKey);
if (status is not null)
Write(Data.Models.Metadata.SoftwareList.StatusKey, status.AsSoftwareListStatus()?.AsStringValue());
// Handle subitems
// TODO: Handle the Software subitem
}
public SoftwareList(Data.Models.Metadata.SoftwareList item, Machine machine, Source source) : this(item)
{
Write(SourceKey, source);
CopyMachineInformation(machine);
}
#endregion
#region Cloning Methods
///
public override object Clone() => new SoftwareList(_internal.Clone() as Data.Models.Metadata.SoftwareList ?? []);
#endregion
}
}