This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
minesweeper/Cell.cs
Masahiko AMANO ebd536897c Minor fixes
2022-03-09 12:01:38 +03:00

34 lines
779 B
C#

namespace MineSweeper
{
internal class Cell
{
public string Value = " ";
public bool IsMine;
public bool IsMarked;
public Cell(bool mine)
{
if (mine)
{
IsMine = true;
Value = "¤";
}
}
public string Show()
{
if (IsMarked)
return "X";
else
return Value;
}
public void SetMine() { IsMine = true; }
public void Mark() { IsMarked = true; }
public void Unmark() { IsMarked = false; }
public void SetWrong()
{
IsMarked = false;
Value = "!";
}
public bool IsEmpty() { return Value == " "; }
}
}