Auto marking unmarked mines when win

This commit is contained in:
Masahiko AMANO
2022-03-11 19:04:45 +03:00
parent 2445155e93
commit b3e3b50d64
2 changed files with 11 additions and 9 deletions
+7 -1
View File
@@ -151,7 +151,7 @@
}
return false;
}
public void OpenAll()
public void OpenAll(bool automark)
{
for (int i = 0; i < size; i++)
{
@@ -159,7 +159,13 @@
opened.Add(cells[i]);
if (cells[i].IsMarked && !cells[i].IsMine)
cells[i].SetWrong();
if (automark && cells[i].IsMine)
{
cells[i].Mark();
nmines = 0;
}
}
this.Draw();
}
public void Mark(int y, int x)
{