/// <summary> /// Aids the specified reproducer in delivering its baby. /// </summary> /// <param name="reproducer">The reproducer that is to give birth.</param> /// <returns>The resulting baby reproducer.</returns> public IReproducer DeliverAnimal(IReproducer reproducer) { // Sterilize birthing area. this.SterilizeBirthingArea(); // Give birth. IReproducer baby = reproducer.Reproduce(); if (baby is IMover) { // Make the baby move. (baby as IMover).Move(); } if (baby is Animal) { // Name the baby. (baby as Animal).Name = "Baby"; } // Wash up birthing area. this.WashUpBirthingArea(); // Increase counter. this.animalDeliveryCount++; return(baby); }
/// <summary> /// Aids the specified reproducer in delivering its baby. /// </summary> /// <param name="reproducer">The reproducer that is to give birth.</param> /// <returns>The resulting baby reproducer.</returns> public IReproducer DeliverAnimal(IReproducer reproducer) { // Sterilize birthing area. this.SterilizeBirthingArea(); // Give birth. IReproducer baby = reproducer.Reproduce(); // Wash up birthing area. this.WashUpBirthingArea(); // Increase counter. this.animalDeliveryCount++; return baby; }
/// <summary> /// Aids the specified reproducer in delivering its baby. /// </summary> /// <param name="reproducer">The reproducer that is to give birth.</param> /// <returns>The resulting baby reproducer.</returns> public IReproducer DeliverAnimal(IReproducer reproducer) { // Sterilize birthing area. this.SterilizeBirthingArea(); // Give birth. IReproducer baby = reproducer.Reproduce(); if (baby is IMover) { // Make the baby move. (baby as IMover).Move(); } if (baby is Animal) { // Name the baby. (baby as Animal).Name = "Baby"; } return(baby); }
public IReadOnlyCollection <Creature> Reproduce(IReproducer reproducer) { return(reproducer.Reproduce(this)); }