Exemplo n.º 1
0
 public bool EGEnemyBlocked(GameBoard gameBoard, Player playerOnTurn)
 {
     for (int row = 0; row < gameBoard.GetLength(1); row++)
     {
         for (int col = 0; col < gameBoard.GetLength(0); col++)
         {
             if (!gameBoard.IsEmpty(row, col))
             {
                 if (playerOnTurn.PlayerColor == (int)GameConstants.PlayerColor.Black)
                 {
                     if (gameBoard.IsWhite(row, col) && PosibleMoves(row, col, gameBoard).Any())
                     {
                         //if (board.PosibleMoves(row, col).Any())
                         return(false);
                     }
                     continue;
                 }
                 if (playerOnTurn.PlayerColor == (int)GameConstants.PlayerColor.White)
                 {
                     if (gameBoard.IsBlack(row, col) && PosibleMoves(row, col, gameBoard).Any())
                     {
                         //if (board.PosibleMoves(row, col).Any())
                         return(false);
                     }
                     continue;
                 }
             }
         }
     }
     return(true);
 }