mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
78 lines
2.0 KiB
C#
78 lines
2.0 KiB
C#
using Newtonsoft.Json;
|
|
|
|
namespace SabreTools.Library.DatItems
|
|
{
|
|
/// <summary>
|
|
/// Represents generic archive files to be included in a set
|
|
/// </summary>
|
|
[JsonObject("archive")]
|
|
public class Archive : DatItem
|
|
{
|
|
#region Constructors
|
|
|
|
/// <summary>
|
|
/// Create a default, empty Archive object
|
|
/// </summary>
|
|
public Archive()
|
|
{
|
|
Name = string.Empty;
|
|
ItemType = ItemType.Archive;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Cloning Methods
|
|
|
|
public override object Clone()
|
|
{
|
|
return new Archive()
|
|
{
|
|
Name = this.Name,
|
|
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,
|
|
Features = this.Features,
|
|
AreaName = this.AreaName,
|
|
AreaSize = this.AreaSize,
|
|
AreaWidth = this.AreaWidth,
|
|
AreaEndianness = this.AreaEndianness,
|
|
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 an archive, return false
|
|
if (ItemType != other.ItemType)
|
|
return false;
|
|
|
|
// Otherwise, treat it as an archive
|
|
Archive newOther = other as Archive;
|
|
|
|
// If the archive information matches
|
|
return (Name == newOther.Name);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|