Beispiel #1
0
 private void fillRowValues(int i_Row, int i_ColToSpaces, int i_ColToPlayerSymbole, eSymboleType i_PlayerSymbole)
 {
     r_Board[i_Row, i_ColToSpaces] = new CheckersCell <eSymboleType>(i_Row, i_ColToSpaces);
     SetCellValue(i_Row, i_ColToSpaces, eSymboleType.SpaceSymbole);
     r_Board[i_Row, i_ColToPlayerSymbole] =
         new CheckersCell <eSymboleType>(i_Row, i_ColToPlayerSymbole, i_PlayerSymbole);
     addCellToPlayerList(r_Board[i_Row, i_ColToPlayerSymbole]);
 }
Beispiel #2
0
 public GameBoard(int i_BoardSize, PlayerDetails i_FirstPlayer, PlayerDetails i_SecondPlayer)
 {
     r_FirstPlayer  = i_FirstPlayer;
     r_SecondPlayer = i_SecondPlayer;
     r_BoardSize    = i_BoardSize;
     r_Board        = new CheckersCell <eSymboleType> [r_BoardSize, r_BoardSize];
     initializeBoardValues();
 }
Beispiel #3
0
 private void addCellToPlayerList(CheckersCell <eSymboleType> i_Cell)
 {
     if (i_Cell.Value.Equals(r_FirstPlayer.PlayerSymbole))
     {
         r_FirstPlayer.GamePawns.Add(i_Cell);
     }
     else
     {
         r_SecondPlayer.GamePawns.Add(i_Cell);
     }
 }
Beispiel #4
0
        private void initializeBoardValues()
        {
            int middleSpaces;

            middleSpaces = (r_BoardSize / 2) - 1;
            fillBothPlayerRows(middleSpaces);

            for (int i = middleSpaces; i < middleSpaces + 2; i++)
            {
                for (int j = 0; j < r_BoardSize; j++)
                {
                    r_Board[i, j] = new CheckersCell <eSymboleType>(i, j);
                    SetCellValue(i, j, eSymboleType.SpaceSymbole);
                }
            }
        }