2026-04-02 15:49:06 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Xml.Serialization;
|
2025-09-26 10:20:48 -04:00
|
|
|
|
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("analog"), XmlRoot("analog")]
|
2026-04-02 16:07:34 -04:00
|
|
|
|
public class Analog : DatItem, ICloneable, IEquatable<Analog>
|
2025-09-26 10:20:48 -04:00
|
|
|
|
{
|
2026-04-02 11:18:49 -04:00
|
|
|
|
#region Properties
|
2025-09-26 10:20:48 -04:00
|
|
|
|
|
2026-04-02 11:18:49 -04:00
|
|
|
|
public string? Mask { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2026-04-01 11:24:33 -04:00
|
|
|
|
public Analog() => ItemType = ItemType.Analog;
|
2026-04-02 15:49:06 -04:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
var obj = new Analog();
|
|
|
|
|
|
|
|
|
|
|
|
obj.Mask = Mask;
|
|
|
|
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
|
|
}
|
2026-04-02 16:07:34 -04:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool Equals(Analog? other)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Null never matches
|
|
|
|
|
|
if (other is null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
|
|
if ((Mask is null) ^ (other.Mask is null))
|
|
|
|
|
|
return false;
|
|
|
|
|
|
else if (Mask is not null && !Mask.Equals(other.Mask, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
2025-09-26 10:20:48 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|