Ejemplo n.º 1
0
        public override CellState ApplyRule(LifeLikeCell cell)
        {
            IList <ICell> neighbors           = cell.GetNeighbors();
            int           aliveNeighborsCount = getAliveCellsCount(neighbors);

            if (cell.IsAlive() && LivingNeighborsRequirements.Contains(aliveNeighborsCount))
            {
                return(cell.GetState());
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 public abstract CellState ApplyRule(LifeLikeCell cell);