2020-09-07 22:00:02 -07:00
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
2020-08-23 22:23:55 -07:00
|
|
|
|
|
|
|
|
|
|
namespace SabreTools.Library.DatItems
|
2018-01-04 00:49:04 -08:00
|
|
|
|
{
|
2019-01-08 17:40:12 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents a blank set from an input DAT
|
|
|
|
|
|
/// </summary>
|
2020-09-08 10:12:41 -07:00
|
|
|
|
[JsonObject("blank"), XmlRoot("blank")]
|
2019-01-08 17:40:12 -08:00
|
|
|
|
public class Blank : DatItem
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Constructors
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a default, empty Archive object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Blank()
|
|
|
|
|
|
{
|
2020-08-20 13:17:14 -07:00
|
|
|
|
ItemType = ItemType.Blank;
|
2019-01-08 17:40:12 -08:00
|
|
|
|
}
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#region Cloning Methods
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
public override object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Blank()
|
|
|
|
|
|
{
|
|
|
|
|
|
ItemType = this.ItemType,
|
|
|
|
|
|
DupeType = this.DupeType,
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2020-08-20 13:17:14 -07:00
|
|
|
|
Machine = this.Machine.Clone() as Machine,
|
|
|
|
|
|
Source = this.Source.Clone() as Source,
|
|
|
|
|
|
Remove = this.Remove,
|
2019-01-08 17:40:12 -08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#region Comparision Methods
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
public override bool Equals(DatItem other)
|
|
|
|
|
|
{
|
|
|
|
|
|
// If we don't have a blank, return false
|
2020-08-20 13:17:14 -07:00
|
|
|
|
if (ItemType != other.ItemType)
|
2019-01-08 17:40:12 -08:00
|
|
|
|
return false;
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2020-06-10 22:37:19 -07:00
|
|
|
|
// Otherwise, treat it as a Blank
|
|
|
|
|
|
Blank newOther = other as Blank;
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
// If the archive information matches
|
2020-08-20 13:17:14 -07:00
|
|
|
|
return (Machine == newOther.Machine);
|
2019-01-08 17:40:12 -08:00
|
|
|
|
}
|
2018-01-04 00:49:04 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
2018-01-04 00:49:04 -08:00
|
|
|
|
}
|