Class CodeBreaker
- java.lang.Object
-
- it.unicam.cs.pa.mastermind.players.CodeBreaker
-
- Direct Known Subclasses:
DonaldKnuthBreaker,InteractiveBreaker,RandomBotBreaker
public abstract class CodeBreaker extends java.lang.ObjectResponsabilità: rappresentazione di un giocatoreCodeBreaker, il cui compito è quello di indovinare la sequenza diColorPegsdecisa dal giocatoreCodeMaker.- Author:
- Francesco Pio Stelluti, Francesco Coppola
-
-
Constructor Summary
Constructors Constructor Description CodeBreaker()
-
Method Summary
Modifier and Type Method Description abstract java.util.List<ColorPegs>getAttempt()java.util.List<ColorPegs>getLastClue()Ritorna il valore memorizzato dell'ultima sequenza indizio relativa all'ultimo tentativo generato.booleanhasGivenUp()voidsetGiveUp(boolean giveUp)Imposta una volontà del giocatore di arrendersi o meno.voidsetLastClue(java.util.List<ColorPegs> lastClue)Imposta il valore memorizzato dell'ultima sequenza indizio relativa all'ultimo tentativo generato.voidtoggleGiveUp()Imposta la volontà del giocatoreCodeBreakerdi arrendersi.
-
-
-
Method Detail
-
setGiveUp
public void setGiveUp(boolean giveUp)
Imposta una volontà del giocatore di arrendersi o meno.- Parameters:
giveUp-
-
getLastClue
public java.util.List<ColorPegs> getLastClue()
Ritorna il valore memorizzato dell'ultima sequenza indizio relativa all'ultimo tentativo generato.- Returns:
-
setLastClue
public void setLastClue(java.util.List<ColorPegs> lastClue)
Imposta il valore memorizzato dell'ultima sequenza indizio relativa all'ultimo tentativo generato.- Parameters:
lastClue-
-
getAttempt
public abstract java.util.List<ColorPegs> getAttempt()
- Returns:
- List contenente i
ColorPegsvalidi come sequenza tentativo.
-
toggleGiveUp
public void toggleGiveUp()
Imposta la volontà del giocatoreCodeBreakerdi arrendersi.
-
hasGivenUp
public boolean hasGivenUp()
- Returns:
- la volontà del giocatore
CodeBreakerdi arrendersi o meno
-
-