public void streight(Сar car) { if (car.speed == 0) { throw new Exception("Car is stoped! Cant right!"); } car.xchange = 0; car.fuelper100 -= 0.1; car.ChangeDirection(Front.ReturnStatus); }
public void turn(Сar car, int x) { if (car.speed == 0) { throw new Exception("Car is stoped! Cant turn!"); } if (car.xchange == x) { throw new Exception("Car's direction is already this!"); } else { car.xchange = x; car.ChangeDirection(Turn.ReturnStatus); car.fuelper100 += 0.1; } }