예제 #1
0
        public void Setup()
        {
            var overcrowdingRule = RuleCreator.GetOvercrowdingRule();

            var cellAliveRequirement = new InitialStateRequirement(new HashSet <CellState> {
                CellState.Alive
            });
            var eightNeighboursRequirement = new ActiveNeighbourRequirement(new HashSet <int> {
                8
            });

            var superOvercrowdingRequirements = new List <IRequirement> {
                cellAliveRequirement, eightNeighboursRequirement
            };
            var superOvercrowdingRule = new Rule(superOvercrowdingRequirements, CellState.Alive);

            var rules = new Dictionary <int, Rule>
            {
                { 1, superOvercrowdingRule },
                { 2, overcrowdingRule }
            };

            _ruleSet = new RuleSet(rules);
        }
예제 #2
0
 public void Setup()
 {
     _overcrowdingRule = RuleCreator.GetOvercrowdingRule();
 }