/// <summary> /// Checks if the cell has been revealed and if not changes its type to Flag. /// </summary> /// <param name="regularCell">Takes one parameter of type Cell.</param> public void Visit(Cell regularCell) { if (!regularCell.IsCellRevealed) { regularCell.Type = CellTypes.Flag; } }
/// <summary> /// Checks if the passed cell is of type Safe and it true, sets its number of neighbouringMines. /// </summary> /// <param name="regularCell">Takes one parameter of type Cell.</param> public void Visit(Cell regularCell) { if (regularCell is SafeCell) { var cell = regularCell as SafeCell; cell.NumberOfNeighbouringMines = this.numberOfMines; } }
/// <summary> /// The method will visit the cell and will change it's state. /// </summary> /// <param name="regularCell">Takes one parameter of type Cell.</param> public void Visit(Cell regularCell) { regularCell.RevealCell(); }