示例#1
0
        public int CompareTo(object obj)
        {
            if (obj.GetType() != GetType())
            {
                return(-1);
            }

            HoneyComb hc = (HoneyComb)obj;

            if (i < hc.i)
            {
                return(1);
            }

            if (i > hc.i)
            {
                return(-1);
            }
            if (j < hc.j)
            {
                return(1);
            }

            if (j > hc.j)
            {
                return(-1);
            }

            return(0);
        }
示例#2
0
 public double Distance(HoneyComb it)
 {
     return(Math.Sqrt(Math.Pow(it.i - i, 2) + Math.Pow(it.j - j, 2)));
 }