コード例 #1
0
        private void MakeStep()
        {
            _map.AddNeighbours();
            Dictionary <Field, bool> nextLives = new Dictionary <Field, bool>();

            foreach (Field field in _map.Fields)
            {
                bool nextStatus = _gameRules.CalculateLiveStatus(field, _map.CalculateLivingNeighbours(field));
                nextLives.Add(field, nextStatus);
            }
            foreach (var pair in nextLives)
            {
                pair.Key.Live = pair.Value;
            }
            _printer.Print(_map);
        }