mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move generic equality down a level
This commit is contained in:
@@ -189,6 +189,21 @@ namespace SabreTools.DatItems
|
|||||||
return _internal.Equals(otherItem);
|
return _internal.Equals(otherItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override bool Equals(ModelBackedItem<Models.Metadata.DatItem>? other)
|
||||||
|
{
|
||||||
|
// If other is null
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// If the type is mismatched
|
||||||
|
if (other is not DatItem otherItem)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Compare internal models
|
||||||
|
return _internal.Equals(otherItem);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determine if an item is a duplicate using partial matching logic
|
/// Determine if an item is a duplicate using partial matching logic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -597,21 +612,6 @@ namespace SabreTools.DatItems
|
|||||||
return string.Compare(selfName, otherName, StringComparison.Ordinal);
|
return string.Compare(selfName, otherName, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override bool Equals(ModelBackedItem<Models.Metadata.DatItem>? other)
|
|
||||||
{
|
|
||||||
// If other is null
|
|
||||||
if (other == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// If the type is mismatched
|
|
||||||
if (other is not DatItem<T> otherItem)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Compare internal models
|
|
||||||
return _internal.Equals(otherItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determine if an item is a duplicate using partial matching logic
|
/// Determine if an item is a duplicate using partial matching logic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user