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