public List <Animal> Mate(Random randomizer, IEvolutionRules rules) { var result = rules.GetSiblingsGroupData(this, randomizer); var children = new List <Animal>(result.NumberOfSiblings); for (int i = 0; i < result.NumberOfSiblings; i++) { var child = new Animal() { Gender = (Gender)randomizer.Next(0, 2), EvolutionaryTrait = result.EvolutionaryTrait }; child = rules.PostBirthChildAdjustments(child); children.Add(child); } return(children); }
public Evolution(IEvolutionRules rules) { Randomize = new Randomizer(); Rules = rules; }