private void AddPawnsToBoardRow(IPlayer player, IBoard board, int chessRow)
 {
     for (int i = 0; i < StandartGameTotalCols; i++)
     {
         var pawn = new Pawn(player.Color);
         player.AddFigure(pawn);
         var position = new Position(chessRow, (char)(i + 'a'));
         board.AddFigure(pawn, position);
     }
 }
Ejemplo n.º 2
0
        public CoreMatrix()
        {
			 sMatrix = new Figure[8, 8];
#if !TEST
            //WHITE          

            sMatrix[0, 7] = new Rock(FigureColor.WHITE);
            sMatrix[7, 7] = new Rock(FigureColor.WHITE);

            sMatrix[6, 7] = new Knight(FigureColor.WHITE);
            sMatrix[1, 7] = new Knight(FigureColor.WHITE);

            sMatrix[2, 7] = new Bishop(FigureColor.WHITE);
            sMatrix[5, 7] = new Bishop(FigureColor.WHITE);

            sMatrix[4, 7] = new King(FigureColor.WHITE);
            sMatrix[3, 7] = new Queen(FigureColor.WHITE);

            for (int i = 0; i < 8; i++)
            {
                sMatrix[i, 6] = new Pawn(FigureColor.WHITE);
            }

            //BLACK
            sMatrix[0, 0] = new Rock(FigureColor.BLACK);
            sMatrix[7, 0] = new Rock(FigureColor.BLACK);

            sMatrix[6, 0] = new Knight(FigureColor.BLACK);
            sMatrix[1, 0] = new Knight(FigureColor.BLACK);

            sMatrix[2, 0] = new Bishop(FigureColor.BLACK);
            sMatrix[5, 0] = new Bishop(FigureColor.BLACK);

            sMatrix[4, 0] = new King(FigureColor.BLACK);
            sMatrix[3, 0] = new Queen(FigureColor.BLACK);

            for (int i = 0; i < 8; i++)
            {
                sMatrix[i, 1] = new Pawn(FigureColor.BLACK);
            }
#endif 

#if TEST
             //WHITE          

             sMatrix[0, 7] = new Rock(FigureColor.WHITE);
             sMatrix[7, 7] = new Rock(FigureColor.WHITE);


             sMatrix[4, 7] = new King(FigureColor.WHITE);


             for (int i = 0; i < 8; i++)
             {
                 sMatrix[i, 6] = new Pawn(FigureColor.WHITE);
             }

             //BLACK
             sMatrix[0, 0] = new Rock(FigureColor.BLACK);
             sMatrix[7, 0] = new Rock(FigureColor.BLACK);

             sMatrix[6, 0] = new Knight(FigureColor.BLACK);
             sMatrix[1, 0] = new Knight(FigureColor.BLACK);

             sMatrix[2, 0] = new Bishop(FigureColor.BLACK);
             sMatrix[5, 0] = new Bishop(FigureColor.BLACK);

             sMatrix[4, 0] = new King(FigureColor.BLACK);
             sMatrix[3, 0] = new Queen(FigureColor.BLACK);

             for (int i = 0; i < 8; i++)
             {
                 sMatrix[i, 1] = new Pawn(FigureColor.BLACK);
             }
#endif

			KingBlack = new Position(4, 0);
			KingWhite = new Position( 4, 7);
        }