Esempio n. 1
0
        public int CompareTo(ICellInformation other)
        {
            // todo testing
            if (RowIndex.CompareTo(other.RowIndex) == 0 &&
                ColumnIndex.CompareTo(other.ColumnIndex) == 0 &&
                Status.CompareTo(other.Status) == 0 &&
                NeighboursAlive.CompareTo(other.NeighboursAlive) == 0)
            {
                return(0);
            }

            double distanceThis  = DistanceFromOrigin();
            double distanceOther = other.DistanceFromOrigin();

            if (distanceThis < distanceOther)
            {
                return(-1);
            }
            return(1);
        }