VinnoPoint.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.IO;
  2. namespace fis.Vid.Visuals
  3. {
  4. public class VinnoPoint
  5. {
  6. public double X { get; }
  7. public double Y { get; }
  8. public VinnoPoint(double x, double y)
  9. {
  10. X = x;
  11. Y = y;
  12. }
  13. public override string ToString()
  14. {
  15. return $"X:{X},Y:{Y}";
  16. }
  17. protected bool Equals(VinnoPoint other)
  18. {
  19. return X.Equals(other.X) && Y.Equals(other.Y);
  20. }
  21. public override bool Equals(object obj)
  22. {
  23. if (ReferenceEquals(null, obj)) return false;
  24. if (ReferenceEquals(this, obj)) return true;
  25. if (obj.GetType() != this.GetType()) return false;
  26. return Equals((VinnoPoint) obj);
  27. }
  28. public override int GetHashCode()
  29. {
  30. unchecked
  31. {
  32. return (X.GetHashCode()*397) ^ Y.GetHashCode();
  33. }
  34. }
  35. public static bool operator ==(VinnoPoint left, VinnoPoint right)
  36. {
  37. return Equals(left, right);
  38. }
  39. public static bool operator !=(VinnoPoint left, VinnoPoint right)
  40. {
  41. return !Equals(left, right);
  42. }
  43. }
  44. }