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.Object
Responsabilità: rappresentazione di un giocatoreCodeBreaker
, il cui compito è quello di indovinare la sequenza diColorPegs
decisa 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.boolean
hasGivenUp()
void
setGiveUp(boolean giveUp)
Imposta una volontà del giocatore di arrendersi o meno.void
setLastClue(java.util.List<ColorPegs> lastClue)
Imposta il valore memorizzato dell'ultima sequenza indizio relativa all'ultimo tentativo generato.void
toggleGiveUp()
Imposta la volontà del giocatoreCodeBreaker
di 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
ColorPegs
validi come sequenza tentativo.
-
toggleGiveUp
public void toggleGiveUp()
Imposta la volontà del giocatoreCodeBreaker
di arrendersi.
-
hasGivenUp
public boolean hasGivenUp()
- Returns:
- la volontà del giocatore
CodeBreaker
di arrendersi o meno
-
-