00001 using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005
00006 namespace EdgeClustering
00007 {
00008
00009
00010
00011
00012
00013 class GridPoint : IEquatable<GridPoint>
00014 {
00015 private int x;
00016 public int X
00017 {
00018 get { return x; }
00019 set { x = value; }
00020 }
00021
00022 private int y;
00023 public int Y
00024 {
00025 get { return y; }
00026 set { y = value; }
00027 }
00028
00029 public GridPoint(int x, int y)
00030 {
00031 this.x = x;
00032 this.y = y;
00033 }
00034
00035
00036
00037
00038
00039
00040 public bool Equals(GridPoint other)
00041 {
00042 if (other.x == x && other.y == y)
00043 return true;
00044 return false;
00045 }
00046
00047 public override bool Equals(Object obj)
00048 {
00049 if (obj == null) return base.Equals(obj);
00050
00051 if (!(obj is GridPoint))
00052 throw new InvalidCastException("The 'obj' argument is not a GridPoint object.");
00053 else
00054 return Equals(obj as GridPoint);
00055 }
00056
00057 public override int GetHashCode()
00058 {
00059 return this.GetHashCode();
00060 }
00061
00062 }
00063 }