2020-08-17 17:28:32 -07:00
|
|
|
|
namespace SabreTools.Library.DatItems
|
2016-09-19 18:04:24 -07:00
|
|
|
|
{
|
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
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a default, empty Sample object
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Sample()
|
|
|
|
|
|
{
|
2020-08-20 13:17:14 -07:00
|
|
|
|
Name = string.Empty;
|
|
|
|
|
|
ItemType = ItemType.Sample;
|
2019-01-08 17:40:12 -08:00
|
|
|
|
}
|
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 Sample()
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = this.Name,
|
|
|
|
|
|
ItemType = this.ItemType,
|
|
|
|
|
|
DupeType = this.DupeType,
|
2017-01-09 14:37:41 -08:00
|
|
|
|
|
2020-08-20 21:15:37 -07:00
|
|
|
|
AltName = this.AltName,
|
|
|
|
|
|
AltTitle = this.AltTitle,
|
|
|
|
|
|
|
2020-08-21 23:48:35 -07:00
|
|
|
|
Original = this.Original,
|
|
|
|
|
|
OpenMSXSubType = this.OpenMSXSubType,
|
|
|
|
|
|
OpenMSXType = this.OpenMSXType,
|
|
|
|
|
|
Remark = this.Remark,
|
|
|
|
|
|
Boot = this.Boot,
|
|
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
PartName = this.PartName,
|
|
|
|
|
|
PartInterface = this.PartInterface,
|
|
|
|
|
|
Features = this.Features,
|
|
|
|
|
|
AreaName = this.AreaName,
|
|
|
|
|
|
AreaSize = this.AreaSize,
|
2020-08-21 13:31:22 -07:00
|
|
|
|
AreaWidth = this.AreaWidth,
|
|
|
|
|
|
AreaEndianness = this.AreaEndianness,
|
2020-08-21 14:20:17 -07:00
|
|
|
|
Value = this.Value,
|
|
|
|
|
|
LoadFlag = this.LoadFlag,
|
2017-01-09 14:37:41 -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
|
|
|
|
};
|
|
|
|
|
|
}
|
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 a sample, return false
|
2020-08-20 13:17:14 -07:00
|
|
|
|
if (ItemType != other.ItemType)
|
2019-01-08 17:40:12 -08:00
|
|
|
|
return false;
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2020-06-10 22:37:19 -07:00
|
|
|
|
// Otherwise, treat it as a Sample
|
|
|
|
|
|
Sample newOther = other as Sample;
|
2016-09-19 18:04:24 -07:00
|
|
|
|
|
2019-01-08 17:40:12 -08:00
|
|
|
|
// If the archive information matches
|
2020-08-20 13:17:14 -07:00
|
|
|
|
return (Name == newOther.Name);
|
2019-01-08 17:40:12 -08:00
|
|
|
|
}
|
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
|
|
|
|
}
|