Exemplo n.º 1
0
 public void UnRide(int numberOfActions)
 {
     for (int i = 0; i < numberOfActions; i++)
     {
         BikeCommand command = _commands.Pop();
         command.UndoAction();
         Console.WriteLine($"Bike is undoing action: {command}");
         Console.WriteLine(ToString());
     }
 }
Exemplo n.º 2
0
        public void Ride(BikeAction action)
        {
            Console.WriteLine($"Bike is now doing action: {action}");

            BikeCommand command = new BikeCommand(_bike, action);

            _commands.Push(command);

            command.DoAction();

            Console.WriteLine(ToString());
        }