Files
SabreTools/SabreTools.Library/DatItems/Sample.cs

81 lines
2.3 KiB
C#
Raw Normal View History

2020-08-17 17:28:32 -07:00
namespace SabreTools.Library.DatItems
{
2019-01-08 17:40:12 -08:00
/// <summary>
/// Represents a (usually WAV-formatted) sample to be included for use in the set
/// </summary>
public class Sample : DatItem
{
#region Constructors
2019-01-08 17:40:12 -08:00
/// <summary>
/// Create a default, empty Sample object
/// </summary>
public Sample()
{
this.Name = string.Empty;
2019-01-08 17:40:12 -08:00
this.ItemType = ItemType.Sample;
}
2019-01-08 17:40:12 -08:00
#endregion
2019-01-08 17:40:12 -08:00
#region Cloning Methods
2019-01-08 17:40:12 -08:00
public override object Clone()
{
return new Sample()
{
Name = this.Name,
ItemType = this.ItemType,
DupeType = this.DupeType,
2019-01-08 17:40:12 -08:00
Supported = this.Supported,
Publisher = this.Publisher,
Category = this.Category,
2019-01-08 17:40:12 -08:00
Infos = this.Infos,
PartName = this.PartName,
PartInterface = this.PartInterface,
Features = this.Features,
AreaName = this.AreaName,
AreaSize = this.AreaSize,
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,
IndexId = this.IndexId,
IndexSource = this.IndexSource,
2019-01-08 17:40:12 -08:00
};
}
2019-01-08 17:40:12 -08:00
#endregion
2019-01-08 17:40:12 -08:00
#region Comparision Methods
2019-01-08 17:40:12 -08:00
public override bool Equals(DatItem other)
{
// If we don't have a sample, return false
if (this.ItemType != other.ItemType)
return false;
// Otherwise, treat it as a Sample
Sample newOther = other as Sample;
2019-01-08 17:40:12 -08:00
// If the archive information matches
return (this.Name == newOther.Name);
}
2019-01-08 17:40:12 -08:00
#endregion
}
}