Beispiel #1
0
        void main()
        {
            var electricDuck = new ElectricDuck();

            var flyCommand = new FlyCommand(electricDuck);
            var runCommand = new RunCommand(electricDuck);

            var remote = new RemoteControl();
            remote.SetCommand(flyCommand);
            remote.ExecuteCommand();

            remote.SetCommand(runCommand);
            remote.ExecuteCommand();
        }
Beispiel #2
0
        void main()
        {
            var electricDuck = new ElectricDuck();

            var flyCommand = new FlyCommand(electricDuck);
            var runCommand = new RunCommand(electricDuck);

            var remote = new RemoteControl();

            remote.SetCommand(flyCommand);
            remote.ExecuteCommand();

            remote.SetCommand(runCommand);
            remote.ExecuteCommand();
        }
Beispiel #3
0
 public FlyCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
Beispiel #4
0
 public RunCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
 public FlyCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
 public RunCommand(ElectricDuck duck)
 {
     _duck = duck;
 }