import java.util.HashSet;

public class VerificaRotture implements Runnable {
	private HashSet<Autobus> autobus;
	private HashSet<Officina> officine;
	int t;
	
	public VerificaRotture(HashSet<Autobus> autobus, HashSet<Officina> officine, int t) {
		this.autobus = autobus;
		this.officine = officine;
		this.t = t;
	}
	
	@Override
	public void run() {
		while (! Manutenzione.termina) {
			Rotture r = new Rotture(autobus, officine);
			TaskExecutor.getInstance().perform(r);
			try {
				Thread.sleep(this.t * 1000);
			} catch (InterruptedException e) {
			}
		}
	}
}
