Files
SabreTools/SabreTools.Library/DatItems/Blank.cs
Matt Nadareski 334e1c4585 Filter Abstraction (#25)
* Add category, back filters by dictionary

* Complete internal filter set

* Fix AreaSize filter

* Populate filter object the hard way

* Manipulation flags should not be filters

* None of them need to be public

* Convert to partial helper method

* Better method use

* Field, not string; no dictionary

* Add FilterTo method for later

* More naming options (easier conversion)

* Update README
2020-07-18 21:35:17 -07:00

83 lines
2.3 KiB
C#

using SabreTools.Library.Data;
namespace SabreTools.Library.DatItems
{
/// <summary>
/// Represents a blank set from an input DAT
/// </summary>
public class Blank : DatItem
{
#region Constructors
/// <summary>
/// Create a default, empty Archive object
/// </summary>
public Blank()
{
this.Name = string.Empty;
this.ItemType = ItemType.Blank;
}
#endregion
#region Cloning Methods
public override object Clone()
{
return new Blank()
{
Name = this.Name,
ItemType = this.ItemType,
DupeType = this.DupeType,
Supported = this.Supported,
Publisher = this.Publisher,
Category = this.Category,
Infos = this.Infos,
PartName = this.PartName,
PartInterface = this.PartInterface,
Features = this.Features,
AreaName = this.AreaName,
AreaSize = this.AreaSize,
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,
IndexId = this.IndexId,
IndexSource = this.IndexSource,
};
}
#endregion
#region Comparision Methods
public override bool Equals(DatItem other)
{
// If we don't have a blank, return false
if (this.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
}
}