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}."); } }
public void Start(Сar car) { car.isMotorOn = true; car.ChangeState(MotorOn.ReturnStatus); }