Inheritance: CellAroundMethod
Exemple #1
0
        public List<Cell> OpenCells(int rowIndex, int columnIndex)
        {
            var openCellsMethod = new OpenCellsMathod(Field);

            if (!Field[rowIndex, columnIndex].IsOpened && !Field[rowIndex, columnIndex].IsMarked)
            {
                if (!Field[rowIndex, columnIndex].IsMine)
                    openCellsMethod.CellCalculation(new Cell(rowIndex, columnIndex));
                else
                    State = GameState.PlayerLose;
            }

            return openCellsMethod.OpenedCells;
        }
Exemple #2
0
        public List <Cell> OpenCells(int rowIndex, int columnIndex)
        {
            var openCellsMethod = new OpenCellsMathod(Field);

            if (!Field[rowIndex, columnIndex].IsOpened && !Field[rowIndex, columnIndex].IsMarked)
            {
                if (!Field[rowIndex, columnIndex].IsMine)
                {
                    openCellsMethod.CellCalculation(new Cell(rowIndex, columnIndex));
                }
                else
                {
                    State = GameState.PlayerLose;
                }
            }

            return(openCellsMethod.OpenedCells);
        }