Interface HangmanUI

All Known Implementing Classes:
SimpleUI, SwingUI

public interface HangmanUI

HangmanUI is a Java Interface that describes the behavior of a user interface for the solitaire Hangman game. The user interface allows the player to guess letters and displays the correctly guessed letters.

Version:
1.0
Author:
J. Dalbey

Method Summary
 void display()
          Start the display.
 void playAgain()
          Handle end of game, asking if the player wants another game If yes, start a new game, otherwise exit.
 void setBoard(Board theBoard)
          Save a reference to the instance of the Board.
 void setParent(HangmanLogic parent)
          Save a reference to the parent
 void showBoard()
          Display the current state of the board.
 void showLose()
          Display that the player lost the game.
 void showWin()
          Display that the player won the game.
 

Method Detail

display

public void display()
Start the display. For event-driven interfaces this method simply makes the interface visible. For sequential (e.g. console-based) interfaces, this method must implement its own event loop.


playAgain

public void playAgain()
Handle end of game, asking if the player wants another game If yes, start a new game, otherwise exit.


setBoard

public void setBoard(Board theBoard)
Save a reference to the instance of the Board.


setParent

public void setParent(HangmanLogic parent)
Save a reference to the parent


showBoard

public void showBoard()
Display the current state of the board. Specifically, display the turn counter and display the board in some formatted manner.


showLose

public void showLose()
Display that the player lost the game. Reveal the solution.


showWin

public void showWin()
Display that the player won the game.