tessera fatta
This commit is contained in:
parent
38ed7d654a
commit
5c1a172496
10 changed files with 50 additions and 9 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,17 +4,18 @@ import java.util.Deque;
|
||||||
import it.kibo.fp.lib.RandomDraws;
|
import it.kibo.fp.lib.RandomDraws;
|
||||||
|
|
||||||
public class Cavallo {
|
public class Cavallo {
|
||||||
String nome;
|
private String nome;
|
||||||
String colore;
|
private String colore;
|
||||||
Deque <Tessera> tessere = new ArrayDeque<>(4);
|
private Deque <Tessera> tessere = new ArrayDeque<>();
|
||||||
int posizione;
|
private int posizione;
|
||||||
boolean matto;
|
private boolean matto;
|
||||||
|
|
||||||
public Cavallo(String nome, String colore){
|
public Cavallo(String nome, String colore){
|
||||||
this.nome = nome;
|
this.nome = nome;
|
||||||
this.colore = colore;
|
this.colore = colore;
|
||||||
this.matto = false;
|
this.matto = false;
|
||||||
this.posizione = RandomDraws.drawInteger(1, 3);
|
this.posizione = RandomDraws.drawInteger(1, 3);
|
||||||
|
setTessere();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CavalloMatto(String nome, String colore){
|
public void CavalloMatto(String nome, String colore){
|
||||||
|
@ -22,6 +23,7 @@ public class Cavallo {
|
||||||
this.colore = colore;
|
this.colore = colore;
|
||||||
this.matto = true;
|
this.matto = true;
|
||||||
this.posizione = RandomDraws.drawInteger(14, 16);
|
this.posizione = RandomDraws.drawInteger(14, 16);
|
||||||
|
setTessere();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNome() {
|
public String getNome() {
|
||||||
|
@ -49,5 +51,10 @@ public class Cavallo {
|
||||||
public void setMatto(boolean matto) {
|
public void setMatto(boolean matto) {
|
||||||
this.matto = matto;
|
this.matto = matto;
|
||||||
}
|
}
|
||||||
|
public void setTessere(){
|
||||||
|
for(int i = 0; i < 4; i++){
|
||||||
|
tessere.add(new Tessera());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ public class Giocatore {
|
||||||
tesseraTifoInveimento = true;
|
tesseraTifoInveimento = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//getters
|
||||||
public String getNome() {
|
public String getNome() {
|
||||||
return nome;
|
return nome;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +32,7 @@ public class Giocatore {
|
||||||
return tesseraTifoInveimento;
|
return tesseraTifoInveimento;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//setters
|
||||||
public void setNome(String nome) {
|
public void setNome(String nome) {
|
||||||
this.nome = nome;
|
this.nome = nome;
|
||||||
}
|
}
|
||||||
|
@ -46,4 +48,8 @@ public class Giocatore {
|
||||||
public void setTesseraTifoInveimento(boolean tesseraTifoInveimento) {
|
public void setTesseraTifoInveimento(boolean tesseraTifoInveimento) {
|
||||||
this.tesseraTifoInveimento = tesseraTifoInveimento;
|
this.tesseraTifoInveimento = tesseraTifoInveimento;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void convertiTessereSbleuro(){
|
||||||
|
this.sbleuri += this.tessereSbleuri;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
public class Mappa {
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Mappa {
|
||||||
|
private ArrayList<Posizione> caselle = new ArrayList<>();
|
||||||
|
Mappa(){
|
||||||
|
for(int i = 0; i < 17; i++){
|
||||||
|
caselle.add(i, new Posizione());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
public class Partita {
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Deque;
|
||||||
|
|
||||||
|
public class Partita {
|
||||||
|
private Deque <Giocatore> giocatori = new ArrayDeque<>();
|
||||||
|
private ArrayList <Cavallo> cavalli;
|
||||||
|
private Mappa mappa;
|
||||||
|
private Pila pila;
|
||||||
|
|
||||||
|
public Partita(Deque <Giocatore> giocatori, ArrayList<Cavallo> cavalli, Mappa mappa, Pila pila){
|
||||||
|
this.giocatori = giocatori;
|
||||||
|
this.cavalli = cavalli;
|
||||||
|
this.mappa = mappa;
|
||||||
|
this.pila = pila;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
public class Tessera {
|
public class Tessera {
|
||||||
|
private Giocatore giocatorePrenotato;
|
||||||
|
|
||||||
|
public Tessera(){
|
||||||
|
|
||||||
|
}
|
||||||
|
public void assegnaTessera(Giocatore g){
|
||||||
|
this.giocatorePrenotato = g;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue