package pckEngenho;

public class EngenhoImpl {

    private Plano plano;
    private Veiculo[] aVeiculos;
    private Encomenda[] aEncomendas;
    private String veiculosPath;
    private String encomendasPath;
    private String trechosPath;

		
    public EngenhoImpl(String veicPath, String encPath, String trecPath) {
	setVeiculosPath(veicPath);
	setEncomendasPath(encPath);
	setTrechosPath(trecPath);
	processa();
    }

    public setVeiculosPath(String novoVeiculosPath) {
	veiculosPath = novoVeiculosPath;
    }
	
    public setEncomendasPath(String novoEncomendasPath) {
	encomendasPath = novoEncomendasPath;
    }
	
    public setTrechosPath(String novoTrechosPath) {
	trechosPath = novoTrechosPath;
    }

    /**
       A partir do path indicado pela interface, carrega o
    */
    private carregaVeiculos() {
	Leitura lv = new Leitura ();
	aVeiculos = lv.carregarVeiculo(this.veiculosPath);
    }
	
    private carregaEncomendas() {
	Leitura le = new Leitura();
	aEncomendas = le.carregarEncomenda(this.encomendasPath);
    }
    
    private carregaTrechos() {
	
    }

    /**
       A partir das informacoes fornecidas ao Engenho (arquivos de entrada)
       inicia um estado para utilizacao da interface com um plano calculado
       para estes arquivos de entrada
    */
    private processa() {
	this.carregaVeiculos();
	this.carregaEncomendas();
	this.carregaTrechos();
	
	Gerador gerador = new pckPlano.GeradorImpl();
		
	Plano plano = gerador.gera(aVeiculos,aEncomendas,mapa);
		
    }

}

