コード例 #1
0
        /// <summary>
        /// Compares an case to another one (with the row and column)
        /// </summary>
        /// <param name="item">A case</param>
        /// <returns>==0 if both are equal OR less than 0 if the calling case if inferior</returns>
        public decimal CompareTo(AbstractCase item)
        {
            decimal thisSuperior = 1;
            decimal itemSuperior = -1;

            if (item.Row < this.Row)
            {
                return(thisSuperior);
            }

            if (item.Row > this.Row)
            {
                return(itemSuperior);
            }

            if (item.Column < this.Column)
            {
                return(thisSuperior);
            }

            if (item.Column > this.Column)
            {
                return(itemSuperior);
            }

            return(0);
        }
コード例 #2
0
 /// <summary>
 /// Checks if this AbstractCase is equal to the other AbstractCase
 /// </summary>
 /// <param name="other">The other AbstractCase to be compared with</param>
 /// <returns>True if equal</returns>
 public bool Equals(AbstractCase other)
 {
     return((this.Column == other.Column) && (this.Row == other.Row));
 }