Vertex.cs 626 B

123456789101112131415161718192021222324252627282930
  1. namespace DrawGraph
  2. {
  3. public class Vertex
  4. {
  5. public int X { get; set; }
  6. public int Y { get; set; }
  7. public Vertex(int x, int y)
  8. {
  9. X = x;
  10. Y = y;
  11. }
  12. public int CenterByX => (X * 2 + 10) / 2;
  13. public int CenterByY => (Y * 2 + 10) / 2;
  14. public static bool Compare(Vertex v1, Vertex v2)
  15. {
  16. if (Equals(v1, v2))
  17. return true;
  18. if (v1 == v2)
  19. return true;
  20. if (v1.X == v2.X && v1.Y == v2.Y)
  21. return true;
  22. return false;
  23. }
  24. }
  25. }