2017-10-09 12:58:46 -07:00
|
|
|
|
using SabreTools.Library.Data;
|
2016-10-12 16:02:51 -07:00
|
|
|
|
|
2017-11-02 15:44:15 -07:00
|
|
|
|
namespace SabreTools.Library.DatItems
|
2016-09-19 18:04:24 -07:00
|
|
|
|
{
|
2019-01-08 17:40:12 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents generic archive files to be included in a set
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Archive : DatItem
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Constructors
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a default, empty Archive object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Archive()
|
|
|
|
|
|
{
|
2020-06-10 22:37:19 -07:00
|
|
|
|
this.Name = string.Empty;
|
2019-01-08 17:40:12 -08:00
|
|
|
|
this.ItemType = ItemType.Archive;
|
|
|
|
|
|
}
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#region Cloning Methods
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
public override object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Archive()
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = this.Name,
|
|
|
|
|
|
ItemType = this.ItemType,
|
|
|
|
|
|
DupeType = this.DupeType,
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
Supported = this.Supported,
|
|
|
|
|
|
Publisher = this.Publisher,
|
|
|
|
|
|
Infos = this.Infos,
|
|
|
|
|
|
PartName = this.PartName,
|
|
|
|
|
|
PartInterface = this.PartInterface,
|
|
|
|
|
|
Features = this.Features,
|
|
|
|
|
|
AreaName = this.AreaName,
|
|
|
|
|
|
AreaSize = this.AreaSize,
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
MachineName = this.MachineName,
|
|
|
|
|
|
Comment = this.Comment,
|
|
|
|
|
|
MachineDescription = this.MachineDescription,
|
|
|
|
|
|
Year = this.Year,
|
|
|
|
|
|
Manufacturer = this.Manufacturer,
|
|
|
|
|
|
RomOf = this.RomOf,
|
|
|
|
|
|
CloneOf = this.CloneOf,
|
|
|
|
|
|
SampleOf = this.SampleOf,
|
|
|
|
|
|
SourceFile = this.SourceFile,
|
|
|
|
|
|
Runnable = this.Runnable,
|
|
|
|
|
|
Board = this.Board,
|
|
|
|
|
|
RebuildTo = this.RebuildTo,
|
|
|
|
|
|
Devices = this.Devices,
|
|
|
|
|
|
MachineType = this.MachineType,
|
2017-10-09 13:46:28 -07:00
|
|
|
|
|
2020-07-15 09:41:59 -07:00
|
|
|
|
IndexId = this.IndexId,
|
|
|
|
|
|
IndexSource = this.IndexSource,
|
2019-01-08 17:40:12 -08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#region Comparision Methods
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
public override bool Equals(DatItem other)
|
|
|
|
|
|
{
|
|
|
|
|
|
// If we don't have an archive, return false
|
|
|
|
|
|
if (this.ItemType != other.ItemType)
|
|
|
|
|
|
return false;
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
// Otherwise, treat it as an archive
|
2020-06-10 22:37:19 -07:00
|
|
|
|
Archive newOther = other as Archive;
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
// If the archive information matches
|
|
|
|
|
|
return (this.Name == newOther.Name);
|
|
|
|
|
|
}
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
2016-09-19 18:04:24 -07:00
|
|
|
|
}
|