Exemplo n.º 1
0
 private void DepthFirstSearch(ICell currentCell, ref int counter)
 {
     if (currentCell.ChangeState())
     {
         counter++;
     }
     if (currentCell.MinesNumber > 0 || currentCell.HasMine)
     {
         return;
     }
     currentCell.HasVisited = true;
     foreach (ICell cell in currentCell.CellsAround)
     {
         if (!cell.HasVisited)
         {
             DepthFirstSearch(cell, ref counter);
         }
     }
 }