IEquatable 的Equals 代替 object 的Equals
struct Point2 : IEquatable<Point2> { public int X { get; set; } public int Y { get; set; } public bool Equals(Point2 obj) { return obj.X == this.X && obj.Y == this.Y; } public override int GetHashCode() { return X^Y; } }