Esempio n. 1
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());
        }
Esempio n. 2
0
 public BikeCommand(IBike bike, BikeAction action)
 {
     _bike   = bike;
     _action = action;
 }