refactor: removed the IComparable from IIdentifiable and implemented in extension method

This commit is contained in:
2026-03-04 20:16:07 +03:00
parent 4326d5615e
commit e84c6edce1
3 changed files with 7 additions and 4 deletions

View File

@@ -3,5 +3,10 @@ namespace Engine.Core;
public static class IdentifiableExtensions
{
public static bool IsIdentical(this IIdentifiable? left, IIdentifiable? right)
=> left?.CompareTo(right) == 0;
{
if (left == null || right == null)
return false;
return left?.Id?.CompareTo(right?.Id) == 0;
}
}