コード例 #1
0
 // ********************* 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;
 }
コード例 #2
0
 /// <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();
 }
コード例 #3
0
        /// <summary>
        ///		Make a deep copy of this list.
        /// </summary>
        /// <returns>The cCellTimeList that is a copy of this list.</returns>
        public cCellTimeList Clone()
        {
            // create the new list
            cCellTimeList CloneList = new cCellTimeList();

            foreach (cCellTime item in this)
            {
                CloneList.Add(item);
            }
            // return the new list
            return(CloneList);
        }