progress
This commit is contained in:
parent
6f14cb6657
commit
1b12294c68
13 changed files with 44 additions and 16 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,23 +6,21 @@ import it.kibo.fp.lib.RandomDraws;
|
|||
public class Cavallo {
|
||||
private String nome;
|
||||
private String colore;
|
||||
private Deque <Tessera> tessere = new ArrayDeque();
|
||||
private Deque <Tessera> tessere = new ArrayDeque<>();
|
||||
private int posizione;
|
||||
private boolean matto;
|
||||
|
||||
public Cavallo(String nome, String colore){
|
||||
this.nome = nome;
|
||||
this.colore = colore;
|
||||
this.matto = false;
|
||||
this.posizione = RandomDraws.drawInteger(1, 3);
|
||||
setTessere();
|
||||
}
|
||||
|
||||
public void CavalloMatto(String nome, String colore){
|
||||
public Cavallo(String nome, String colore, boolean m){
|
||||
this.nome = nome;
|
||||
this.colore = colore;
|
||||
if (m == true){
|
||||
this.matto = true;
|
||||
this.posizione = RandomDraws.drawInteger(14, 16);
|
||||
}
|
||||
else{
|
||||
this.matto = false;
|
||||
this.posizione = RandomDraws.drawInteger(1, 3);
|
||||
}
|
||||
setTessere();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Cavallo cavallo1 = new Cavallo("Nawt","Rosso", false);
|
||||
Cavallo cavallo2 = new Cavallo("Blanco","Blu", false);
|
||||
Cavallo cavallo3 = new Cavallo("Pound","Giallo", false);
|
||||
Cavallo cavallo4 = new Cavallo("Bang","Verde", false);
|
||||
Cavallo cavallo5 = new Cavallo("Bupkus","Viola", false);
|
||||
Cavallo cavallo6 = new Cavallo("Bugs","Bianco", true);
|
||||
Cavallo cavallo7 = new Cavallo("Daffy","Nero", true);
|
||||
Mappa mappa = new Mappa();
|
||||
|
||||
Output output = new Output();
|
||||
output.richiestaGiocatori();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ public class Mappa {
|
|||
}
|
||||
}
|
||||
|
||||
/*public void setCasella(Posizione p, int i){
|
||||
this.caselle.get(i)=Posizione(p);
|
||||
}*/
|
||||
|
||||
public String toString(){
|
||||
String stringa ="";
|
||||
|
||||
|
@ -19,4 +23,6 @@ public class Mappa {
|
|||
return stringa;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
public class Output {
|
||||
|
||||
public Output(){
|
||||
|
||||
}
|
||||
|
||||
public void richiestaGiocatori(){
|
||||
System.out.println("Quanti giocatori desiderano giocare? ");
|
||||
}
|
||||
|
||||
public void mostraMappa (Mappa mappa){
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ import java.util.ArrayList;
|
|||
import java.util.Deque;
|
||||
|
||||
public class Partita {
|
||||
private Deque <Giocatore> giocatori = new ArrayDeque();
|
||||
private ArrayList <Cavallo> cavalli;
|
||||
private Deque <Giocatore> giocatori = new ArrayDeque<>();
|
||||
private ArrayList <Cavallo> cavalli = new ArrayList<>();
|
||||
private Mappa mappa;
|
||||
private Pila pila;
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.Collections;
|
||||
|
||||
public class Posizione {
|
||||
private int tesseraTifoInveimento;
|
||||
private Deque <Cavallo> cavalli = new ArrayDeque();
|
||||
private Deque <Cavallo> cavalli = new ArrayDeque<>();
|
||||
|
||||
public String toString(){
|
||||
String stringa="*";
|
||||
|
@ -26,7 +25,7 @@ public class Posizione {
|
|||
cavalli.removeFirst();
|
||||
}
|
||||
}*/
|
||||
ArrayList <Cavallo> cavalliArray = new ArrayList(cavalli);
|
||||
ArrayList <Cavallo> cavalliArray = new ArrayList<>(cavalli);
|
||||
for(int i = 0; i < cavalliArray.size(); i ++){
|
||||
stringa += cavalliArray.get(i).getNome() + " ---> ";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue