Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #3
0
 public void SetQuackBehavior(QuackBehavior quackBehavior)
 {
     this.quackBehavior = quackBehavior;
 }
Beispiel #4
0
 public void SetQuackBehavior(QuackBehavior quackBehavior)
 {
     this.quackBehavior = quackBehavior;
 }