Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
 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--;
         }
     }
 }
Example #4
0
 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--;
         }
     }
 }