Files
ClassicAssist.Avalonia/ClassicAssist.Shared/Data/Vendors/XYComparer.cs
T
Beyhan Oğur d5f52cc3d3 first commit
2026-09-03 04:45:36 +03:00

53 lines
944 B
C#

using System.Collections.Generic;
using ClassicAssist.UO.Objects;
namespace ClassicAssist.Data.Vendors
{
public class XYComparer : IComparer<Item>
{
public int Compare( Item x, Item y )
{
if ( x == null && y == null )
{
return 0;
}
if ( x == null )
{
return -1;
}
if ( y == null )
{
return 1;
}
if ( x.X > y.X )
{
return 1;
}
if ( y.X > x.X )
{
return -1;
}
if ( x.X != y.X )
{
return 0;
}
if ( x.Y > y.Y )
{
return 1;
}
if ( y.Y > x.Y )
{
return -1;
}
return 0;
}
}
}