package cz.uhk.fim.dragonboatassistant.util;

import java.util.concurrent.TimeUnit;

public class Forecast {
	
	float distance;
	Converter timeConverter = new Converter();
	public long convertedSeconds;
	public long convertedMinutes;
	
	public long forecastSeconds(float speed) {
		
		long seconds = 0;
		if (speed > 0) {
			seconds = (long) (distance / speed);
		}
		return seconds;		
	}
	
	public void forecastMinsSeconds(float speed) {
		
		long seconds = forecastSeconds(speed);
		long mins = 0;
		mins = timeConverter.convertTime(seconds, TimeUnit.MINUTES, TimeUnit.SECONDS);
		if (mins > 0) {
			convertedMinutes = mins;
			convertedSeconds = seconds - (mins*60);
		} else {
			convertedMinutes = 0;
			convertedSeconds = seconds;
		}
	}

	public Forecast() {
		super();
	}

	public Forecast(float distance) {
		super();
		this.distance = distance;
	}

}
