// ********************* methods *************************************************** /// <summary> /// Set the current attributes to those belonging to the passed animal. /// </summary> /// <param name="Animal"> /// The passed animal. An ArgumentNullException exception is raised if Animal is /// null. /// </param> public virtual void SetAttributes(cAnimal Animal) { // make sure animal is not null if (Animal == null) { throw new ArgumentNullException("Animal", "Animal must not be null."); } // set values ID = Animal.ID; Age = Animal.Age; YearDied = Animal.YearDied; WeekDied = Animal.WeekDied; Gender = Animal.Gender; ParentID = Animal.ParentID; IsIndependent = Animal.IsIndependent; IsAlive = Animal.IsAlive; Offspring = Animal.Offspring; Cells = Animal.GetCellsAndTime(); Infections = Animal.GetInfections(); Vaccines = Animal.GetVaccines(); Marker = Animal.Marker; AutoMarker = Animal.AutoMarker; CannotGiveBirth = Animal.CannotGiveBirthValue; PartnerMarker = Animal.PartnerMarker; }
/// <summary> /// Initialize the animal attributes class. /// </summary> public cAnimalAttributes() { // create valid cell and infection lists Cells = new cCellTimeList(); Infections = new cInfectionList(); // create the collection of offspring IDs Offspring = new List <string>(); // create the collection of vaccines Vaccines = new cVaccineList(); }