コード例 #1
0
 private void RubberRB_CheckedChanged(object sender, EventArgs e)
 {
     _duck = new RubberDuck();
     _duck.setFlyBehavior(new FlyNoWay());
     _duck.setQuackBehavior(new Squeak());
 }
コード例 #2
0
 private void DecoyRB_CheckedChanged(object sender, EventArgs e)
 {
     _duck = new DecoyDuck();
     _duck.setFlyBehavior(new FlyNoWay());
     _duck.setQuackBehavior(new MuteQuack());
 }
コード例 #3
0
 private void ReadheadRB_CheckedChanged(object sender, EventArgs e)
 {
     _duck = new RedheadDuck();
     _duck.setFlyBehavior(new FlyWithWings());
     _duck.setQuackBehavior(new Quack());
 }