コード例 #1
0
        /// <summary>
        /// Has the doctor deliver the mother's baby.
        /// </summary>
        /// <param name="mother"> The animal giving birth. </param>
        /// <returns> The return is Animal. </returns>
        public Animal DeliverAnimal(Animal mother)
        {
            Animal baby = mother.Reproduce();

            baby.Name = "Baby";

            return(baby);
        }
コード例 #2
0
        /// <summary>
        /// Aids the specified mother animal in delivering her baby.
        /// </summary>
        /// <param name="mother">The mother animal.</param>
        /// <returns>The new baby animal.</returns>
        public Animal DeliverAnimal(Animal mother)
        {
            // Define and initialize a result variable.
            Animal result = null;

            // Sterilize birthing area before delivering animal.
            this.SterilizeBirthingArea();

            // Aid the mother animal in reproducing.
            result = mother.Reproduce();

            // Wash up birthing area after delivering animal.
            this.WashUpBirthingArea();

            // Increment delivery count.
            this.animalDeliveryCount++;

            // Return result.
            return result;
        }