using System.Xml.Serialization; using Newtonsoft.Json; namespace SabreTools.Metadata.DatItems.Formats { /// /// Represents which BIOS(es) is associated with a set /// [JsonObject("biosset"), XmlRoot("biosset")] public sealed class BiosSet : DatItem { #region Properties public bool? Default { get => _internal.Default; set => _internal.Default = value; } public string? Description { get => _internal.Description; set => _internal.Description = value; } /// /> public override Data.Models.Metadata.ItemType ItemType => Data.Models.Metadata.ItemType.BiosSet; public string? Name { get => _internal.Name; set => _internal.Name = value; } #endregion #region Constructors public BiosSet() : base() { } public BiosSet(Data.Models.Metadata.BiosSet item) : base(item) { } public BiosSet(Data.Models.Metadata.BiosSet item, Machine machine, Source source) : this(item) { Source = source; CopyMachineInformation(machine); } public BiosSet(Data.Models.Metadata.BiosSet item, long machineIndex, long sourceIndex) : this(item) { SourceIndex = sourceIndex; MachineIndex = machineIndex; } #endregion #region Accessors /// public override string? GetName() => Name; /// public override void SetName(string? name) => Name = name; #endregion #region Cloning Methods /// public override object Clone() => new BiosSet(GetInternalClone()); /// public override Data.Models.Metadata.BiosSet GetInternalClone() => _internal.Clone() as Data.Models.Metadata.BiosSet ?? new(); #endregion #region Comparision Methods /// public override bool Equals(DatItem? other) { // If the other item is null if (other is null) return false; // If the type matches if (other is BiosSet otherBiosSet) return _internal.Equals(otherBiosSet._internal); // Everything else fails return false; } #endregion } }