Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Duck Mallard = new MallardDuck();

            Mallard.performFly();
            Mallard.performQuack();

            Duck model = new ModelDuck();

            model.performFly();
            model.setFlyBehaviour(new FlyWithWings());
            model.performFly();

            //no vuela
            Duck model2 = new ModelDuck();

            model.performFly();
            model.setFlyBehaviour(new FlyNoWay());
            model.performFly();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Duck mallard = new MallardDuck();

            mallard.performFly();
            mallard.performQuack();
            mallard.display();


            Duck model = new ModelDuck();

            model.performFly();
            model.setFlyBehaviour(new FlyRocketPowered());
            model.performFly();

            Console.ReadKey();
        }