public MinerGame(int rowNumber, int collNumber) { isGameEmpty = true; gameField = new GameCell[rowNumber, collNumber]; for (int i = 0; i < rowNumber; i++) { for (int j = 0; j < collNumber; j++) { gameField[i,j] = new GameCell(isEmpty: true, isOpened: false); } } gameFieldWidth = collNumber; gameFieldHeight = rowNumber; }
public MinerGame(int rowNumber, int collNumber) { isGameEmpty = true; gameField = new GameCell[rowNumber, collNumber]; for (int i = 0; i < rowNumber; i++) { for (int j = 0; j < collNumber; j++) { gameField[i, j] = new GameCell(isEmpty: true, isOpened: false); } } gameFieldWidth = collNumber; gameFieldHeight = rowNumber; }
public MinerGame(int rowNumber, int collNumber, int countOfBombs) { isGameEmpty = false; gameField = new GameCell[rowNumber,collNumber]; for (int i = 0; i < rowNumber; i++) { for (int j = 0; j < collNumber; j++) { gameField[i, j] = new GameCell(isEmpty: true, isOpened: false); } } gameFieldWidth = rowNumber; gameFieldHeight = collNumber; while (countOfBombs != 0) { int i = rand.Next(0, rowNumber); int j = rand.Next(0, collNumber); if (SetBomb(i, j)) { countOfBombs--; } } }
public MinerGame(int rowNumber, int collNumber, int countOfBombs) { isGameEmpty = false; gameField = new GameCell[rowNumber, collNumber]; for (int i = 0; i < rowNumber; i++) { for (int j = 0; j < collNumber; j++) { gameField[i, j] = new GameCell(isEmpty: true, isOpened: false); } } gameFieldWidth = rowNumber; gameFieldHeight = collNumber; while (countOfBombs != 0) { int i = rand.Next(0, rowNumber); int j = rand.Next(0, collNumber); if (SetBomb(i, j)) { countOfBombs--; } } }