diff --git a/SabreTools.Metadata.DatFiles/DatHeader.cs b/SabreTools.Metadata.DatFiles/DatHeader.cs
index 59d64715..288f418c 100644
--- a/SabreTools.Metadata.DatFiles/DatHeader.cs
+++ b/SabreTools.Metadata.DatFiles/DatHeader.cs
@@ -385,7 +385,7 @@ namespace SabreTools.Metadata.DatFiles
return false;
// Compare internal models
- return _internal.EqualTo(otherItem._internal);
+ return _internal.Equals(otherItem._internal);
}
///
@@ -400,7 +400,7 @@ namespace SabreTools.Metadata.DatFiles
return false;
// Compare internal models
- return _internal.EqualTo(otherItem._internal);
+ return _internal.Equals(otherItem._internal);
}
#endregion
diff --git a/SabreTools.Metadata.DatItems.Test/DatItemTests.cs b/SabreTools.Metadata.DatItems.Test/DatItemTests.cs
index f464cb02..94fafcd8 100644
--- a/SabreTools.Metadata.DatItems.Test/DatItemTests.cs
+++ b/SabreTools.Metadata.DatItems.Test/DatItemTests.cs
@@ -11,12 +11,21 @@ namespace SabreTools.Metadata.DatItems.Test
///
/// Testing implementation of Data.Models.Metadata.DatItem
///
- private class TestDatItemModel : Data.Models.Metadata.DatItem, ICloneable
+ private class TestDatItemModel : Data.Models.Metadata.DatItem, ICloneable, IEquatable
{
public string? Name { get; set; }
///
public object Clone() => new TestDatItemModel { Name = Name };
+
+ ///
+ public bool Equals(TestDatItemModel? other)
+ {
+ if (other is null)
+ return false;
+
+ return string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase);
+ }
}
///
@@ -52,6 +61,20 @@ namespace SabreTools.Metadata.DatItems.Test
///
public override void SetName(string? name) => Name = name;
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other value is invalid
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is TestDatItem otherTestDatItem)
+ return ((TestDatItemModel)_internal).Equals((TestDatItemModel)otherTestDatItem._internal);
+
+ // Everything else fails
+ return false;
+ }
///
public override bool Equals(DatItem? other)
@@ -62,7 +85,7 @@ namespace SabreTools.Metadata.DatItems.Test
// If the type matches
if (other is TestDatItem otherTestDatItem)
- return _internal.Equals(otherTestDatItem._internal);
+ return ((TestDatItemModel)_internal).Equals((TestDatItemModel)otherTestDatItem._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/DatItem.cs b/SabreTools.Metadata.DatItems/DatItem.cs
index 521e3860..d3bb3e83 100644
--- a/SabreTools.Metadata.DatItems/DatItem.cs
+++ b/SabreTools.Metadata.DatItems/DatItem.cs
@@ -203,19 +203,7 @@ namespace SabreTools.Metadata.DatItems
///
/// DatItem to use as a baseline
/// True if the items are duplicates, false otherwise
- public virtual bool Equals(DatItem? other)
- {
- // If the other item is null
- if (other is null)
- return false;
-
- // If we don't have a matched type, return false
- if (ItemType != other.ItemType)
- return false;
-
- // Compare the internal models
- return _internal.EqualTo(other._internal);
- }
+ public abstract bool Equals(DatItem? other);
#endregion
diff --git a/SabreTools.Metadata.DatItems/Formats/Adjuster.cs b/SabreTools.Metadata.DatItems/Formats/Adjuster.cs
index 6d0d074a..df373844 100644
--- a/SabreTools.Metadata.DatItems/Formats/Adjuster.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Adjuster.cs
@@ -83,6 +83,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Adjuster otherAdjuster)
+ return ((Data.Models.Metadata.Adjuster)_internal).Equals((Data.Models.Metadata.Adjuster)otherAdjuster._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -92,7 +107,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Adjuster otherAdjuster)
- return _internal.Equals(otherAdjuster._internal);
+ return ((Data.Models.Metadata.Adjuster)_internal).Equals((Data.Models.Metadata.Adjuster)otherAdjuster._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Analog.cs b/SabreTools.Metadata.DatItems/Formats/Analog.cs
index 716a2264..e273c326 100644
--- a/SabreTools.Metadata.DatItems/Formats/Analog.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Analog.cs
@@ -60,6 +60,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Analog otherAnalog)
+ return ((Data.Models.Metadata.Analog)_internal).Equals((Data.Models.Metadata.Analog)otherAnalog._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -69,7 +84,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Analog otherAnalog)
- return _internal.Equals(otherAnalog._internal);
+ return ((Data.Models.Metadata.Analog)_internal).Equals((Data.Models.Metadata.Analog)otherAnalog._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Archive.cs b/SabreTools.Metadata.DatItems/Formats/Archive.cs
index f1d1e11f..5c8096aa 100644
--- a/SabreTools.Metadata.DatItems/Formats/Archive.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Archive.cs
@@ -251,6 +251,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Archive otherArchive)
+ return ((Data.Models.Metadata.Archive)_internal).Equals((Data.Models.Metadata.Archive)otherArchive._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -260,7 +275,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Archive otherArchive)
- return _internal.Equals(otherArchive._internal);
+ return ((Data.Models.Metadata.Archive)_internal).Equals((Data.Models.Metadata.Archive)otherArchive._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/BiosSet.cs b/SabreTools.Metadata.DatItems/Formats/BiosSet.cs
index fc0ed918..963519e9 100644
--- a/SabreTools.Metadata.DatItems/Formats/BiosSet.cs
+++ b/SabreTools.Metadata.DatItems/Formats/BiosSet.cs
@@ -72,6 +72,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is BiosSet otherBiosSet)
+ return ((Data.Models.Metadata.BiosSet)_internal).Equals((Data.Models.Metadata.BiosSet)otherBiosSet._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -81,7 +96,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is BiosSet otherBiosSet)
- return _internal.Equals(otherBiosSet._internal);
+ return ((Data.Models.Metadata.BiosSet)_internal).Equals((Data.Models.Metadata.BiosSet)otherBiosSet._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Blank.cs b/SabreTools.Metadata.DatItems/Formats/Blank.cs
index 624f19c4..c991685c 100644
--- a/SabreTools.Metadata.DatItems/Formats/Blank.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Blank.cs
@@ -54,6 +54,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Blank otherBlank)
+ return ((Data.Models.Metadata.Blank)_internal).Equals((Data.Models.Metadata.Blank)otherBlank._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -63,7 +78,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Blank otherBlank)
- return _internal.Equals(otherBlank._internal);
+ return ((Data.Models.Metadata.Blank)_internal).Equals((Data.Models.Metadata.Blank)otherBlank._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Chip.cs b/SabreTools.Metadata.DatItems/Formats/Chip.cs
index 3d527bd7..87a66582 100644
--- a/SabreTools.Metadata.DatItems/Formats/Chip.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Chip.cs
@@ -90,6 +90,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Chip otherChip)
+ return ((Data.Models.Metadata.Chip)_internal).Equals((Data.Models.Metadata.Chip)otherChip._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -99,7 +114,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Chip otherChip)
- return _internal.Equals(otherChip._internal);
+ return ((Data.Models.Metadata.Chip)_internal).Equals((Data.Models.Metadata.Chip)otherChip._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Condition.cs b/SabreTools.Metadata.DatItems/Formats/Condition.cs
index 19209b47..7ca1d651 100644
--- a/SabreTools.Metadata.DatItems/Formats/Condition.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Condition.cs
@@ -78,6 +78,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Condition otherCondition)
+ return ((Data.Models.Metadata.Condition)_internal).Equals((Data.Models.Metadata.Condition)otherCondition._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -87,7 +102,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Condition otherCondition)
- return _internal.Equals(otherCondition._internal);
+ return ((Data.Models.Metadata.Condition)_internal).Equals((Data.Models.Metadata.Condition)otherCondition._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs b/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs
index 7138f035..34156835 100644
--- a/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs
+++ b/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs
@@ -72,6 +72,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is ConfLocation otherConfLocation)
+ return ((Data.Models.Metadata.ConfLocation)_internal).Equals((Data.Models.Metadata.ConfLocation)otherConfLocation._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -81,7 +96,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is ConfLocation otherConfLocation)
- return _internal.Equals(otherConfLocation._internal);
+ return ((Data.Models.Metadata.ConfLocation)_internal).Equals((Data.Models.Metadata.ConfLocation)otherConfLocation._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs b/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs
index fed34ae7..8589492e 100644
--- a/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs
+++ b/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs
@@ -89,6 +89,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is ConfSetting otherConfSetting)
+ return ((Data.Models.Metadata.ConfSetting)_internal).Equals((Data.Models.Metadata.ConfSetting)otherConfSetting._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -98,7 +113,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is ConfSetting otherConfSetting)
- return _internal.Equals(otherConfSetting._internal);
+ return ((Data.Models.Metadata.ConfSetting)_internal).Equals((Data.Models.Metadata.ConfSetting)otherConfSetting._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Configuration.cs b/SabreTools.Metadata.DatItems/Formats/Configuration.cs
index d6feec4c..80c75f5e 100644
--- a/SabreTools.Metadata.DatItems/Formats/Configuration.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Configuration.cs
@@ -112,6 +112,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Configuration otherConfiguration)
+ return ((Data.Models.Metadata.Configuration)_internal).Equals((Data.Models.Metadata.Configuration)otherConfiguration._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -121,7 +136,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Configuration otherConfiguration)
- return _internal.Equals(otherConfiguration._internal);
+ return ((Data.Models.Metadata.Configuration)_internal).Equals((Data.Models.Metadata.Configuration)otherConfiguration._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Control.cs b/SabreTools.Metadata.DatItems/Formats/Control.cs
index 8193f94e..507c3f95 100644
--- a/SabreTools.Metadata.DatItems/Formats/Control.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Control.cs
@@ -126,6 +126,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Control otherControl)
+ return ((Data.Models.Metadata.Control)_internal).Equals((Data.Models.Metadata.Control)otherControl._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -135,7 +150,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Control otherControl)
- return _internal.Equals(otherControl._internal);
+ return ((Data.Models.Metadata.Control)_internal).Equals((Data.Models.Metadata.Control)otherControl._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DataArea.cs b/SabreTools.Metadata.DatItems/Formats/DataArea.cs
index e89a4827..59de6144 100644
--- a/SabreTools.Metadata.DatItems/Formats/DataArea.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DataArea.cs
@@ -96,6 +96,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DataArea otherDataArea)
+ return ((Data.Models.Metadata.DataArea)_internal).Equals((Data.Models.Metadata.DataArea)otherDataArea._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -105,7 +120,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DataArea otherDataArea)
- return _internal.Equals(otherDataArea._internal);
+ return ((Data.Models.Metadata.DataArea)_internal).Equals((Data.Models.Metadata.DataArea)otherDataArea._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Device.cs b/SabreTools.Metadata.DatItems/Formats/Device.cs
index 3cbff095..3d671a91 100644
--- a/SabreTools.Metadata.DatItems/Formats/Device.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Device.cs
@@ -119,6 +119,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Device otherDevice)
+ return ((Data.Models.Metadata.Device)_internal).Equals((Data.Models.Metadata.Device)otherDevice._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -128,7 +143,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Device otherDevice)
- return _internal.Equals(otherDevice._internal);
+ return ((Data.Models.Metadata.Device)_internal).Equals((Data.Models.Metadata.Device)otherDevice._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs b/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs
index 90eb1662..bddd13ca 100644
--- a/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs
@@ -60,6 +60,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DeviceRef otherDeviceRef)
+ return ((Data.Models.Metadata.DeviceRef)_internal).Equals((Data.Models.Metadata.DeviceRef)otherDeviceRef._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -69,7 +84,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DeviceRef otherDeviceRef)
- return _internal.Equals(otherDeviceRef._internal);
+ return ((Data.Models.Metadata.DeviceRef)_internal).Equals((Data.Models.Metadata.DeviceRef)otherDeviceRef._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DipLocation.cs b/SabreTools.Metadata.DatItems/Formats/DipLocation.cs
index 20e6d090..a069576f 100644
--- a/SabreTools.Metadata.DatItems/Formats/DipLocation.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DipLocation.cs
@@ -72,6 +72,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DipLocation otherDipLocation)
+ return ((Data.Models.Metadata.DipLocation)_internal).Equals((Data.Models.Metadata.DipLocation)otherDipLocation._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -81,7 +96,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DipLocation otherDipLocation)
- return _internal.Equals(otherDipLocation._internal);
+ return ((Data.Models.Metadata.DipLocation)_internal).Equals((Data.Models.Metadata.DipLocation)otherDipLocation._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs b/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs
index 477f57b3..599b37a2 100644
--- a/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs
@@ -142,6 +142,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DipSwitch otherDipSwitch)
+ return ((Data.Models.Metadata.DipSwitch)_internal).Equals((Data.Models.Metadata.DipSwitch)otherDipSwitch._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -151,7 +166,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DipSwitch otherDipSwitch)
- return _internal.Equals(otherDipSwitch._internal);
+ return ((Data.Models.Metadata.DipSwitch)_internal).Equals((Data.Models.Metadata.DipSwitch)otherDipSwitch._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DipValue.cs b/SabreTools.Metadata.DatItems/Formats/DipValue.cs
index 10c5ca2c..0f5f72c6 100644
--- a/SabreTools.Metadata.DatItems/Formats/DipValue.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DipValue.cs
@@ -89,6 +89,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DipValue otherDipValue)
+ return ((Data.Models.Metadata.DipValue)_internal).Equals((Data.Models.Metadata.DipValue)otherDipValue._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -98,7 +113,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DipValue otherDipValue)
- return _internal.Equals(otherDipValue._internal);
+ return ((Data.Models.Metadata.DipValue)_internal).Equals((Data.Models.Metadata.DipValue)otherDipValue._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Disk.cs b/SabreTools.Metadata.DatItems/Formats/Disk.cs
index 8fb16a4e..d143850e 100644
--- a/SabreTools.Metadata.DatItems/Formats/Disk.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Disk.cs
@@ -173,6 +173,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Disk otherDisk)
+ return ((Data.Models.Metadata.Disk)_internal).PartialEquals((Data.Models.Metadata.Disk)otherDisk._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -182,7 +197,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Disk otherDisk)
- return _internal.Equals(otherDisk._internal);
+ return ((Data.Models.Metadata.Disk)_internal).PartialEquals((Data.Models.Metadata.Disk)otherDisk._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/DiskArea.cs b/SabreTools.Metadata.DatItems/Formats/DiskArea.cs
index 181734b3..4bf14abc 100644
--- a/SabreTools.Metadata.DatItems/Formats/DiskArea.cs
+++ b/SabreTools.Metadata.DatItems/Formats/DiskArea.cs
@@ -78,6 +78,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is DiskArea otherDiskArea)
+ return ((Data.Models.Metadata.DiskArea)_internal).Equals((Data.Models.Metadata.DiskArea)otherDiskArea._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -87,7 +102,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is DiskArea otherDiskArea)
- return _internal.Equals(otherDiskArea._internal);
+ return ((Data.Models.Metadata.DiskArea)_internal).Equals((Data.Models.Metadata.DiskArea)otherDiskArea._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Display.cs b/SabreTools.Metadata.DatItems/Formats/Display.cs
index e1a4d20e..cf2067ce 100644
--- a/SabreTools.Metadata.DatItems/Formats/Display.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Display.cs
@@ -167,6 +167,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Display otherDisplay)
+ return ((Data.Models.Metadata.Display)_internal).Equals((Data.Models.Metadata.Display)otherDisplay._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -176,7 +191,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Display otherDisplay)
- return _internal.Equals(otherDisplay._internal);
+ return ((Data.Models.Metadata.Display)_internal).Equals((Data.Models.Metadata.Display)otherDisplay._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Driver.cs b/SabreTools.Metadata.DatItems/Formats/Driver.cs
index 0cb6b235..0950489d 100644
--- a/SabreTools.Metadata.DatItems/Formats/Driver.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Driver.cs
@@ -126,6 +126,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Driver otherDriver)
+ return ((Data.Models.Metadata.Driver)_internal).Equals((Data.Models.Metadata.Driver)otherDriver._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -135,7 +150,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Driver otherDriver)
- return _internal.Equals(otherDriver._internal);
+ return ((Data.Models.Metadata.Driver)_internal).Equals((Data.Models.Metadata.Driver)otherDriver._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Extension.cs b/SabreTools.Metadata.DatItems/Formats/Extension.cs
index de42fcc0..544d49a0 100644
--- a/SabreTools.Metadata.DatItems/Formats/Extension.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Extension.cs
@@ -60,6 +60,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Extension otherExtension)
+ return ((Data.Models.Metadata.Extension)_internal).Equals((Data.Models.Metadata.Extension)otherExtension._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -69,7 +84,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Extension otherExtension)
- return _internal.Equals(otherExtension._internal);
+ return ((Data.Models.Metadata.Extension)_internal).Equals((Data.Models.Metadata.Extension)otherExtension._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Feature.cs b/SabreTools.Metadata.DatItems/Formats/Feature.cs
index ae8b1eae..7c28d4f3 100644
--- a/SabreTools.Metadata.DatItems/Formats/Feature.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Feature.cs
@@ -84,6 +84,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Feature otherFeature)
+ return ((Data.Models.Metadata.Feature)_internal).Equals((Data.Models.Metadata.Feature)otherFeature._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -93,7 +108,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Feature otherFeature)
- return _internal.Equals(otherFeature._internal);
+ return ((Data.Models.Metadata.Feature)_internal).Equals((Data.Models.Metadata.Feature)otherFeature._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Info.cs b/SabreTools.Metadata.DatItems/Formats/Info.cs
index 85004fab..53c3c396 100644
--- a/SabreTools.Metadata.DatItems/Formats/Info.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Info.cs
@@ -66,6 +66,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Info otherInfo)
+ return ((Data.Models.Metadata.Info)_internal).Equals((Data.Models.Metadata.Info)otherInfo._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -75,7 +90,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Info otherInfo)
- return _internal.Equals(otherInfo._internal);
+ return ((Data.Models.Metadata.Info)_internal).Equals((Data.Models.Metadata.Info)otherInfo._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Input.cs b/SabreTools.Metadata.DatItems/Formats/Input.cs
index 7ee5c207..1a7b877c 100644
--- a/SabreTools.Metadata.DatItems/Formats/Input.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Input.cs
@@ -108,6 +108,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Input otherInput)
+ return ((Data.Models.Metadata.Input)_internal).Equals((Data.Models.Metadata.Input)otherInput._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -117,7 +132,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Input otherInput)
- return _internal.Equals(otherInput._internal);
+ return ((Data.Models.Metadata.Input)_internal).Equals((Data.Models.Metadata.Input)otherInput._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Instance.cs b/SabreTools.Metadata.DatItems/Formats/Instance.cs
index 7ef1fd72..d1b9d737 100644
--- a/SabreTools.Metadata.DatItems/Formats/Instance.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Instance.cs
@@ -66,6 +66,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Instance otherInstance)
+ return ((Data.Models.Metadata.Instance)_internal).Equals((Data.Models.Metadata.Instance)otherInstance._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -75,7 +90,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Instance otherInstance)
- return _internal.Equals(otherInstance._internal);
+ return ((Data.Models.Metadata.Instance)_internal).Equals((Data.Models.Metadata.Instance)otherInstance._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Media.cs b/SabreTools.Metadata.DatItems/Formats/Media.cs
index 849faa1e..d00f996d 100644
--- a/SabreTools.Metadata.DatItems/Formats/Media.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Media.cs
@@ -118,6 +118,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Media otherMedia)
+ return ((Data.Models.Metadata.Media)_internal).PartialEquals((Data.Models.Metadata.Media)otherMedia._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -127,7 +142,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Media otherMedia)
- return _internal.Equals(otherMedia._internal);
+ return ((Data.Models.Metadata.Media)_internal).PartialEquals((Data.Models.Metadata.Media)otherMedia._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Part.cs b/SabreTools.Metadata.DatItems/Formats/Part.cs
index a7c8ca93..5c6a4d8c 100644
--- a/SabreTools.Metadata.DatItems/Formats/Part.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Part.cs
@@ -118,6 +118,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Part otherPart)
+ return ((Data.Models.Metadata.Part)_internal).Equals((Data.Models.Metadata.Part)otherPart._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -127,7 +142,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Part otherPart)
- return _internal.Equals(otherPart._internal);
+ return ((Data.Models.Metadata.Part)_internal).Equals((Data.Models.Metadata.Part)otherPart._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/PartFeature.cs b/SabreTools.Metadata.DatItems/Formats/PartFeature.cs
index b0898a2a..1db21084 100644
--- a/SabreTools.Metadata.DatItems/Formats/PartFeature.cs
+++ b/SabreTools.Metadata.DatItems/Formats/PartFeature.cs
@@ -89,6 +89,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is PartFeature otherPartFeature)
+ return ((Data.Models.Metadata.Feature)_internal).Equals((Data.Models.Metadata.Feature)otherPartFeature._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -97,8 +112,8 @@ namespace SabreTools.Metadata.DatItems.Formats
return false;
// If the type matches
- if (other is PartFeature otherFeature)
- return _internal.Equals(otherFeature._internal);
+ if (other is PartFeature otherPartFeature)
+ return ((Data.Models.Metadata.Feature)_internal).Equals((Data.Models.Metadata.Feature)otherPartFeature._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Port.cs b/SabreTools.Metadata.DatItems/Formats/Port.cs
index 12f3df19..cd453bb2 100644
--- a/SabreTools.Metadata.DatItems/Formats/Port.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Port.cs
@@ -78,6 +78,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Port otherPort)
+ return ((Data.Models.Metadata.Port)_internal).Equals((Data.Models.Metadata.Port)otherPort._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -87,7 +102,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Port otherPort)
- return _internal.Equals(otherPort._internal);
+ return ((Data.Models.Metadata.Port)_internal).Equals((Data.Models.Metadata.Port)otherPort._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/RamOption.cs b/SabreTools.Metadata.DatItems/Formats/RamOption.cs
index 9b93da88..f9d20c76 100644
--- a/SabreTools.Metadata.DatItems/Formats/RamOption.cs
+++ b/SabreTools.Metadata.DatItems/Formats/RamOption.cs
@@ -72,6 +72,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is RamOption otherRamOption)
+ return ((Data.Models.Metadata.RamOption)_internal).Equals((Data.Models.Metadata.RamOption)otherRamOption._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -81,7 +96,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is RamOption otherRamOption)
- return _internal.Equals(otherRamOption._internal);
+ return ((Data.Models.Metadata.RamOption)_internal).Equals((Data.Models.Metadata.RamOption)otherRamOption._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Release.cs b/SabreTools.Metadata.DatItems/Formats/Release.cs
index 4a59a3c1..1830b27d 100644
--- a/SabreTools.Metadata.DatItems/Formats/Release.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Release.cs
@@ -1,4 +1,4 @@
-using System.Xml.Serialization;
+using System.Xml.Serialization;
using Newtonsoft.Json;
namespace SabreTools.Metadata.DatItems.Formats
@@ -84,6 +84,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Release otherRelease)
+ return ((Data.Models.Metadata.Release)_internal).Equals((Data.Models.Metadata.Release)otherRelease._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -93,7 +108,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Release otherRelease)
- return _internal.Equals(otherRelease._internal);
+ return ((Data.Models.Metadata.Release)_internal).Equals((Data.Models.Metadata.Release)otherRelease._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs b/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs
index ddea3c17..af4669f9 100644
--- a/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs
+++ b/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs
@@ -149,6 +149,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is ReleaseDetails otherReleaseDetails)
+ return ((Data.Models.Metadata.ReleaseDetails)_internal).Equals((Data.Models.Metadata.ReleaseDetails)otherReleaseDetails._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -158,7 +173,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is ReleaseDetails otherReleaseDetails)
- return _internal.Equals(otherReleaseDetails._internal);
+ return ((Data.Models.Metadata.ReleaseDetails)_internal).Equals((Data.Models.Metadata.ReleaseDetails)otherReleaseDetails._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Rom.cs b/SabreTools.Metadata.DatItems/Formats/Rom.cs
index 3633dd12..93de0bb7 100644
--- a/SabreTools.Metadata.DatItems/Formats/Rom.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Rom.cs
@@ -418,6 +418,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Rom otherRom)
+ return ((Data.Models.Metadata.Rom)_internal).PartialEquals((Data.Models.Metadata.Rom)otherRom._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -427,7 +442,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Rom otherRom)
- return _internal.Equals(otherRom._internal);
+ return ((Data.Models.Metadata.Rom)_internal).PartialEquals((Data.Models.Metadata.Rom)otherRom._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Sample.cs b/SabreTools.Metadata.DatItems/Formats/Sample.cs
index ad2df25d..d75fecba 100644
--- a/SabreTools.Metadata.DatItems/Formats/Sample.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Sample.cs
@@ -60,6 +60,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Sample otherSample)
+ return ((Data.Models.Metadata.Sample)_internal).Equals((Data.Models.Metadata.Sample)otherSample._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -69,7 +84,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Sample otherSample)
- return _internal.Equals(otherSample._internal);
+ return ((Data.Models.Metadata.Sample)_internal).Equals((Data.Models.Metadata.Sample)otherSample._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Serials.cs b/SabreTools.Metadata.DatItems/Formats/Serials.cs
index f0ab1e10..0926c140 100644
--- a/SabreTools.Metadata.DatItems/Formats/Serials.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Serials.cs
@@ -138,6 +138,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Serials otherSerials)
+ return ((Data.Models.Metadata.Serials)_internal).Equals((Data.Models.Metadata.Serials)otherSerials._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -147,7 +162,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Serials otherSerials)
- return _internal.Equals(otherSerials._internal);
+ return ((Data.Models.Metadata.Serials)_internal).Equals((Data.Models.Metadata.Serials)otherSerials._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs b/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs
index 50f759e9..8f0926c5 100644
--- a/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs
+++ b/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs
@@ -66,6 +66,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is SharedFeat otherSharedFeat)
+ return ((Data.Models.Metadata.SharedFeat)_internal).Equals((Data.Models.Metadata.SharedFeat)otherSharedFeat._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -75,7 +90,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is SharedFeat otherSharedFeat)
- return _internal.Equals(otherSharedFeat._internal);
+ return ((Data.Models.Metadata.SharedFeat)_internal).Equals((Data.Models.Metadata.SharedFeat)otherSharedFeat._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Slot.cs b/SabreTools.Metadata.DatItems/Formats/Slot.cs
index 5137789a..6c5b58b3 100644
--- a/SabreTools.Metadata.DatItems/Formats/Slot.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Slot.cs
@@ -78,6 +78,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Slot otherSlot)
+ return ((Data.Models.Metadata.Slot)_internal).Equals((Data.Models.Metadata.Slot)otherSlot._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -87,7 +102,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Slot otherSlot)
- return _internal.Equals(otherSlot._internal);
+ return ((Data.Models.Metadata.Slot)_internal).Equals((Data.Models.Metadata.Slot)otherSlot._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/SlotOption.cs b/SabreTools.Metadata.DatItems/Formats/SlotOption.cs
index 73d78416..3f8fbb11 100644
--- a/SabreTools.Metadata.DatItems/Formats/SlotOption.cs
+++ b/SabreTools.Metadata.DatItems/Formats/SlotOption.cs
@@ -1,4 +1,4 @@
-using System.Xml.Serialization;
+using System.Xml.Serialization;
using Newtonsoft.Json;
namespace SabreTools.Metadata.DatItems.Formats
@@ -72,6 +72,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is SlotOption otherSlotOption)
+ return ((Data.Models.Metadata.SlotOption)_internal).Equals((Data.Models.Metadata.SlotOption)otherSlotOption._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -81,7 +96,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is SlotOption otherSlotOption)
- return _internal.Equals(otherSlotOption._internal);
+ return ((Data.Models.Metadata.SlotOption)_internal).Equals((Data.Models.Metadata.SlotOption)otherSlotOption._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs b/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs
index f7d1015b..e705d84a 100644
--- a/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs
+++ b/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs
@@ -78,6 +78,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is SoftwareList otherSoftwareList)
+ return ((Data.Models.Metadata.SoftwareList)_internal).Equals((Data.Models.Metadata.SoftwareList)otherSoftwareList._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -87,7 +102,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is SoftwareList otherSoftwareList)
- return _internal.Equals(otherSoftwareList._internal);
+ return ((Data.Models.Metadata.SoftwareList)_internal).Equals((Data.Models.Metadata.SoftwareList)otherSoftwareList._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/Sound.cs b/SabreTools.Metadata.DatItems/Formats/Sound.cs
index 44b0e3df..feab808a 100644
--- a/SabreTools.Metadata.DatItems/Formats/Sound.cs
+++ b/SabreTools.Metadata.DatItems/Formats/Sound.cs
@@ -60,6 +60,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is Sound otherSound)
+ return ((Data.Models.Metadata.Sound)_internal).Equals((Data.Models.Metadata.Sound)otherSound._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -69,7 +84,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is Sound otherSound)
- return _internal.Equals(otherSound._internal);
+ return ((Data.Models.Metadata.Sound)_internal).Equals((Data.Models.Metadata.Sound)otherSound._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs b/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs
index c330d8b6..7f754d0b 100644
--- a/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs
+++ b/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs
@@ -198,6 +198,21 @@ namespace SabreTools.Metadata.DatItems.Formats
#region Comparision Methods
+ ///
+ public override bool Equals(DatItem? other)
+ {
+ // If the other item is null
+ if (other is null)
+ return false;
+
+ // If the type matches
+ if (other is SourceDetails otherSourceDetails)
+ return ((Data.Models.Metadata.SourceDetails)_internal).Equals((Data.Models.Metadata.SourceDetails)otherSourceDetails._internal);
+
+ // Everything else fails
+ return false;
+ }
+
///
public override bool Equals(DatItem? other)
{
@@ -207,7 +222,7 @@ namespace SabreTools.Metadata.DatItems.Formats
// If the type matches
if (other is SourceDetails otherSourceDetails)
- return _internal.Equals(otherSourceDetails._internal);
+ return ((Data.Models.Metadata.SourceDetails)_internal).Equals((Data.Models.Metadata.SourceDetails)otherSourceDetails._internal);
// Everything else fails
return false;
diff --git a/SabreTools.Metadata/DictionaryBaseExtensions.cs b/SabreTools.Metadata/DictionaryBaseExtensions.cs
index 5698359f..d8c2a3cd 100644
--- a/SabreTools.Metadata/DictionaryBaseExtensions.cs
+++ b/SabreTools.Metadata/DictionaryBaseExtensions.cs
@@ -39,7 +39,7 @@ namespace SabreTools.Metadata
(DipLocation selfDipLocation, DipLocation otherDipLocation) => selfDipLocation.Equals(otherDipLocation),
(DipSwitch selfDipSwitch, DipSwitch otherDipSwitch) => selfDipSwitch.Equals(otherDipSwitch),
(DipValue selfDipValue, DipValue otherDipValue) => selfDipValue.Equals(otherDipValue),
- (Disk selfDisk, Disk otherDisk) => EqualsImpl(selfDisk, otherDisk),
+ (Disk selfDisk, Disk otherDisk) => PartialEquals(selfDisk, otherDisk),
(DiskArea selfDiskArea, DiskArea otherDiskArea) => selfDiskArea.Equals(otherDiskArea),
(Display selfDisplay, Display otherDisplay) => selfDisplay.Equals(otherDisplay),
(Driver selfDriver, Driver otherDriver) => selfDriver.Equals(otherDriver),
@@ -50,14 +50,14 @@ namespace SabreTools.Metadata
(Input selfInput, Input otherInput) => selfInput.Equals(otherInput),
(Instance selfInstance, Instance otherInstance) => selfInstance.Equals(otherInstance),
(Machine selfMachine, Machine otherMachine) => EqualsImpl(selfMachine, otherMachine),
- (Media selfMedia, Media otherMedia) => EqualsImpl(selfMedia, otherMedia),
+ (Media selfMedia, Media otherMedia) => PartialEquals(selfMedia, otherMedia),
(Original selfOriginal, Original otherOriginal) => selfOriginal.Equals(otherOriginal),
(Part selfPart, Part otherPart) => selfPart.Equals(otherPart),
(Port selfPort, Port otherPort) => selfPort.Equals(otherPort),
(RamOption selfRamOption, RamOption otherRamOption) => selfRamOption.Equals(otherRamOption),
(Release selfRelease, Release otherRelease) => selfRelease.Equals(otherRelease),
(ReleaseDetails selfReleaseDetails, ReleaseDetails otherReleaseDetails) => selfReleaseDetails.Equals(otherReleaseDetails),
- (Rom selfRom, Rom otherRom) => EqualsImpl(selfRom, otherRom),
+ (Rom selfRom, Rom otherRom) => PartialEquals(selfRom, otherRom),
(Serials selfSerials, Serials otherSerials) => selfSerials.Equals(otherSerials),
(SharedFeat selfSharedFeat, SharedFeat otherSharedFeat) => selfSharedFeat.Equals(otherSharedFeat),
(Slot selfSlot, Slot otherSlot) => selfSlot.Equals(otherSlot),
@@ -100,7 +100,7 @@ namespace SabreTools.Metadata
else if (self is DipValue selfDipValue && other is DipValue otherDipValue)
return selfDipValue.Equals(otherDipValue);
else if (self is Disk selfDisk && other is Disk otherDisk)
- return EqualsImpl(selfDisk, otherDisk);
+ return PartialEquals(selfDisk, otherDisk);
else if (self is DiskArea selfDiskArea && other is DiskArea otherDiskArea)
return selfDiskArea.Equals(otherDiskArea);
else if (self is Display selfDisplay && other is Display otherDisplay)
@@ -122,7 +122,7 @@ namespace SabreTools.Metadata
else if (self is Machine selfMachine && other is Machine otherMachine)
return EqualsImpl(selfMachine, otherMachine);
else if (self is Media selfMedia && other is Media otherMedia)
- return EqualsImpl(selfMedia, otherMedia);
+ return PartialEquals(selfMedia, otherMedia);
else if (self is Original selfOriginal && other is Original otherOriginal)
return selfOriginal.Equals(otherOriginal);
else if (self is Part selfPart && other is Part otherPart)
@@ -136,7 +136,7 @@ namespace SabreTools.Metadata
else if (self is ReleaseDetails selfReleaseDetails && other is ReleaseDetails otherReleaseDetails)
return selfReleaseDetails.Equals(otherReleaseDetails);
else if (self is Rom selfRom && other is Rom otherRom)
- return EqualsImpl(selfRom, otherRom);
+ return PartialEquals(selfRom, otherRom);
else if (self is Serials selfSerials && other is Serials otherSerials)
return selfSerials.Equals(otherSerials);
else if (self is SharedFeat selfSharedFeat && other is SharedFeat otherSharedFeat)
@@ -289,7 +289,7 @@ namespace SabreTools.Metadata
///
/// Check equality of two Disk objects
///
- private static bool EqualsImpl(this Disk self, Disk other)
+ public static bool PartialEquals(this Disk self, Disk other)
{
ItemStatus? selfStatus = self.Status;
ItemStatus? otherStatus = other.Status;
@@ -318,7 +318,7 @@ namespace SabreTools.Metadata
///
/// Check equality of two Media objects
///
- private static bool EqualsImpl(this Media self, Media other)
+ public static bool PartialEquals(this Media self, Media other)
{
// If we get a partial match
if (self.HashMatch(other))
@@ -331,7 +331,7 @@ namespace SabreTools.Metadata
///
/// Check equality of two Rom objects
///
- private static bool EqualsImpl(this Rom self, Rom other)
+ public static bool PartialEquals(this Rom self, Rom other)
{
ItemStatus? selfStatus = self.Status;
ItemStatus? otherStatus = other.Status;