예제 #1
0
파일: Bird.cs 프로젝트: gbrosman27/Zoo
 /// <summary>
 /// Initializes a new instance of the Bird class.
 /// </summary>
 /// <param name="name">The name of the animal.</param>
 /// <param name="age">The age of the animal.</param>
 /// <param name="weight">The weight of the animal (in pounds).</param>
 /// /// <param name="gender">The Bird's gender.</param>
 public Bird(string name, int age, double weight, Gender gender)
     : base(name, age, weight, gender)
 {
     this.MoveBehavior      = MoveBehaviorFactory.CreateMoveBehavior(MoveBehaviorType.Fly);
     this.EatBehavior       = EatBehaviorFactory.CreateEatBehavior(EatBehaviorType.Consume);
     this.ReproduceBehavior = ReproduceBehaviorFactory.CreateReproduceBehavior(ReproduceBehaviorType.LayEggs);
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the Mammal class.
 /// </summary>
 /// <param name="name">The name of the animal.</param>
 /// <param name="age">The age of the animal.</param>
 /// <param name="weight">The weight of the animal (in pounds).</param>
 /// /// <param name="gender">The Mammal's gender.</param>
 public Mammal(string name, int age, double weight, Gender gender)
     : base(name, age, weight, gender)
 {
     this.MoveBehavior      = MoveBehaviorFactory.CreateMoveBehavior(MoveBehaviorType.Pace);
     this.EatBehavior       = EatBehaviorFactory.CreateEatBehavior(EatBehaviorType.Consume);
     this.ReproduceBehavior = ReproduceBehaviorFactory.CreateReproduceBehavior(ReproduceBehaviorType.GiveBirth);
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the Platypus class.
        /// </summary>
        /// <param name="name">The name of the animal.</param>
        /// <param name="age">The age of the animal.</param>
        /// <param name="weight">The weight of the animal (in pounds).</param>
        /// /// <param name="gender">The Platypus's gender.</param>
        public Platypus(string name, int age, double weight, Gender gender)
            : base(name, age, weight, gender)
        {
            this.BabyWeightPercentage = 12.0;

            this.MoveBehavior      = MoveBehaviorFactory.CreateMoveBehavior(MoveBehaviorType.Swim);
            this.EatBehavior       = EatBehaviorFactory.CreateEatBehavior(EatBehaviorType.ShowAffection);
            this.ReproduceBehavior = ReproduceBehaviorFactory.CreateReproduceBehavior(ReproduceBehaviorType.LayEggs);
        }