This repository has been archived on 2022-03-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
minesweeper/Cell.cs
T
Masahiko AMANO 339576b7cc Initial commit
2022-03-02 22:52:46 +03:00

34 lines
838 B
C#

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 == " "; }
}
}