Пример #1
0
 public GameOfLifeInfection(int width, int height, int maxGenerations, int infectAfter, bool[,] world)
     : base(width, height, maxGenerations, world)
 {
     _infectAfter = infectAfter;
     if (infectAfter == 0)
     {
         _rules = new InfectionRules();
     }
 }
Пример #2
0
        /// <summary>
        /// changes the rules to infection rules when the right generation comes
        /// </summary>
        public override string RunStep()
        {
            var res = base.RunStep();

            if (_currentGen == _infectAfter)
            {
                _rules = new InfectionRules();
            }
            return(res);
        }