/// <summary> /// Default constructor of the class,which will define the correct configration of rule factory and neighbourrule factory. /// </summary> /// <param name="grid">collectiion of cells</param> /// <param name="ruleFactory"> Factory to create rule. </param> /// <param name="neighbourRule">Factory to create neighbour rule.</param> public GameOfLife(ICellCollection grid, IRuleFactory ruleFactory, INeighbourRuleFactory neighbouruleFactory) { this.generationNumber = 1; this.grid = grid; this.ruleFactory = ruleFactory; this.neighbouruleFactory = neighbouruleFactory; }
/// <summary> /// Use this constructor to configure the game of life with the correct neighbour rule and evolution rule factories /// </summary> /// <param name="grid">Grid of cells to evolve</param> /// <param name="evolutionRuleFactory">Factory to create a evolution rule when needed.</param> /// <param name="neighbourRuleFactory">Factory to create a neighbour rule when needed.</param> public BasicGameOfLife(ICellContainer grid, IEvolutionRuleFactory evolutionRuleFactory, INeighbourRuleFactory neighbourRuleFactory) { generationnumber = 1; this.grid = grid; this.evolutionaryrulefactory = evolutionRuleFactory; this.neighbourrulefactory = neighbourRuleFactory; }