Example #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));
        }
Example #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));
        }
Example #3
0
 public void SetFlyBehavior(FlyBehavior flyBehavior)
 {
     this.flyBehavior = flyBehavior;
 }
Example #4
0
 public void SetFlyBehavior(FlyBehavior flyBehavior)
 {
     this.flyBehavior = flyBehavior;
 }