32 lines
768 B
C#
32 lines
768 B
C#
namespace TMI_practicum
|
|
{
|
|
public struct Intersection
|
|
{
|
|
public readonly double X;
|
|
public readonly double Y;
|
|
|
|
public Intersection(double x, double y)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return X.GetHashCode() ^ Y.GetHashCode();
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is Intersection && this == (Intersection) obj;
|
|
}
|
|
public static bool operator ==(Intersection x, Intersection y)
|
|
{
|
|
return x.X == y.X && x.Y == y.Y;
|
|
}
|
|
public static bool operator !=(Intersection x, Intersection y)
|
|
{
|
|
return !(x == y);
|
|
}
|
|
}
|
|
} |