Esempio n. 1
0
 public void Stop(Сar car)
 {
     if (car.speed == 0)
     {
         car.isMotorOn = false;
         car.ChangeState(MotorOff.ReturnStatus);
     }
     else
     {
         throw new Exception($"Beffore stopping the car, make its speed being 0! Now speed is {car.speed}.");
     }
 }
Esempio n. 2
0
 public void Start(Сar car)
 {
     car.isMotorOn = true;
     car.ChangeState(MotorOn.ReturnStatus);
 }