コード例 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            TicTacToePlay other = obj as TicTacToePlay;

            if (Row != other.Row)
            {
                return(false);
            }

            if (Col != other.Col)
            {
                return(false);
            }
            return(true);
        }
コード例 #2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            TicTacToePlay other = obj as TicTacToePlay;

            if (Row != other.Row)
            {
                return(Row > other.Row ? 1 : -1);
            }

            if (Col != other.Col)
            {
                return(Col > other.Col ? 1 : -1);
            }
            return(0);
        }