Files

99 lines
2.5 KiB
C#
Raw Permalink Normal View History

using System.Xml.Serialization;
2026-03-24 18:03:01 -04:00
using Newtonsoft.Json;
namespace SabreTools.Metadata.DatItems.Formats
{
/// <summary>
/// Represents which SoftwareList(s) is associated with a set
/// </summary>
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
public sealed class SoftwareList : DatItem<Data.Models.Metadata.SoftwareList>
{
2026-04-04 16:07:37 -04:00
#region Properties
2026-04-02 02:18:08 -04:00
public string? Filter
{
get => _internal.Filter;
set => _internal.Filter = value;
}
2026-04-02 21:07:41 -04:00
/// <inheritdoc>/>
public override Data.Models.Metadata.ItemType ItemType
=> Data.Models.Metadata.ItemType.SoftwareList;
2026-04-02 13:21:37 -04:00
public string? Name
{
get => _internal.Name;
set => _internal.Name = value;
2026-04-02 13:21:37 -04:00
}
2026-04-02 02:18:08 -04:00
public Data.Models.Metadata.SoftwareListStatus? Status
{
get => _internal.Status;
set => _internal.Status = value;
2026-04-02 02:18:08 -04:00
}
2026-04-02 11:18:49 -04:00
public string? Tag
{
get => _internal.Tag;
set => _internal.Tag = value;
2026-04-02 11:18:49 -04:00
}
2026-04-02 02:18:08 -04:00
#endregion
2026-03-24 18:03:01 -04:00
#region Constructors
public SoftwareList() : base() { }
public SoftwareList(Data.Models.Metadata.SoftwareList item) : base(item) { }
2026-03-24 18:03:01 -04:00
public SoftwareList(Data.Models.Metadata.SoftwareList item, Machine machine, Source source) : this(item)
{
Source = source;
2026-03-24 18:03:01 -04:00
CopyMachineInformation(machine);
}
#endregion
2026-03-26 23:46:20 -04:00
#region Accessors
/// <inheritdoc/>
public override string? GetName() => Name;
/// <inheritdoc/>
public override void SetName(string? name) => Name = name;
#endregion
2026-03-26 23:46:20 -04:00
#region Cloning Methods
/// <inheritdoc/>
2026-04-04 13:11:10 -04:00
public override object Clone() => new SoftwareList(GetInternalClone());
/// <inheritdoc/>
public override Data.Models.Metadata.SoftwareList GetInternalClone()
=> _internal.Clone() as Data.Models.Metadata.SoftwareList ?? new();
2026-03-26 23:46:20 -04:00
#endregion
2026-04-04 19:14:11 -04:00
#region Comparision Methods
2026-04-04 19:47:00 -04:00
/// <inheritdoc/>
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 SoftwareList otherSoftwareList)
return _internal.Equals(otherSoftwareList._internal);
2026-04-04 19:47:00 -04:00
// Everything else fails
return false;
}
2026-04-04 19:14:11 -04:00
#endregion
2026-03-24 18:03:01 -04:00
}
}