Initial commit

This commit is contained in:
Masahiko AMANO
2022-03-02 22:52:46 +03:00
commit 339576b7cc
8 changed files with 734 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
namespace MineSweeper
{
internal class Cell
{
public string value = " ";
public bool isMine = false;
public bool isOpened = false;
private bool isMarked = false;
public Cell(bool mine)
{
if (mine)
{
isMine = true;
value = "¤";
}
}
public string show()
{
if (isOpened)
return value;
else if (isMarked)
return "X";
else
return "■";
}
public void setMine() { isMine = true; }
public void open() { isOpened = true; }
public void mark() { isMarked = true; }
public void unmark() { isMarked = false; }
public bool isEmpty() { return value == " "; }
}
}