Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public FlyCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
Exemplo n.º 4
0
 public RunCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
Exemplo n.º 5
0
 public FlyCommand(ElectricDuck duck)
 {
     _duck = duck;
 }
Exemplo n.º 6
0
 public RunCommand(ElectricDuck duck)
 {
     _duck = duck;
 }