Exemple #1
0
        public void GenerateNewState()
        {
            int aliveCellsCount = _fieldRepository.GetAliveCellsCountForPosition(_position);

            if (aliveCellsCount == 2)
            {
                if (IsAlive)
                {
                    IsAlive = true;
                    return;
                }
            }

            if (aliveCellsCount == 3)
            {
                IsAlive = true;
                return;
            }

            IsAlive = false;
        }