Ejemplo n.º 1
0
        public Duck()
        {
            //flyBehavior = Delegation.New<FlyBehavior>(typeof(FlyWithWing));
            //quackBehavior = Delegation.New<QuackBehavior>(typeof(Quacks));

            flyBehavior   = Delegation.New <FlyBehavior>(typeof(FlyWithWing));
            quackBehavior = new QuackBehavior(typeof(Quacks));
        }
Ejemplo n.º 2
0
        public Duck()
        {
            //flyBehavior = Delegation.New<FlyBehavior>(typeof(FlyWithWing));
            //quackBehavior = Delegation.New<QuackBehavior>(typeof(Quacks));

            flyBehavior = Delegation.New<FlyBehavior>(typeof(FlyWithWing));
            quackBehavior = new QuackBehavior(typeof(Quacks));
        }
Ejemplo n.º 3
0
 public void SetQuackBehavior(QuackBehavior quackBehavior)
 {
     this.quackBehavior = quackBehavior;
 }
Ejemplo n.º 4
0
 public void SetQuackBehavior(QuackBehavior quackBehavior)
 {
     this.quackBehavior = quackBehavior;
 }