private void randMove() { int chosenX = -1; int chosenY = -1; while (true) { // Znalezienie zwierzaka while (true) { chosenX = rand.Next(Board.BOARD_HIGHT); chosenY = rand.Next(Board.BOARD_WIDTH); if (board.fields[chosenX][chosenY].Image == SettingsWindow.getInstance().HerbivoreImage) { break; } } if (randWayMove(chosenX, chosenY) == true) { return; } } }