using System.Xml.Serialization; using Newtonsoft.Json; using SabreTools.Core; namespace SabreTools.DatItems.Formats { /// /// Represents which SoftwareList(s) is associated with a set /// /// /// TODO: Add new fields to documentation /// [JsonObject("softwarelist"), XmlRoot("softwarelist")] public class SoftwareList : DatItem { #region Accessors /// public override string? GetName() => GetFieldValue(Models.Metadata.SoftwareList.NameKey); /// public override void SetName(string? name) => SetFieldValue(Models.Metadata.SoftwareList.NameKey, name); #endregion #region Constructors /// /// Create a default, empty SoftwareList object /// public SoftwareList() { _internal = new Models.Metadata.SoftwareList(); Machine = new Machine(); SetName(string.Empty); ItemType = ItemType.SoftwareList; } /// /// Create a SoftwareList object from the internal model /// public SoftwareList(Models.Metadata.SoftwareList? item) { _internal = item ?? []; Machine = new Machine(); ItemType = ItemType.SoftwareList; } #endregion #region Cloning Methods public override object Clone() { return new SoftwareList() { ItemType = this.ItemType, DupeType = this.DupeType, Machine = this.Machine.Clone() as Machine ?? new Machine(), Source = this.Source?.Clone() as Source, Remove = this.Remove, _internal = this._internal?.Clone() as Models.Metadata.SoftwareList ?? [], }; } #endregion } }