Exemplo n.º 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();
        }
Exemplo n.º 2
0
 public MallardDuck()
     : base(FlyBehaviour.FlyWithWings(), QuackBehaviour.Quack, DanceBehaviour.Waltz)
 {
 }
Exemplo n.º 3
0
 public RedHeadDuck()
     : base(FlyBehaviour.FlyWithWings(), QuackBehaviour.Quack, DanceBehaviour.Manuette)
 {
 }