Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jdwsoftware.wfh.model
Class NumberGame  view NumberGame download NumberGame.java

java.lang.Object
  extended bycom.jdwsoftware.wfh.model.GameType
      extended bycom.jdwsoftware.wfh.model.NumberGame

public class NumberGame
extends GameType

Title: Woody's Fishing Hole

Description: Educational Fishing Game

Copyright: Copyright (C) 2003 JDW Software, LLC

Company: JDW Software, LLC

Version:
$Revision: 1.6 $

Field Summary
private  java.util.Hashtable _images
           
private  java.lang.String _question
           
private static java.lang.String COPYRIGHT
           
private static java.lang.String[] NUMBERS
           
private static java.util.Random r
           
private static java.lang.String VERSION
           
 
Fields inherited from class com.jdwsoftware.wfh.model.GameType
_caller, BORDER, HEIGHT, WIDTH
 
Constructor Summary
NumberGame(javax.swing.JComponent caller)
           
 
Method Summary
 java.lang.String getAnswer()
          Get the string representation of the answer to getQuestion()
 java.awt.Image getAnswer(java.lang.String s)
          Given an answer string, get the corresponding image to put on the fish.
 java.awt.Image getQuestion()
          Get the question image this is to be displayed on the passed component
 java.lang.String[] getValidAnswers()
          Get a set of all possible answers.
 void newQuestion()
          Call new question to generate a new question and answer
 
Methods inherited from class com.jdwsoftware.wfh.model.GameType
getHeight, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

private static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

private static final java.lang.String VERSION
See Also:
Constant Field Values

NUMBERS

private static final java.lang.String[] NUMBERS

_images

private java.util.Hashtable _images

_question

private java.lang.String _question

r

private static java.util.Random r
Constructor Detail

NumberGame

public NumberGame(javax.swing.JComponent caller)
Method Detail

newQuestion

public void newQuestion()
Description copied from class: GameType
Call new question to generate a new question and answer

Specified by:
newQuestion in class GameType

getQuestion

public java.awt.Image getQuestion()
Description copied from class: GameType
Get the question image this is to be displayed on the passed component

Specified by:
getQuestion in class GameType

getAnswer

public java.lang.String getAnswer()
Description copied from class: GameType
Get the string representation of the answer to getQuestion()

Specified by:
getAnswer in class GameType

getValidAnswers

public java.lang.String[] getValidAnswers()
Description copied from class: GameType
Get a set of all possible answers. This is a set of string answers.

Specified by:
getValidAnswers in class GameType

getAnswer

public java.awt.Image getAnswer(java.lang.String s)
Description copied from class: GameType
Given an answer string, get the corresponding image to put on the fish.

Specified by:
getAnswer in class GameType