games.jotto.players
Class HumanGuesser

java.lang.Object
  extended by games.jotto.players.JottoGuesser
      extended by games.jotto.players.HumanGuesser

public class HumanGuesser
extends JottoGuesser

This is the Human Guessing Class The method processHumanGuess is called when the human is guessing the model's secret word. The model responds with the number of letters in common with the secret word (by sending this number back to the view-controller).

Author:
vr28, jtl7

Field Summary
 
Fields inherited from class games.jotto.players.JottoGuesser
myConstants, myJottoModel, myMaxGuesses, myNumberOfGuesses, myWord, myWordList
 
Constructor Summary
HumanGuesser(int maxGuesses, IJottoModel currentJottoGame, java.util.ArrayList<java.lang.String> wordList)
           
 
Method Summary
 void newGame()
          subclasses MUST implement the following three classes: 1) newGame 2) process 3) revealHint 4) revealAnswer
 void process(java.lang.String response)
          Process input from the user.
 void revealAnswer()
           
 void revealHint()
           
protected  void tellModelWhosePlaying()
          Designates whether human or computer is guessing to model so it can tell Gui
 
Methods inherited from class games.jotto.players.JottoGuesser
commonCount, displayNumberOfGuessesLeft, getRandomWord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HumanGuesser

public HumanGuesser(int maxGuesses,
                    IJottoModel currentJottoGame,
                    java.util.ArrayList<java.lang.String> wordList)
Method Detail

newGame

public void newGame()
Description copied from class: JottoGuesser
subclasses MUST implement the following three classes: 1) newGame 2) process 3) revealHint 4) revealAnswer

Specified by:
newGame in class JottoGuesser

tellModelWhosePlaying

protected void tellModelWhosePlaying()
Designates whether human or computer is guessing to model so it can tell Gui

Specified by:
tellModelWhosePlaying in class JottoGuesser

process

public void process(java.lang.String response)
Process input from the user. The input is either a word being guessed This method does rudimentary analysis of response for legality (word in dictionary, number in range) and then calls abstract methods implemented by a subclass.

Specified by:
process in class JottoGuesser
Parameters:
response - five letter word

revealAnswer

public void revealAnswer()
Overrides:
revealAnswer in class JottoGuesser

revealHint

public void revealHint()
Overrides:
revealHint in class JottoGuesser