pausa pranzo
This commit is contained in:
parent
8b6b3adc3b
commit
e99a62a900
6 changed files with 25 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -52,4 +52,8 @@ public class Giocatore {
|
||||||
public void convertiTessereSbleuro(){
|
public void convertiTessereSbleuro(){
|
||||||
this.sbleuri += this.tessereSbleuri;
|
this.sbleuri += this.tessereSbleuri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void posizionaTesseraTifoInveimento(int i){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Deque;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -17,7 +19,7 @@ public class Main {
|
||||||
cavalli.add(cavallo5);
|
cavalli.add(cavallo5);
|
||||||
cavalli.add(cavallo6);
|
cavalli.add(cavallo6);
|
||||||
cavalli.add(cavallo7);
|
cavalli.add(cavallo7);
|
||||||
ArrayList <Giocatore> giocatori = new ArrayList<>();
|
Deque <Giocatore> giocatori = new ArrayDeque<>();
|
||||||
Mappa mappa = new Mappa();
|
Mappa mappa = new Mappa();
|
||||||
Pila pila = new Pila();
|
Pila pila = new Pila();
|
||||||
|
|
||||||
|
@ -29,6 +31,9 @@ public class Main {
|
||||||
String s = input.sceltaNome();
|
String s = input.sceltaNome();
|
||||||
giocatori.add(new Giocatore(s));
|
giocatori.add(new Giocatore(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Partita partita = new Partita(giocatori, cavalli, mappa, pila);
|
||||||
|
partita.sceltaCavaliere();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
|
|
||||||
|
import it.kibo.fp.lib.RandomDraws;
|
||||||
|
|
||||||
public class Partita {
|
public class Partita {
|
||||||
private Deque <Giocatore> giocatori = new ArrayDeque<>();
|
private Deque <Giocatore> giocatori = new ArrayDeque<>();
|
||||||
private ArrayList <Cavallo> cavalli = new ArrayList<>();
|
private ArrayList <Cavallo> cavalli = new ArrayList<>();
|
||||||
|
@ -14,4 +16,17 @@ public class Partita {
|
||||||
this.mappa = mappa;
|
this.mappa = mappa;
|
||||||
this.pila = pila;
|
this.pila = pila;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sceltaCavaliere(){
|
||||||
|
int i = RandomDraws.drawInteger(0, giocatori.size()-1);
|
||||||
|
for(int j = 0; j < i; j++){
|
||||||
|
giocatori.addLast(giocatori.getFirst());
|
||||||
|
giocatori.removeFirst();
|
||||||
|
}
|
||||||
|
giocatori.getFirst().setCavaliere(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void inizioTappa(){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue