forked from luizaagostinho/BookSmart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntrega.java
More file actions
63 lines (52 loc) · 1.7 KB
/
Copy pathEntrega.java
File metadata and controls
63 lines (52 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package classes;
private Entregador entregador;
private String livro;
private String biblioteca;
//essa classe me deixou com MUITA PREGUICA
//pq na verdade esses atributos de cima nao deveriam ser strings
//e sim classes. e na funcao gerarAtividade,
//simplesmente puxar os strings dos nomes dos objetos e tals
//e passar pra funcao que a gente deu Override
//eu so to com preguica mesmo de fazer isso
// o resto eu creio que va rodar, mas temos que testar.
public Entrega() {
for (Entregador entregador : Entregador.voluntariosEntrega) {
for (Bairro bairro : entregador.bairrosAtendidos) {
for (Pedido pedido : Pedido.pedidos) {
if (bairro.equals(pedido.getBibOrigem().getBairro())) {
entregador.entregasPendentes.add(pedido);
this.setEntregador(entregador);
this.setLivro(pedido.getLivroPedido().getTitulo());
this.setBiblioteca(pedido.getBibOrigem().getNome());
gerarAtividade(this);
}
}
}
}
}
public String gerarAtividade(Entrega entrega) {
return "Livro: "+ this.getLivro()+" entregue por: "+this.getEntregador().getNome()+" em Biblioteca: "+this.getBiblioteca();
}
public Entregador getEntregador() {
return entregador;
}
public void setEntregador(Entregador entregador) {
this.entregador = entregador;
}
public String getLivro() {
return this.livro;
}
public void setLivro(String livro) {
this.livro = livro;
}
public String getBiblioteca() {
return this.biblioteca;
}
public void setBiblioteca(String biblioteca) {
this.biblioteca = biblioteca;
}
@Override
public void registrarAtividade(String atividade) {
// TODO Auto-generated method stub
}
}