Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //***** DUCKS
            Duck mallard = new MallardDuck();

            mallard.performQuack();
            mallard.performFly();
            mallard.display();
            mallard.setQuackBehaviour(new Squek());
            mallard.performQuack();

            Duck model = new ModelDuck();

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

            Console.ReadKey();

            //***** CHOCOLATE FACTORY

            /*
             * ChocolateBoiler CB = ChocolateBoiler.getInstance();
             * CB.fill();
             * CB.boil();
             *
             * Console.WriteLine("Hello World! Is the chocolate factory boiled? "+ CB.isBoiled());
             * Console.ReadKey();
             */
        }
Exemplo n.º 2
0
    public static void Main(string[] args)
    {
        var f    = new FlyWithWings();
        var q    = new Squeak();
        var duck = new ModelDuck(f, q);

        duck.performFly();
        duck.display();
        duck.performQuack();
        //Your code goes here
        Console.WriteLine("Hello, world!");
    }