Ejemplo n.º 1
0
 private void SwapSquares(ref MemSquare i_LeftSquare, ref MemSquare i_RightSquare)
 {
     MemSquare tempSquare;
     tempSquare = i_LeftSquare;
     i_LeftSquare = i_RightSquare;
     i_RightSquare = tempSquare;
 }
Ejemplo n.º 2
0
        private void SwapSquares(ref MemSquare i_LeftSquare, ref MemSquare i_RightSquare)
        {
            MemSquare tempSquare;

            tempSquare    = i_LeftSquare;
            i_LeftSquare  = i_RightSquare;
            i_RightSquare = tempSquare;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the Requested Square From the Board
        /// </summary>
        /// <param name="i_Row">Requested Square Row</param>
        /// <param name="i_Col">Requested Square Collumn</param>
        /// <returns>The Requested Square</returns>
        public MemSquare GetSquareAt(int i_Row, char i_Col)
        {
            MemSquare retRequestedSquare = null;

            // Return the Requested Square
            retRequestedSquare = m_Squares[i_Row, i_Col];

            return(retRequestedSquare);
        }
Ejemplo n.º 4
0
        private void CreateSquares()
        {
            int counter = m_BoardWidth + 1;
            for (int i = 0; i < m_BoardHeight; i++)
            {
                for(int j = 0; j < m_BoardWidth; j += 2)
                {
                    char letter = (char)('B' + counter++);
                    m_Squares[i, j] = new MemSquare(i, j, letter.ToString());
                    m_Squares[i, j + 1] = new MemSquare(i, j, letter.ToString());
                }
            }

            RandomizeSquares();
        }
Ejemplo n.º 5
0
        private void CreateSquares()
        {
            int counter = m_BoardWidth + 1;

            for (int i = 0; i < m_BoardHeight; i++)
            {
                for (int j = 0; j < m_BoardWidth; j += 2)
                {
                    char letter = (char)('B' + counter++);
                    m_Squares[i, j]     = new MemSquare(i, j, letter.ToString());
                    m_Squares[i, j + 1] = new MemSquare(i, j, letter.ToString());
                }
            }

            RandomizeSquares();
        }
 public bool TryParse(string i_SquareStr, out MemSquare o_Square)
 {
     bool retParseResult = false;
     o_Square = new MemSquare();
     int row;
     string convertedUpperCaseSquareString = i_SquareStr.ToUpper();
     int col = (convertedUpperCaseSquareString[0] - 'A');
     if (col > 0)
     {
         retParseResult = int.TryParse(convertedUpperCaseSquareString.Remove(0, 1),out row);
         if (retParseResult)
         {
             o_Square.Row = row;
             o_Square.Col = col;
             retParseResult = true;
         }
     }
     
     return retParseResult;
 }
        public bool TryParse(string i_SquareStr, out MemSquare o_Square)
        {
            bool retParseResult = false;

            o_Square = new MemSquare();
            int    row;
            string convertedUpperCaseSquareString = i_SquareStr.ToUpper();
            int    col = (convertedUpperCaseSquareString[0] - 'A');

            if (col > 0)
            {
                retParseResult = int.TryParse(convertedUpperCaseSquareString.Remove(0, 1), out row);
                if (retParseResult)
                {
                    o_Square.Row   = row;
                    o_Square.Col   = col;
                    retParseResult = true;
                }
            }

            return(retParseResult);
        }