Files
SabreTools/SabreTools.DatItems/Formats/Blank.cs
Matt Nadareski b37aed389e Add nullable context to SabreTools.DatItems
This change also starts migrating the internals of the DatItem formats to the new internal models. Right now, it's basically just acting like a wrapper around those models.
2023-08-14 13:17:51 -04:00

62 lines
1.4 KiB
C#

using System.Xml.Serialization;
using Newtonsoft.Json;
using SabreTools.Core;
namespace SabreTools.DatItems.Formats
{
/// <summary>
/// Represents a blank set from an input DAT
/// </summary>
[JsonObject("blank"), XmlRoot("blank")]
public class Blank : DatItem
{
#region Constructors
/// <summary>
/// Create a default, empty Archive object
/// </summary>
public Blank()
{
ItemType = ItemType.Blank;
}
#endregion
#region Cloning Methods
/// <inheritdoc/>
public override object Clone()
{
return new Blank()
{
ItemType = this.ItemType,
DupeType = this.DupeType,
Machine = this.Machine?.Clone() as Machine,
Source = this.Source?.Clone() as Source,
Remove = this.Remove,
};
}
#endregion
#region Comparision Methods
/// <inheritdoc/>
public override bool Equals(DatItem? other)
{
// If we don't have a blank, return false
if (ItemType != other?.ItemType)
return false;
// Otherwise, treat it as a Blank
Blank? newOther = other as Blank;
// If the archive information matches
return (Machine == newOther!.Machine);
}
#endregion
}
}