Exemplo n.º 1
0
 private void Open()
 {
     if (!Defused && !Opened)
     {
         if (ContainsBomb)
         {
             Image = stateImagesTable[MineCellState.Exploded];
             state = MineCellState.Exploded;
         }
         else
         {
             Image = numberedSquaresTable[NeighbouringBombsCount];
         }
     }
 }
Exemplo n.º 2
0
 public MineButtonCell()
 {
     Mined = false;
     CellState = MineCellState.Hidden;
     NeighborMineCount = 0;
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
0
 private void NormalizeState(MineCellState value)
 {
     state = value == MineCellState.Opened && ContainsBomb ? MineCellState.Exploded : value;
 }