|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdbrown.TextView
public class TextView
A simple text interface to the Hangman game. This illustrates how a model (in this case the Hangman game) can be viewed by different interfaces. This is a text-only view of the model, whereas other views are GUI based.
Nested Class Summary | |
---|---|
private class |
TextView.GameListener
Is called by the Hangman model to display the current state of the model when the model is started and whenever a guess is made. |
private class |
TextView.LoseListener
Displays a message when the game is lost. |
private class |
TextView.WinListener
Displays a message when the game is won. |
Field Summary | |
---|---|
private Hangman |
model
The Hangman game object. |
Constructor Summary | |
---|---|
TextView(Hangman model)
|
Method Summary | |
---|---|
void |
play()
Play the Hangman game by instantiating the game and asking the user for input. |
private void |
registerListeners()
Registers model property listeners. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Hangman model
Constructor Detail |
---|
public TextView(Hangman model)
model
- Method Detail |
---|
public void play()
private void registerListeners()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |