Files
SabreTools.Serialization/SabreTools.Data.Models/Metadata/SoftwareList.cs

68 lines
1.8 KiB
C#
Raw Normal View History

using System;
2025-09-26 10:20:48 -04:00
using System.Xml.Serialization;
using Newtonsoft.Json;
2025-09-26 13:06:18 -04:00
namespace SabreTools.Data.Models.Metadata
2025-09-26 10:20:48 -04:00
{
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
public class SoftwareList : DatItem, ICloneable, IEquatable<SoftwareList>
2025-09-26 10:20:48 -04:00
{
2026-04-01 13:18:45 -04:00
#region Properties
public string? Filter { get; set; }
2026-04-01 13:18:45 -04:00
public string? Name { get; set; }
2026-04-02 02:18:08 -04:00
/// <remarks>(original|compatible)</remarks>
public SoftwareListStatus? Status { get; set; }
2026-04-02 11:18:49 -04:00
public string? Tag { get; set; }
2026-04-01 13:18:45 -04:00
#endregion
public SoftwareList() => ItemType = ItemType.SoftwareList;
/// <inheritdoc/>
public object Clone()
{
var obj = new SoftwareList();
2025-09-26 10:20:48 -04:00
obj.Filter = Filter;
obj.Name = Name;
obj.Status = Status;
obj.Tag = Tag;
2025-09-26 10:20:48 -04:00
return obj;
}
2025-09-26 10:20:48 -04:00
/// <inheritdoc/>
public bool Equals(SoftwareList? other)
{
// Null never matches
if (other is null)
return false;
// Properties
if ((Filter is null) ^ (other.Filter is null))
return false;
else if (Filter is not null && !Filter.Equals(other.Filter, StringComparison.OrdinalIgnoreCase))
return false;
if ((Name is null) ^ (other.Name is null))
return false;
else if (Name is not null && !Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase))
return false;
if (Status != other.Status)
return false;
if ((Tag is null) ^ (other.Tag is null))
return false;
else if (Tag is not null && !Tag.Equals(other.Tag, StringComparison.OrdinalIgnoreCase))
return false;
return true;
}
2025-09-26 10:20:48 -04:00
}
}