Beispiel #1
0
        static void Main(string[] args)
        {
            SimulateDuck(new MallardDuck());
            SimulateDuck(new RedHeadDuck());
            SimulateDuck(new RubberDuck());
            SimulateDuck(new DecoyDuck());
            SimulateDuck(new ModelDuck());

            Duck duck = new MallardDuck();

            duck.Fly();
            duck.Fly();
            duck.SetFlight(FlyBehaviour.FlyWithWings());
            duck.Fly();
        }
Beispiel #2
0
 public MallardDuck()
     : base(FlyBehaviour.FlyWithWings(), QuackBehaviour.Quack, DanceBehaviour.Waltz)
 {
 }
Beispiel #3
0
 public RedHeadDuck()
     : base(FlyBehaviour.FlyWithWings(), QuackBehaviour.Quack, DanceBehaviour.Manuette)
 {
 }