Beispiel #1
0
        static void Main(string[] args)
        {
            Duck mallard = new MallardDuck();

            mallard.performFly();
            mallard.performQuack();
            Duck model = new ModelDuck();

            model.performFly();
            model.setFlyBehavior(new FlyRocketPowered());
            model.performFly();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Duck mallard = new MallardDuck();

            mallard.display();
            mallard.performQuack();
            mallard.performFly();
            Console.WriteLine("\n");

            Duck model = new ModelDuck();

            model.display();
            model.performFly();
            model.setFlyBehavior(new FlyRocketPowered());
            model.performFly();
        }