我想先根据 x 再根据 y 对 C# 中的类点列表(见下文)进行排序。
public class Point
{
public int x;
public int y;
public Point(int xp, int yp)
{
x = xp;
y = yp;
}
}
你是怎么做到的:我是 C# 的新手,并且与 Java 比较方法有什么相似之处,这些方法实现了类的自定义比较器,而且我想将比较方法(int CompareTo)添加到类中以排序班级。
提前致谢。