PgAr2025_Esame_GabrieleDome.../Spirit_Arnaldo_Selvaggio/src/Input.java

32 lines
787 B
Java
Raw Normal View History

2025-06-09 12:58:57 +02:00
import it.kibo.fp.lib.InputData;
2025-06-09 10:44:26 +02:00
public class Input {
2025-06-09 12:58:57 +02:00
public Input(){
}
public int numeroGiocatori(){
int i = InputData.readIntegerBetween("quanti giocatori desiderano giocare? ", 3, 6);
return i;
}
public String sceltaNome(){
2025-06-09 15:39:19 +02:00
String s = InputData.readString("Scegli il tuo nome", true);
2025-06-09 12:58:57 +02:00
return s;
}
2025-06-09 13:54:21 +02:00
public int sceltaTifoInvimento(Mappa mappa){
int i = 0;
do{
i = InputData.readIntegerBetween("seleziona la casella che vuoi influenzare", 0, 17);
}while(mappa.controllaAdiacenti(i) == false);
return i;
}
2025-06-09 12:58:57 +02:00
public boolean sceltaTifoInveimento(){
boolean s = InputData.readYesOrNo("vuoi fare il tifo o vuoi inveire? (Y/tifo, N/inveimento)");
return s;
}
2025-06-09 10:44:26 +02:00
}