mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-15 02:33:10 +00:00
45 lines
1012 B
C#
45 lines
1012 B
C#
using System;
|
|
using System.Xml.Serialization;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace SabreTools.Data.Models.Metadata
|
|
{
|
|
[JsonObject("analog"), XmlRoot("analog")]
|
|
public class Analog : DatItem, ICloneable, IEquatable<Analog>
|
|
{
|
|
#region Properties
|
|
|
|
public string? Mask { get; set; }
|
|
|
|
#endregion
|
|
|
|
public Analog() => ItemType = ItemType.Analog;
|
|
|
|
/// <inheritdoc/>
|
|
public object Clone()
|
|
{
|
|
var obj = new Analog();
|
|
|
|
obj.Mask = Mask;
|
|
|
|
return obj;
|
|
}
|
|
|
|
/// <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;
|
|
}
|
|
}
|
|
}
|