private void minesSetter(int minesNumber, Square[][] mineField) {
        int fieldElements = fieldInstance.getHigh() * fieldInstance.getWidth();
        Random rand = new Random();
        while (minesNumber > 0) {
            for (int iteration = 0; iteration < fieldElements && minesNumber > 0; iteration++) {
                int i = rand.nextInt(fieldInstance.getHigh());
                int j = rand.nextInt(fieldInstance.getWidth());
                if (mineField[i][j].hasMine()) continue;
                if (minesPerRow[i] == maxMinePerRow) continue;

                mineField[i][j].setMine(getRandomMine(minesNumber));
                if (mineField[i][j].hasMine()) {
                    minesPerRow[i] = minesPerRow[i] + 1;
                    minesNumber--;
                    setAjacentMines(i, j, mineField);
                }
            }
            maxMinePerRow += 1;
        }
    }