Esempio n. 1
0
        public bool Check(int cellX, int cellY)
        {
            var count = _grid.HowManyLiveNeighbours(cellX, cellY);
            var cell  = _grid.Grid[cellX, cellY];

            if (cell.CellState == State.Alive && count < Constants.CountUnderpopulation)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        public bool Check(int row, int col)
        {
            var cell  = _grid.Grid[row, col];
            var count = _grid.HowManyLiveNeighbours(row, col);

            if (cell.CellState == State.Dead)
            {
                if (count == Constants.CountSurvivalMin || count == Constants.CountSurvivalMax)
                {
                    return(true);
                }
            }
            return(false);
        }
        public bool Check(int row, int col)
        {
            var count = _grid.HowManyLiveNeighbours(row, col);
            var cell  = _grid.Grid[row, col];

            if (cell.CellState == State.Alive)
            {
                if (count > Constants.CountOvercrowding)
                {
                    return(true);
                }
            }
            return(false);
        }