public void Replace(int i1, int j1, int i2, int j2, Figure[,] array, Color color) { Console.WriteLine("Mutqagreq poxarinvox figury\n1. Queen\n2. Rook\n3. Knight\n4. Bishop"); if (i2 == 0 || i2 == 7) { do { string figure = Console.ReadLine(); switch (figure) { case "Queen": case "queen": case "Q": case "q": case "1": { array[i2, j2] = new Queen(color); break; } case "Rook": case "rook": case "R": case "r": case "2": { array[i2, j2] = new Rook(color); break; } case "Knight": case "knight": case "K": case "k": case "3": { array[i2, j2] = new Knight(color); break; } case "Bishop": case "bishop": case "B": case "b": case "4": { array[i2, j2] = new Bishop(color); break; } } } while (array[i2, j2] is Pawn); } }