Beispiel #1
0
        static void Main(string[] args)
        {
            Duck greenDuck = new GreenDuck();
            greenDuck.PeformaneFly();
            greenDuck.PeformaneQuack();

            Duck modelDuck = new ModelDuck();
            modelDuck.PeformaneFly();
            modelDuck.PeformaneQuack();

            modelDuck.setFlyBehavior(new FlyWithWing());
            modelDuck.setQuackBehavior(new MuteSqueak());
            modelDuck.PeformaneFly();
            modelDuck.PeformaneQuack();

            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Duck greenDuck = new GreenDuck();

            greenDuck.PeformaneFly();
            greenDuck.PeformaneQuack();

            Duck modelDuck = new ModelDuck();

            modelDuck.PeformaneFly();
            modelDuck.PeformaneQuack();

            modelDuck.setFlyBehavior(new FlyWithWing());
            modelDuck.setQuackBehavior(new MuteSqueak());
            modelDuck.PeformaneFly();
            modelDuck.PeformaneQuack();

            Console.ReadLine();
        }