Files
SabreTools/SabreTools.Library/DatItems/Blank.cs
Matt Nadareski d727385fb8 Create and use DiskArea/DataArea
This has the added benefit of clearing out a lot of boilerplate for new DatItem types, since DiskArea only pertains to the Disk type and DataArea only pertains to the Rom type
2020-09-03 11:02:06 -07:00

71 lines
1.7 KiB
C#

using Newtonsoft.Json;
namespace SabreTools.Library.DatItems
{
/// <summary>
/// Represents a blank set from an input DAT
/// </summary>
[JsonObject("blank")]
public class Blank : DatItem
{
#region Constructors
/// <summary>
/// Create a default, empty Archive object
/// </summary>
public Blank()
{
ItemType = ItemType.Blank;
}
#endregion
#region Cloning Methods
public override object Clone()
{
return new Blank()
{
ItemType = this.ItemType,
DupeType = this.DupeType,
AltName = this.AltName,
AltTitle = this.AltTitle,
Original = this.Original,
OpenMSXSubType = this.OpenMSXSubType,
OpenMSXType = this.OpenMSXType,
Remark = this.Remark,
Boot = this.Boot,
Part = this.Part,
Value = this.Value,
LoadFlag = this.LoadFlag,
Machine = this.Machine.Clone() as Machine,
Source = this.Source.Clone() as Source,
Remove = this.Remove,
};
}
#endregion
#region Comparision Methods
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
}
}