package ch.zhaw.gartenverwaltung.backgroundtasks.weather;
/**
 * The WeatherService is a class to cause weather events for the WeatherGardenTaskPlanner
 */
public class WeatherService {
    private static final int NO_RAIN = 0;
    private static final int LITTLE_RAIN = 15;
    private static final int RAIN = 25;
    private static final int HEAVY_RAIN = 50;

    /**
     * Method to simmulate a Weather Service for testing
     * @param randomWeather random int. Range: 1-3
     * @return the selected SevereWeather
     */
    public SevereWeather causeSevereWeather(int randomWeather) {
        return switch (randomWeather) {
            case 1 -> SevereWeather.HAIL;
            case 2 -> SevereWeather.SNOW;
            case 3 -> SevereWeather.FROST;
            default -> null;
        };

    }

    /**
     * Method to simulate a Weather Service for testing
     * @param randomRainAmount random int. Range: 1-4
     * @return the selected rain amount
     */
    public int causeRainAmount(int randomRainAmount) {
        return switch (randomRainAmount) {
            case 1 -> NO_RAIN;
            case 2 -> LITTLE_RAIN;
            case 3 -> RAIN;
            case 4 -> HEAVY_RAIN;
            default -> -1;
        };

    }
}
