public static void Main(string[] args) { Duck mallard = new MallardDuck(new FlyWithWings(), new Quack()); mallard.PerformQuack(); mallard.PerformFly(); mallard.flyBehavior = new FlyNoWay(); mallard.PerformFly(); Duck model = new ModelDuck(new FlyWithWings(), new Quack()); model.PerformFly(); }
static void Main() { Duck mallard = new MallardDuck(); mallard.PerformQuack(); mallard.PerformFly(); Duck modelDuck = new ModelDuck(); modelDuck.PerformFly(); modelDuck.FlyBehavior = new FlyRocketPowered(); modelDuck.PerformFly(); }
static void Main(string[] args) { var mallard = new MallardDuck(); mallard.PerformQuack(); mallard.PerformFly(); var model = new ModelDuck(); model.PerformFly(); model.FlyBehavior = new FlyRocketPowered(); model.PerformFly(); }
private static void Main() { AbstractDuck.Duck mallard = new MallardDuck(); mallard.PerformQuack(); mallard.PerformFly(); AbstractDuck.Duck model = new ModelDuck(); model.PerformFly(); model.SetFlyBehavior(new FlyRocketPowered()); model.PerformFly(); Console.ReadKey(); }
public static void Main(string[] args) { Duck mallard = new MallardDuck(); mallard.performQuack(); mallard.performFly(); Duck model = new ModelDuck(); model.performFly(); model.setFlyBehavior(new FlyRocketPowered()); model.performFly(); }
static void Main(string[] args) { Duck mallard = new MallardDuck(); mallard.PerformFly(); mallard.PerformQuack(); Duck model = new ModelDuck(); model.PerformFly(); model.SetFlyBehavior(new FlyRocketPowered()); model.PerformFly(); Console.ReadLine(); }