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 SetFlyBehavior(FlyBehavior flyBehavior)
 {
     this.flyBehavior = flyBehavior;
 }
Ejemplo n.º 4
0
 public void SetFlyBehavior(FlyBehavior flyBehavior)
 {
     this.flyBehavior = flyBehavior;
 }