Пример #1
0
        override public int CompareTo(MemoryItem compareTo)
        {
            int same = 1;

            try
            {
                MemoryShape other = (MemoryShape)compareTo;
                if (Shape == other.Shape)
                {
                    same = 0;
                }
            }
            catch (Exception e)
            {
                throw new Exception(message: "Cannot convert MemoryItem to MemoryShape.");
            }

            return(same);
        }
Пример #2
0
        /// <summary>
        /// Checks if this letter is the same as another
        /// </summary>
        /// <param name="compareTo"></param>
        /// <returns></returns>
        override public int CompareTo(MemoryItem compareTo)
        {
            int same = 1;

            try
            {
                MemoryLetter other = (MemoryLetter)compareTo;
                if (Letter.Equals(other.Letter))
                {
                    same = 0;
                }
            }
            catch (Exception e)
            {
                throw new Exception(message: "Cannot convert MemoryItem to MemoryLetter.");
            }

            return(same);
        }
Пример #3
0
        override public int CompareTo(MemoryItem compareTo)
        {
            int same = 0;

            return(same);
        }