Added notation for wrong markers
This commit is contained in:
parent
f7ffbebdae
commit
ae8de489e3
5
Cell.cs
5
Cell.cs
@ -24,6 +24,11 @@
|
|||||||
public void setMine() { isMine = true; }
|
public void setMine() { isMine = true; }
|
||||||
public void mark() { isMarked = true; }
|
public void mark() { isMarked = true; }
|
||||||
public void unmark() { isMarked = false; }
|
public void unmark() { isMarked = false; }
|
||||||
|
public void setWrong()
|
||||||
|
{
|
||||||
|
isMarked = false;
|
||||||
|
value = "!";
|
||||||
|
}
|
||||||
public bool isEmpty() { return value == " "; }
|
public bool isEmpty() { return value == " "; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
Field.cs
2
Field.cs
@ -160,6 +160,8 @@
|
|||||||
{
|
{
|
||||||
if (!opened.Contains(cells[i]))
|
if (!opened.Contains(cells[i]))
|
||||||
opened.Add(cells[i]);
|
opened.Add(cells[i]);
|
||||||
|
if (cells[i].isMarked && !cells[i].isMine)
|
||||||
|
cells[i].setWrong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void mark(int y, int x) { cells[y * width + x].mark(); }
|
public void mark(int y, int x) { cells[y * width + x].mark(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user