mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Extract out DatItems namespace
This commit is contained in:
60
SabreTools.DatItems/Blank.cs
Normal file
60
SabreTools.DatItems/Blank.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Core;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.DatItems
|
||||
{
|
||||
/// <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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user