Пример #1
0
        public void InitAlive(int x, int y)
        {
            Cell cell = _board.AddCell(x, y);

            _alives.Add(cell);
            cell.Update(true);
            cell.PostUpdate();
        }
Пример #2
0
        public void IsAliveShouldBeTrueAfterDeadCellUpdateGivenRegenerationNeighbors()
        {
            Cell cell = DeadCell();

            new PopulationControl().UpdateState(cell, RegenerationNeighbors);
            cell.Update();
            Assert.True(cell.IsAlive());
        }
Пример #3
0
        public void IsAliveShouldBeFalseAfterAliveCellUpdateGivenOverpopulationNeighbors()
        {
            Cell cell = AliveCell();

            new PopulationControl().UpdateState(cell, OverpopulationNeighbors);
            cell.Update();
            Assert.False(cell.IsAlive());
        }
Пример #4
0
        public void IsAliveShouldBeTrueAfterAliveCellUpdateGivenMinStaticNeighbors()
        {
            Cell cell = AliveCell();

            new PopulationControl().UpdateState(cell, MinStaticNeighbors);
            cell.Update();
            Assert.True(cell.IsAlive());
        }