private void Open() { if (!Defused && !Opened) { if (ContainsBomb) { Image = stateImagesTable[MineCellState.Exploded]; state = MineCellState.Exploded; } else { Image = numberedSquaresTable[NeighbouringBombsCount]; } } }
public MineButtonCell() { Mined = false; CellState = MineCellState.Hidden; NeighborMineCount = 0; }
/// <summary> /// The constructor that creates the minecell with the state and if it's the mine or not... /// </summary> /// <param name="mineState">The state of the mine cell.</param> /// <param name="isMine">The boolean state if it's the mine </param> public MineCell(MineCellState mineState = MineCellState.Exposed, bool isMine = false) { MineState = mineState; IsMine = isMine; MineCount = 0; }
private void NormalizeState(MineCellState value) { state = value == MineCellState.Opened && ContainsBomb ? MineCellState.Exploded : value; }