예제 #1
0
 public void Brake(Car car)
 {
     Console.WriteLine("Still not moving");
 }
예제 #2
0
 public void Brake(Car car)
 {
     Console.WriteLine("Stopping");
     car.State = new NotMoving();
 }
예제 #3
0
 public void Throttle(Car car)
 {
     Console.WriteLine("Starting to move");
     car.State = new Moving();
 }
예제 #4
0
 public void Throttle(Car car)
 {
     Console.WriteLine("Moving faster");
 }