diff --git a/SabreTools.Metadata.DatFiles/DatHeader.cs b/SabreTools.Metadata.DatFiles/DatHeader.cs index 5f8b4a59..5f1e5280 100644 --- a/SabreTools.Metadata.DatFiles/DatHeader.cs +++ b/SabreTools.Metadata.DatFiles/DatHeader.cs @@ -12,7 +12,7 @@ namespace SabreTools.Metadata.DatFiles /// Represents all possible DAT header information /// [JsonObject("header"), XmlRoot("header")] - public sealed class DatHeader : ModelBackedItem, ICloneable + public sealed class DatHeader : ModelBackedItem, ICloneable, IEquatable { #region Properties @@ -374,33 +374,14 @@ namespace SabreTools.Metadata.DatFiles #region Comparision Methods /// - public override bool Equals(ModelBackedItem? other) + public bool Equals(DatHeader? other) { // If other is null if (other is null) return false; - // If the type is mismatched - if (other is not DatHeader otherItem) - return false; - // Compare internal models - return _internal.Equals(otherItem._internal); - } - - /// - public override bool Equals(ModelBackedItem? other) - { - // If other is null - if (other is null) - return false; - - // If the type is mismatched - if (other is not DatHeader otherItem) - return false; - - // Compare internal models - return _internal.Equals(otherItem._internal); + return _internal.Equals(other._internal); } #endregion diff --git a/SabreTools.Metadata.DatItems.Test/DatItemTests.cs b/SabreTools.Metadata.DatItems.Test/DatItemTests.cs index 41a74156..e81048fe 100644 --- a/SabreTools.Metadata.DatItems.Test/DatItemTests.cs +++ b/SabreTools.Metadata.DatItems.Test/DatItemTests.cs @@ -61,36 +61,6 @@ namespace SabreTools.Metadata.DatItems.Test /// public override void SetName(string? name) => Name = name; - /// - public override bool Equals(ModelBackedItem? other) - { - // If the other item is null - 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(ModelBackedItem? other) - { - // If the other item is null - 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) { diff --git a/SabreTools.Metadata.DatItems/DatItem.cs b/SabreTools.Metadata.DatItems/DatItem.cs index 09d4cf91..ee49868d 100644 --- a/SabreTools.Metadata.DatItems/DatItem.cs +++ b/SabreTools.Metadata.DatItems/DatItem.cs @@ -168,12 +168,6 @@ namespace SabreTools.Metadata.DatItems return string.Compare(selfName, otherName, StringComparison.Ordinal); } - /// - public abstract override bool Equals(ModelBackedItem? other); - - /// - public abstract override bool Equals(ModelBackedItem? other); - /// /// Determine if an item is a duplicate using partial matching logic /// diff --git a/SabreTools.Metadata.DatItems/Formats/Adjuster.cs b/SabreTools.Metadata.DatItems/Formats/Adjuster.cs index bc70c791..27f64cbc 100644 --- a/SabreTools.Metadata.DatItems/Formats/Adjuster.cs +++ b/SabreTools.Metadata.DatItems/Formats/Adjuster.cs @@ -83,36 +83,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Analog.cs b/SabreTools.Metadata.DatItems/Formats/Analog.cs index b10964e2..52a1c31b 100644 --- a/SabreTools.Metadata.DatItems/Formats/Analog.cs +++ b/SabreTools.Metadata.DatItems/Formats/Analog.cs @@ -60,36 +60,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Archive.cs b/SabreTools.Metadata.DatItems/Formats/Archive.cs index cff73122..be02e39b 100644 --- a/SabreTools.Metadata.DatItems/Formats/Archive.cs +++ b/SabreTools.Metadata.DatItems/Formats/Archive.cs @@ -251,36 +251,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/BiosSet.cs b/SabreTools.Metadata.DatItems/Formats/BiosSet.cs index f266ecf0..d9f1f770 100644 --- a/SabreTools.Metadata.DatItems/Formats/BiosSet.cs +++ b/SabreTools.Metadata.DatItems/Formats/BiosSet.cs @@ -72,36 +72,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Blank.cs b/SabreTools.Metadata.DatItems/Formats/Blank.cs index 7b85232b..263a6fb7 100644 --- a/SabreTools.Metadata.DatItems/Formats/Blank.cs +++ b/SabreTools.Metadata.DatItems/Formats/Blank.cs @@ -54,36 +54,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Chip.cs b/SabreTools.Metadata.DatItems/Formats/Chip.cs index 6496de9f..8c1dc3bf 100644 --- a/SabreTools.Metadata.DatItems/Formats/Chip.cs +++ b/SabreTools.Metadata.DatItems/Formats/Chip.cs @@ -90,36 +90,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Condition.cs b/SabreTools.Metadata.DatItems/Formats/Condition.cs index 25d05b81..400cf387 100644 --- a/SabreTools.Metadata.DatItems/Formats/Condition.cs +++ b/SabreTools.Metadata.DatItems/Formats/Condition.cs @@ -78,36 +78,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs b/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs index 1a392563..d8cfa92f 100644 --- a/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs +++ b/SabreTools.Metadata.DatItems/Formats/ConfLocation.cs @@ -72,36 +72,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs b/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs index c40dad2c..74ec1508 100644 --- a/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs +++ b/SabreTools.Metadata.DatItems/Formats/ConfSetting.cs @@ -89,36 +89,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Configuration.cs b/SabreTools.Metadata.DatItems/Formats/Configuration.cs index 85de6b66..0bc1e744 100644 --- a/SabreTools.Metadata.DatItems/Formats/Configuration.cs +++ b/SabreTools.Metadata.DatItems/Formats/Configuration.cs @@ -112,36 +112,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Control.cs b/SabreTools.Metadata.DatItems/Formats/Control.cs index 35a0d5c6..345bc974 100644 --- a/SabreTools.Metadata.DatItems/Formats/Control.cs +++ b/SabreTools.Metadata.DatItems/Formats/Control.cs @@ -126,36 +126,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/DataArea.cs b/SabreTools.Metadata.DatItems/Formats/DataArea.cs index a60830ff..734ec4a1 100644 --- a/SabreTools.Metadata.DatItems/Formats/DataArea.cs +++ b/SabreTools.Metadata.DatItems/Formats/DataArea.cs @@ -96,36 +96,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Device.cs b/SabreTools.Metadata.DatItems/Formats/Device.cs index 58a01385..37315916 100644 --- a/SabreTools.Metadata.DatItems/Formats/Device.cs +++ b/SabreTools.Metadata.DatItems/Formats/Device.cs @@ -119,36 +119,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs b/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs index 84688b8a..86ff1c98 100644 --- a/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs +++ b/SabreTools.Metadata.DatItems/Formats/DeviceRef.cs @@ -60,36 +60,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/DipLocation.cs b/SabreTools.Metadata.DatItems/Formats/DipLocation.cs index ee90e76d..33d234b7 100644 --- a/SabreTools.Metadata.DatItems/Formats/DipLocation.cs +++ b/SabreTools.Metadata.DatItems/Formats/DipLocation.cs @@ -72,36 +72,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs b/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs index 4f636028..fdc4a746 100644 --- a/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs +++ b/SabreTools.Metadata.DatItems/Formats/DipSwitch.cs @@ -142,36 +142,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/DipValue.cs b/SabreTools.Metadata.DatItems/Formats/DipValue.cs index 2e7bb8c5..baf1c199 100644 --- a/SabreTools.Metadata.DatItems/Formats/DipValue.cs +++ b/SabreTools.Metadata.DatItems/Formats/DipValue.cs @@ -89,36 +89,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Disk.cs b/SabreTools.Metadata.DatItems/Formats/Disk.cs index 9de6a777..44f85ebe 100644 --- a/SabreTools.Metadata.DatItems/Formats/Disk.cs +++ b/SabreTools.Metadata.DatItems/Formats/Disk.cs @@ -173,36 +173,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Disk)otherDisk._internal); - - // Everything else fails - return false; - } - - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Disk)otherDisk._internal); - - // Everything else fails - return false; - } - /// public override bool Equals(DatItem? other) { diff --git a/SabreTools.Metadata.DatItems/Formats/DiskArea.cs b/SabreTools.Metadata.DatItems/Formats/DiskArea.cs index 82f19083..aa1cadf5 100644 --- a/SabreTools.Metadata.DatItems/Formats/DiskArea.cs +++ b/SabreTools.Metadata.DatItems/Formats/DiskArea.cs @@ -78,36 +78,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Display.cs b/SabreTools.Metadata.DatItems/Formats/Display.cs index 6642272c..e699d896 100644 --- a/SabreTools.Metadata.DatItems/Formats/Display.cs +++ b/SabreTools.Metadata.DatItems/Formats/Display.cs @@ -167,36 +167,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Driver.cs b/SabreTools.Metadata.DatItems/Formats/Driver.cs index ffc34aa7..f7b20f54 100644 --- a/SabreTools.Metadata.DatItems/Formats/Driver.cs +++ b/SabreTools.Metadata.DatItems/Formats/Driver.cs @@ -126,36 +126,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Extension.cs b/SabreTools.Metadata.DatItems/Formats/Extension.cs index 99a84580..42ace9e1 100644 --- a/SabreTools.Metadata.DatItems/Formats/Extension.cs +++ b/SabreTools.Metadata.DatItems/Formats/Extension.cs @@ -60,36 +60,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Feature.cs b/SabreTools.Metadata.DatItems/Formats/Feature.cs index f794ec40..b13c9489 100644 --- a/SabreTools.Metadata.DatItems/Formats/Feature.cs +++ b/SabreTools.Metadata.DatItems/Formats/Feature.cs @@ -84,36 +84,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/File.cs b/SabreTools.Metadata.DatItems/Formats/File.cs index 94b1f15a..d22b2f3d 100644 --- a/SabreTools.Metadata.DatItems/Formats/File.cs +++ b/SabreTools.Metadata.DatItems/Formats/File.cs @@ -166,20 +166,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? other) - { - // This isn't implemented, so always return false - return false; - } - - /// - public override bool Equals(ModelBackedItem? other) - { - // This isn't implemented, so always return false - return false; - } - /// public override bool Equals(DatItem? other) { diff --git a/SabreTools.Metadata.DatItems/Formats/Info.cs b/SabreTools.Metadata.DatItems/Formats/Info.cs index 25596e23..4076b87f 100644 --- a/SabreTools.Metadata.DatItems/Formats/Info.cs +++ b/SabreTools.Metadata.DatItems/Formats/Info.cs @@ -66,36 +66,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Input.cs b/SabreTools.Metadata.DatItems/Formats/Input.cs index 4f36e3a6..4fc95c4d 100644 --- a/SabreTools.Metadata.DatItems/Formats/Input.cs +++ b/SabreTools.Metadata.DatItems/Formats/Input.cs @@ -108,36 +108,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Instance.cs b/SabreTools.Metadata.DatItems/Formats/Instance.cs index ef488f77..73a2fc32 100644 --- a/SabreTools.Metadata.DatItems/Formats/Instance.cs +++ b/SabreTools.Metadata.DatItems/Formats/Instance.cs @@ -66,36 +66,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Media.cs b/SabreTools.Metadata.DatItems/Formats/Media.cs index a0f8cf32..3795d907 100644 --- a/SabreTools.Metadata.DatItems/Formats/Media.cs +++ b/SabreTools.Metadata.DatItems/Formats/Media.cs @@ -118,36 +118,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Media)otherMedia._internal); - - // Everything else fails - return false; - } - - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Media)otherMedia._internal); - - // Everything else fails - return false; - } - /// public override bool Equals(DatItem? other) { diff --git a/SabreTools.Metadata.DatItems/Formats/Part.cs b/SabreTools.Metadata.DatItems/Formats/Part.cs index 1bed9778..5cfce496 100644 --- a/SabreTools.Metadata.DatItems/Formats/Part.cs +++ b/SabreTools.Metadata.DatItems/Formats/Part.cs @@ -118,36 +118,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/PartFeature.cs b/SabreTools.Metadata.DatItems/Formats/PartFeature.cs index ddbc350d..c31cff0f 100644 --- a/SabreTools.Metadata.DatItems/Formats/PartFeature.cs +++ b/SabreTools.Metadata.DatItems/Formats/PartFeature.cs @@ -89,36 +89,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Port.cs b/SabreTools.Metadata.DatItems/Formats/Port.cs index f02216c5..724ccd63 100644 --- a/SabreTools.Metadata.DatItems/Formats/Port.cs +++ b/SabreTools.Metadata.DatItems/Formats/Port.cs @@ -78,36 +78,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/RamOption.cs b/SabreTools.Metadata.DatItems/Formats/RamOption.cs index 18455d4d..3253f371 100644 --- a/SabreTools.Metadata.DatItems/Formats/RamOption.cs +++ b/SabreTools.Metadata.DatItems/Formats/RamOption.cs @@ -72,36 +72,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Release.cs b/SabreTools.Metadata.DatItems/Formats/Release.cs index 1e73c734..980df35a 100644 --- a/SabreTools.Metadata.DatItems/Formats/Release.cs +++ b/SabreTools.Metadata.DatItems/Formats/Release.cs @@ -84,36 +84,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs b/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs index eecd0cd6..182eda59 100644 --- a/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs +++ b/SabreTools.Metadata.DatItems/Formats/ReleaseDetails.cs @@ -149,36 +149,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Rom.cs b/SabreTools.Metadata.DatItems/Formats/Rom.cs index 738980d8..0f425707 100644 --- a/SabreTools.Metadata.DatItems/Formats/Rom.cs +++ b/SabreTools.Metadata.DatItems/Formats/Rom.cs @@ -905,36 +905,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Rom)otherRom._internal); - - // Everything else fails - return false; - } - - /// - public override bool Equals(ModelBackedItem? 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).Equals((Data.Models.Metadata.Rom)otherRom._internal); - - // Everything else fails - return false; - } - /// public override bool Equals(DatItem? other) { diff --git a/SabreTools.Metadata.DatItems/Formats/Sample.cs b/SabreTools.Metadata.DatItems/Formats/Sample.cs index 5b55097b..5fe6a8bd 100644 --- a/SabreTools.Metadata.DatItems/Formats/Sample.cs +++ b/SabreTools.Metadata.DatItems/Formats/Sample.cs @@ -60,36 +60,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Serials.cs b/SabreTools.Metadata.DatItems/Formats/Serials.cs index 4f9e7586..98568b30 100644 --- a/SabreTools.Metadata.DatItems/Formats/Serials.cs +++ b/SabreTools.Metadata.DatItems/Formats/Serials.cs @@ -138,36 +138,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs b/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs index 5729d01e..4dd14c9b 100644 --- a/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs +++ b/SabreTools.Metadata.DatItems/Formats/SharedFeat.cs @@ -66,36 +66,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Slot.cs b/SabreTools.Metadata.DatItems/Formats/Slot.cs index 3d5ae947..7c68dc38 100644 --- a/SabreTools.Metadata.DatItems/Formats/Slot.cs +++ b/SabreTools.Metadata.DatItems/Formats/Slot.cs @@ -78,36 +78,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/SlotOption.cs b/SabreTools.Metadata.DatItems/Formats/SlotOption.cs index ad350682..a2e113c6 100644 --- a/SabreTools.Metadata.DatItems/Formats/SlotOption.cs +++ b/SabreTools.Metadata.DatItems/Formats/SlotOption.cs @@ -72,36 +72,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs b/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs index 0ea02cfe..bba7dcda 100644 --- a/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs +++ b/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs @@ -78,36 +78,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/Sound.cs b/SabreTools.Metadata.DatItems/Formats/Sound.cs index 6cd2db8c..7e89068c 100644 --- a/SabreTools.Metadata.DatItems/Formats/Sound.cs +++ b/SabreTools.Metadata.DatItems/Formats/Sound.cs @@ -60,36 +60,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs b/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs index 27241376..1004e909 100644 --- a/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs +++ b/SabreTools.Metadata.DatItems/Formats/SourceDetails.cs @@ -198,36 +198,6 @@ namespace SabreTools.Metadata.DatItems.Formats #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? 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(ModelBackedItem? 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) { diff --git a/SabreTools.Metadata.DatItems/Machine.cs b/SabreTools.Metadata.DatItems/Machine.cs index a5c28ae5..2f87a0a3 100644 --- a/SabreTools.Metadata.DatItems/Machine.cs +++ b/SabreTools.Metadata.DatItems/Machine.cs @@ -455,36 +455,6 @@ namespace SabreTools.Metadata.DatItems #region Comparision Methods - /// - public override bool Equals(ModelBackedItem? other) - { - // If other is null - if (other is null) - return false; - - // If the type is mismatched - if (other is not Machine otherItem) - return false; - - // Compare internal models - return _internal.Equals(otherItem._internal); - } - - /// - public override bool Equals(ModelBackedItem? other) - { - // If other is null - if (other is null) - return false; - - // If the type is mismatched - if (other is not Machine otherItem) - return false; - - // Compare internal models - return _internal.Equals(otherItem._internal); - } - /// public bool Equals(Machine? other) { diff --git a/SabreTools.Metadata/ModelBackedItem.cs b/SabreTools.Metadata/ModelBackedItem.cs index d70d4edb..5737e673 100644 --- a/SabreTools.Metadata/ModelBackedItem.cs +++ b/SabreTools.Metadata/ModelBackedItem.cs @@ -1,17 +1,10 @@ -using System; - -namespace SabreTools.Metadata +namespace SabreTools.Metadata { /// /// Represents an item that's backed by a constructable item /// - public abstract class ModelBackedItem : IEquatable + public abstract class ModelBackedItem { - #region Comparision Methods - - /// - public abstract bool Equals(ModelBackedItem? other); - - #endregion + // No common, untyped functionality } } diff --git a/SabreTools.Metadata/ModelBackedItemT.cs b/SabreTools.Metadata/ModelBackedItemT.cs index 7c419df0..0bddb5dd 100644 --- a/SabreTools.Metadata/ModelBackedItemT.cs +++ b/SabreTools.Metadata/ModelBackedItemT.cs @@ -1,4 +1,3 @@ -using System; using System.Xml.Serialization; using Newtonsoft.Json; @@ -7,7 +6,7 @@ namespace SabreTools.Metadata /// /// Represents an item that's backed by a constructable item /// - public abstract class ModelBackedItem : ModelBackedItem, IEquatable> where T : new() + public abstract class ModelBackedItem : ModelBackedItem where T : new() { /// /// Internal model wrapped by this DatItem @@ -23,12 +22,5 @@ namespace SabreTools.Metadata } #endregion - - #region Comparision Methods - - /// - public abstract bool Equals(ModelBackedItem? other); - - #endregion } }