Class CodeBreaker

  • Direct Known Subclasses:
    DonaldKnuthBreaker, InteractiveBreaker, RandomBotBreaker

    public abstract class CodeBreaker
    extends java.lang.Object
    Responsabilità: rappresentazione di un giocatore CodeBreaker, il cui compito è quello di indovinare la sequenza di ColorPegs decisa dal giocatore CodeMaker.
    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 giocatore CodeBreaker di arrendersi.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CodeBreaker

        public CodeBreaker()
    • 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 giocatore CodeBreaker di arrendersi.
      • hasGivenUp

        public boolean hasGivenUp()
        Returns:
        la volontà del giocatore CodeBreaker di arrendersi o meno