Files

58 lines
1.4 KiB
C#
Raw Permalink 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("conflocation"), XmlRoot("conflocation")]
public class ConfLocation : DatItem, ICloneable, IEquatable<ConfLocation>
2025-09-26 10:20:48 -04:00
{
2026-04-01 13:18:45 -04:00
#region Properties
2026-04-01 21:59:16 -04:00
/// <remarks>(yes|no) "no"</remarks>
public bool? Inverted { get; set; }
2026-04-01 13:18:45 -04:00
public string? Name { get; set; }
public long? Number { get; set; }
2026-04-01 13:18:45 -04:00
#endregion
public ConfLocation() => ItemType = ItemType.ConfLocation;
2025-09-26 10:20:48 -04:00
/// <inheritdoc/>
public object Clone()
{
var obj = new ConfLocation();
2025-09-26 10:20:48 -04:00
obj.Inverted = Inverted;
obj.Name = Name;
obj.Number = Number;
2025-09-26 10:20:48 -04:00
return obj;
}
/// <inheritdoc/>
public bool Equals(ConfLocation? other)
{
// Null never matches
if (other is null)
return false;
// Properties
if (Inverted != other.Inverted)
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 (Number != other.Number)
return false;
return true;
}
2025-09-26 10:20:48 -04:00
}
}